From b40e4d33e4a915625bbd9aaa5456d43b8cf6fb5c Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Tue, 11 Jun 2024 07:39:41 +0200 Subject: [PATCH] feat(plugins): add vim-illuminate --- plugins/illuminate.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 plugins/illuminate.nix diff --git a/plugins/illuminate.nix b/plugins/illuminate.nix new file mode 100644 index 0000000..4f4f5b8 --- /dev/null +++ b/plugins/illuminate.nix @@ -0,0 +1,42 @@ +_: + +{ + opts = { + enable = true; + delay = 200; + largeFileOverrides.providers = [ "lsp" ]; + minCountToHighlight = 2; + + extraOptions = { + largeFileCutoff.__raw = "vim.tbl_get(require 'astrocore', 'config', 'features', 'large_buf', 'lines')"; + should_enable.__raw = "function(bufnr) return require('astrocore.buffer').is_valid(bufnr) end"; + }; + }; + + rootOpts.keymaps = [ + { + mode = "n"; + key = "]r"; + action.__raw = "function() require('illuminate').goto_next_reference(false) end"; + options.desc = "Next reference"; + } + { + mode = "n"; + key = "[r"; + action.__raw = "function() require('illuminate').goto_prev_reference(false) end"; + options.desc = "Previous reference"; + } + { + mode = "n"; + key = "ur"; + action.__raw = "function() require('illuminate').toggle_buf() end"; + options.desc = "Toggle reference highlighting (buffer)"; + } + { + mode = "n"; + key = "uR"; + action.__raw = "function() require('illuminate').toggle() end"; + options.desc = "Toggle reference highlighting (global)"; + } + ]; +}