From 859fbb0612664cad80ac78dfec2366dd70f7881b Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Wed, 16 Aug 2023 18:17:45 -0700 Subject: [PATCH] get rid of cursor highlighting --- lua/plugins.lua | 2 +- plugin-confs/nvim-cmp.lua | 39 +-------------------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 0101c9f..24120f9 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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() diff --git a/plugin-confs/nvim-cmp.lua b/plugin-confs/nvim-cmp.lua index 19c2cd6..31bdb38 100644 --- a/plugin-confs/nvim-cmp.lua +++ b/plugin-confs/nvim-cmp.lua @@ -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