get rid of cursor highlighting
This commit is contained in:
parent
d0ea29e2b5
commit
859fbb0612
@ -360,7 +360,7 @@ require('packer').startup(function(use)
|
||||
vim.g.doom_one_plugin_startify = true
|
||||
vim.g.doom_one_plugin_whichkey = 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
|
||||
end,
|
||||
config = function()
|
||||
|
@ -6,39 +6,6 @@ local lspconfig = require('lspconfig')
|
||||
local luasnip = require 'luasnip'
|
||||
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 = "" } })
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||
@ -244,15 +211,11 @@ for _, lsp in ipairs(servers) do
|
||||
if lsp == 'lua_ls' then
|
||||
lspconfig[lsp].setup {
|
||||
-- on_attach = my_custom_on_attach,
|
||||
on_attach = highlight_symbol_under_cursor(),
|
||||
capabilities = capabilities,
|
||||
callSnippet = "Replace"
|
||||
}
|
||||
else
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = highlight_symbol_under_cursor(),
|
||||
capabilities = capabilities
|
||||
}
|
||||
lspconfig[lsp].setup { capabilities = capabilities }
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user