adds lspsaga
This commit is contained in:
parent
3d7e4b5e48
commit
14c8746a1f
3 changed files with 91 additions and 19 deletions
|
@ -21,7 +21,6 @@ return {
|
|||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>k', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', 'gK', vim.lsp.buf.signature_help, bufopts)
|
||||
|
@ -32,8 +31,6 @@ return {
|
|||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>cw', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
end
|
||||
|
@ -70,6 +67,73 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
event = 'LspAttach',
|
||||
config = function()
|
||||
require('lspsaga').setup({
|
||||
symbol_in_winbar = {
|
||||
enable = false,
|
||||
show_file = false
|
||||
},
|
||||
finder = {
|
||||
keys = {
|
||||
toggle_or_open = "<cr>",
|
||||
quit = {'<Esc>', 'q'}
|
||||
}
|
||||
},
|
||||
outline = {
|
||||
win_position = 'left',
|
||||
win_width = 45,
|
||||
},
|
||||
lightbulb = {
|
||||
enable = false
|
||||
},
|
||||
ui = {
|
||||
code_action = ' '
|
||||
},
|
||||
rename = {
|
||||
in_select = false,
|
||||
keys = {
|
||||
quit = {'<Esc>', 'q'},
|
||||
select = '<Space>'
|
||||
}
|
||||
},
|
||||
hover_doc = {
|
||||
open_cmd = '!firefox'
|
||||
},
|
||||
code_action = {
|
||||
keys = {
|
||||
quit = {'<Esc>', 'q'}
|
||||
}
|
||||
},
|
||||
definition = {
|
||||
keys = {
|
||||
quit = {'<Esc>', 'q'},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts)
|
||||
vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts)
|
||||
vim.keymap.set('n', '<space>cw', '<cmd>Lspsaga rename mode=n<cr>', opts)
|
||||
vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts)
|
||||
vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts)
|
||||
vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts)
|
||||
vim.keymap.set('n', '<space>sco', '<cmd>Lspsaga outgoing_calls<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>k', '<cmd>Lspsaga hover_doc<cr>', bufopts)
|
||||
vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<cr>', bufopts)
|
||||
vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts)
|
||||
vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', bufopts)
|
||||
vim.keymap.set('n', '<space>st', '<cmd>Lspsaga peek_type_definition<cr>', bufopts)
|
||||
|
||||
end,
|
||||
depedencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
lazy = true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue