Highlight references to current word
This commit is contained in:
parent
f37e2a26dd
commit
a0ec7e7784
|
@ -79,6 +79,19 @@ return {
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
-- Lesser used LSP functionality
|
||||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||||
|
|
||||||
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
|
if client and client.server_capabilities.documentHighlightProvider then
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ return {
|
||||||
CmpItemAbbrMatchFuzzy = { fg = colors.aqua, bold = true },
|
CmpItemAbbrMatchFuzzy = { fg = colors.aqua, bold = true },
|
||||||
CmpItemMenu = { fg = colors.bg2 },
|
CmpItemMenu = { fg = colors.bg2 },
|
||||||
CmpItemKindFunction = { fg = colors.red },
|
CmpItemKindFunction = { fg = colors.red },
|
||||||
|
LspReferenceText = { fg = colors.bg0, bg = colors.neutral_purple },
|
||||||
|
LspReferenceRead = { link = "LspReferenceText" },
|
||||||
|
LspReferenceWrite = { link = "LspReferenceText" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user