get rid of cursor highlighting

This commit is contained in:
ksyasuda 2023-08-16 18:17:45 -07:00
parent d0ea29e2b5
commit 859fbb0612
No known key found for this signature in database
2 changed files with 2 additions and 39 deletions

View File

@ -360,7 +360,7 @@ require('packer').startup(function(use)
vim.g.doom_one_plugin_startify = true vim.g.doom_one_plugin_startify = true
vim.g.doom_one_plugin_whichkey = true vim.g.doom_one_plugin_whichkey = true
vim.g.doom_one_plugin_indent_blankline = true vim.g.doom_one_plugin_indent_blankline = true
vim.g.doom_one_plugin_vim_illuminate = true vim.g.doom_one_plugin_vim_illuminate = false
vim.g.doom_one_plugin_lspsaga = false vim.g.doom_one_plugin_lspsaga = false
end, end,
config = function() config = function()

View File

@ -6,39 +6,6 @@ local lspconfig = require('lspconfig')
local luasnip = require 'luasnip' local luasnip = require 'luasnip'
local highlight = require('cmp.utils.highlight') local highlight = require('cmp.utils.highlight')
local highlight_symbol_under_cursor = function()
vim.cmd [[
hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
]]
vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
vim.api.nvim_clear_autocmds({
buffer = bufnr,
group = 'lsp_document_highlight'
})
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
group = 'lsp_document_highlight',
buffer = bufnr,
callback = vim.lsp.buf.document_highlight
})
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
group = 'lsp_document_highlight',
buffer = bufnr,
callback = vim.lsp.buf.clear_references
})
end
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
return false
end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match(
"^%s*$") == nil
end
lspkind.init({ symbol_map = { Copilot = "" } }) lspkind.init({ symbol_map = { Copilot = "" } })
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" }) vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
@ -244,15 +211,11 @@ for _, lsp in ipairs(servers) do
if lsp == 'lua_ls' then if lsp == 'lua_ls' then
lspconfig[lsp].setup { lspconfig[lsp].setup {
-- on_attach = my_custom_on_attach, -- on_attach = my_custom_on_attach,
on_attach = highlight_symbol_under_cursor(),
capabilities = capabilities, capabilities = capabilities,
callSnippet = "Replace" callSnippet = "Replace"
} }
else else
lspconfig[lsp].setup { lspconfig[lsp].setup { capabilities = capabilities }
on_attach = highlight_symbol_under_cursor(),
capabilities = capabilities
}
end end
end end