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)"; + } + ]; +}