aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nvim/plugins.vim75
1 files changed, 74 insertions, 1 deletions
diff --git a/nvim/plugins.vim b/nvim/plugins.vim
index 61d71f8..993d5d4 100644
--- a/nvim/plugins.vim
+++ b/nvim/plugins.vim
@@ -30,6 +30,8 @@ call plug#begin()
30 " Plug 'hrsh7th/cmp-cmdline' 30 " Plug 'hrsh7th/cmp-cmdline'
31 31
32 Plug 'lewis6991/gitsigns.nvim' 32 Plug 'lewis6991/gitsigns.nvim'
33
34 Plug 'RRethy/vim-illuminate'
33call plug#end() 35call plug#end()
34 36
35" EMMET 37" EMMET
@@ -83,7 +85,7 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
83local lspconfig = require('lspconfig') 85local lspconfig = require('lspconfig')
84 86
85lspconfig.clangd.setup{ 87lspconfig.clangd.setup{
86 cmd = { 'clangd18' }, 88 cmd = { 'clangd15' },
87 capabilities = capabilities 89 capabilities = capabilities
88} 90}
89 91
@@ -187,5 +189,76 @@ cmp.event:on(
187 'confirm_done', 189 'confirm_done',
188 cmp_autopairs.on_confirm_done() 190 cmp_autopairs.on_confirm_done()
189) 191)
192
193-- default configuration
194require('illuminate').configure({
195 -- providers: provider used to get references in the buffer, ordered by priority
196 providers = {
197 'lsp',
198 'treesitter',
199 'regex',
200 },
201 -- delay: delay in milliseconds
202 delay = 100,
203 -- filetype_overrides: filetype specific overrides.
204 -- The keys are strings to represent the filetype while the values are tables that
205 -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
206 filetype_overrides = {},
207 -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
208 filetypes_denylist = {
209 'dirbuf',
210 'dirvish',
211 'fugitive',
212 },
213 -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
214 -- You must set filetypes_denylist = {} to override the defaults to allow filetypes_allowlist to take effect
215 filetypes_allowlist = {},
216 -- modes_denylist: modes to not illuminate, this overrides modes_allowlist
217 -- See `:help mode()` for possible values
218 modes_denylist = {},
219 -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
220 -- See `:help mode()` for possible values
221 modes_allowlist = {},
222 -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
223 -- Only applies to the 'regex' provider
224 -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
225 providers_regex_syntax_denylist = {},
226 -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
227 -- Only applies to the 'regex' provider
228 -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
229 providers_regex_syntax_allowlist = {},
230 -- under_cursor: whether or not to illuminate under the cursor
231 under_cursor = true,
232 -- large_file_cutoff: number of lines at which to use large_file_config
233 -- The `under_cursor` option is disabled when this cutoff is hit
234 large_file_cutoff = nil,
235 -- large_file_config: config to use for large files (based on large_file_cutoff).
236 -- Supports the same keys passed to .configure
237 -- If nil, vim-illuminate will be disabled for large files.
238 large_file_overrides = nil,
239 -- min_count_to_highlight: minimum number of matches required to perform highlighting
240 min_count_to_highlight = 1,
241 -- should_enable: a callback that overrides all other settings to
242 -- enable/disable illumination. This will be called a lot so don't do
243 -- anything expensive in it.
244 should_enable = function(bufnr) return true end,
245 -- case_insensitive_regex: sets regex case sensitivity
246 case_insensitive_regex = false,
247})
248
249-- change the highlight style
250vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "Visual" })
251vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "Visual" })
252vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "Visual" })
253
254--- auto update the highlight style on colorscheme change
255vim.api.nvim_create_autocmd({ "ColorScheme" }, {
256 pattern = { "*" },
257 callback = function(ev)
258 vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "Visual" })
259 vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "Visual" })
260 vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "Visual" })
261 end
262})
190EOF 263EOF
191 264