Skip to content

Commit

Permalink
feat(plugins): move to vim-illuminate to reference highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Apr 1, 2024
1 parent 8fe55d0 commit 1749d5a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lua/astronvim/plugins/_astrolsp_autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ return {
end,
},
},
lsp_document_highlight = {
cond = "textDocument/documentHighlight",
{
event = { "CursorHold", "CursorHoldI" },
desc = "Document Highlighting",
callback = function() vim.lsp.buf.document_highlight() end,
},
{
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "Document Highlighting Clear",
callback = function() vim.lsp.buf.clear_references() end,
},
},
lsp_auto_format = {
cond = function(client)
local config = assert(require("astrolsp").config)
Expand Down
1 change: 1 addition & 0 deletions lua/astronvim/plugins/configs/vim-illuminate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return function(_, opts) require("illuminate").configure(opts) end
29 changes: 29 additions & 0 deletions lua/astronvim/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,35 @@ return {
},
config = function(...) require "astronvim.plugins.configs.notify"(...) end,
},
{
"RRethy/vim-illuminate",
event = "User AstroFile",
dependencies = {
{
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
maps.n["]r"] = { function() require("illuminate")["goto_next_reference"](false) end, desc = "Next reference" }
maps.n["[r"] =
{ function() require("illuminate")["goto_prev_reference"](false) end, desc = "Previous reference" }
maps.n["<Leader>ur"] =
{ function() require("illuminate").toggle() end, desc = "Toggle reference highlighting" }
maps.n["<Leader>uR"] =
{ function() require("illuminate").toggle_buf() end, desc = "Toggle reference highlighting (buffer)" }
end,
},
},
opts = function()
return {
delay = 200,
min_count_to_highlight = 2,
large_file_cutoff = require("astrocore").config.features.max_file.lines,
large_file_overrides = { providers = { "lsp" } },
should_enable = function(bufnr) return require("astrocore.buffer").is_valid(bufnr) end,
}
end,
config = function(...) require "astronvim.plugins.configs.vim-illuminate"(...) end,
},
{
"stevearc/dressing.nvim",
lazy = true,
Expand Down

0 comments on commit 1749d5a

Please sign in to comment.