Skip to content

Commit

Permalink
chore: use LazyVim highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
rafi committed May 17, 2024
1 parent df4fa03 commit 9c04d45
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 47 deletions.
1 change: 1 addition & 0 deletions lua/rafi/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ map('n', '<A-}>', '<cmd>+tabmove<CR>', { desc = 'Tab Move Forwards' })
-- buffers
map('n', '<leader>bb', '<cmd>e #<CR>', { desc = 'Switch to Other Buffer' })
map('n', '<leader>`', '<cmd>e #<CR>', { desc = 'Switch to Other Buffer' })
map('n', '<leader>bD', '<cmd>:bd<cr>', { desc = 'Delete Buffer and Window' })

-- }}}
-- Selection {{{
Expand Down
3 changes: 3 additions & 0 deletions lua/rafi/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ vim.g.root_spec = { 'lsp', { '.git', 'lua' }, 'cwd' }
-- Set to false to disable.
vim.g.lazygit_config = true

-- Hide deprecation warnings
vim.g.deprecation_warnings = false

-- General
-- ===
-- stylua: ignore start
Expand Down
9 changes: 9 additions & 0 deletions lua/rafi/plugins/extras/ui/illuminate.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
return {

{
'neovim/nvim-lspconfig',
opts = { document_highlight = { enabed = false } },
},

-- Highlights other uses of the word under the cursor
{
'RRethy/vim-illuminate',
event = { 'BufReadPost', 'BufNewFile' },
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { 'lsp' },
},
under_cursor = false,
modes_allowlist = { 'n', 'no', 'nt' },
filetypes_denylist = {
Expand Down
43 changes: 0 additions & 43 deletions lua/rafi/plugins/lsp/highlight.lua

This file was deleted.

10 changes: 6 additions & 4 deletions lua/rafi/plugins/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ return {
codelens = {
enabled = false,
},
-- Enable lsp cursor word highlighting
document_highlight = {
enabled = true,
},
-- Add any global capabilities here
capabilities = {},
-- Formatting options for vim.lsp.buf.format
Expand Down Expand Up @@ -119,10 +123,6 @@ return {
-- Setup formatting, keymaps and highlights.
LazyVim.lsp.on_attach(function(client, buffer)
require('rafi.plugins.lsp.keymaps').on_attach(client, buffer)
if not LazyVim.has('vim-illuminate') then
require('rafi.plugins.lsp.highlight').on_attach(client, buffer)
end

local filter = { bufnr = buffer }
if not vim.diagnostic.is_enabled(filter) or vim.bo[buffer].buftype ~= '' then
vim.diagnostic.enable(false, filter)
Expand All @@ -141,6 +141,8 @@ return {
return ret
end

LazyVim.lsp.words.setup(opts.document_highlight)

-- Diagnostics signs and highlights.
if vim.fn.has('nvim-0.10.0') == 0 then
if type(opts.diagnostics.signs) ~= 'boolean' then
Expand Down

0 comments on commit 9c04d45

Please sign in to comment.