This commit is contained in:
sudacode 2023-08-17 01:15:27 -07:00
commit 22be77e7e6
3 changed files with 27 additions and 56 deletions

View File

@ -365,7 +365,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()

View File

@ -6,31 +6,7 @@ local lspconfig = require('lspconfig')
local luasnip = require 'luasnip'
local highlight = require('cmp.utils.highlight')
local highlight_symbol_under_cursor = function()
-- if the client has not resolved the document highlight capability, then
-- don't do anything
if not vim.lsp.buf.document_highlight then return end
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 capabilities = require('cmp_nvim_lsp').default_capabilities()
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
@ -237,8 +213,6 @@ cmp.setup.cmdline(':', {
})
})
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local servers = {
'bashls', 'jedi_language_server', 'jsonls', 'yamlls', 'vimls', 'dotls',
'dockerls', 'html', 'cssls', 'lua_ls'
@ -252,10 +226,7 @@ for _, lsp in ipairs(servers) do
callSnippet = "Replace"
}
else
lspconfig[lsp].setup {
-- on_attach = highlight_symbol_under_cursor(),
capabilities = capabilities
}
lspconfig[lsp].setup {capabilities = capabilities}
end
end

View File

@ -20,7 +20,7 @@ ts.setup({
-- map actions.which_key to <C-h> (default: <C-/>)
-- actions.which_key shows the mappings for your picker,
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
-- ["<C-/?>"] = "which_key"
["<C-/>"] = "which_key"
}
},
file_ignore_patterns = { "^node_modules/", "^env/", "^__pycache__/" }