diff options
Diffstat (limited to '')
| -rw-r--r-- | .vim/lua/internal/lsp.lua (renamed from .vim/lua/lsp.lua) | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/.vim/lua/lsp.lua b/.vim/lua/internal/lsp.lua index 8d16987..669c2c7 100644 --- a/.vim/lua/lsp.lua +++ b/.vim/lua/internal/lsp.lua @@ -27,15 +27,20 @@ local my_attach = function(client, bufnr) }) lspstatus.on_attach(client) - if client.supports_method('textDocument/symbols') then + if client.supports_method('textDocument/documentSymbol') then require('nvim-navic').attach(client, bufnr) - require('aerial').on_attach(client, bufnr) + -- require('aerial').on_attach(client, bufnr) + -- vim.keymap.set('n', 'g0', vim.lsp.buf.document_symbol, {buffer = bufnr}) + end + if client.supports_method('workspace/symbol') then + vim.keymap.set('n', 'gW' , vim.lsp.buf.workspace_symbol, {buffer = bufnr, desc = 'goto symbol'}) + vim.keymap.set('n', ';s' , require('telescope.builtin').lsp_workspace_symbols, {desc='lsp workspace symbols'}) end - if client.supports_method('textDocument/definition') then vim.keymap.set('n', '<C-]>' , vim.lsp.buf.definition, {buffer = bufnr, desc = 'goto definition'}) vim.keymap.set('n', 'gd' , vim.lsp.buf.definition, {buffer = bufnr, desc = 'goto definition'}) vim.keymap.set('n', 'gR' , vim.lsp.buf.references, {buffer = bufnr, desc = 'goto references'}) + vim.keymap.set('n', ';R' , require('telescope.builtin').lsp_references, {desc='lsp references'}) end if client.supports_method('textDocument/hover') then vim.keymap.set('n', 'K' , vim.lsp.buf.hover, {buffer = bufnr, desc = 'hover'}) @@ -52,7 +57,7 @@ local my_attach = function(client, bufnr) vim.api.nvim_create_autocmd('BufWritePre', { buffer = bufnr, group = group, - callback = function() require('lsp').format(vim.fn.expand('<afile>:p')) end, + callback = function() require('internal.lsp').format(vim.fn.expand('<afile>:p')) end, }) end if client.supports_method('textDocument/typeDefinition') then @@ -64,12 +69,6 @@ local my_attach = function(client, bufnr) if client.supports_method('textDocument/implementation') then vim.keymap.set('n', 'gI' , vim.lsp.buf.implementation, {buffer = bufnr, desc = 'goto implementation'}) end - if client.supports_method('workspace/symbol') then - vim.keymap.set('n', 'gW' , vim.lsp.buf.workspace_symbol, {buffer = bufnr, desc = 'goto symbol'}) - end - -- if client.resolved_capabilities.document_symbol then - -- vim.keymap.set('n', 'g0', vim.lsp.buf.document_symbol, {buffer = bufnr}) - -- end if client.supports_method('textDocument/codeAction') then vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, {buffer = bufnr, desc = 'code action'}) end @@ -181,6 +180,7 @@ local servers = { library = { [vim.env.VIMRUNTIME .. '/lua'] = true, [vim.env.VIMRUNTIME .. '/lua/vim/lsp'] = true, + [vim.fn.stdpath('config') .. '/lua'] = true, } }, telemetry = { |