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,
|
||||
|
|
|
@ -5,10 +5,14 @@ return {
|
|||
vim.api.nvim_set_option("showmode", false)
|
||||
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
|
||||
custom_gruvbox.normal.a.bg = '#89b482'
|
||||
custom_gruvbox.normal.c.bg = '#141617'
|
||||
custom_gruvbox.normal.c.bg = ''
|
||||
custom_gruvbox.insert.a.bg = '#d8a657'
|
||||
custom_gruvbox.visual.a.bg = '#a9b665'
|
||||
custom_gruvbox.replace.a.bg = '#ea6962'
|
||||
|
||||
local function lspsaga()
|
||||
return require('lspsaga.symbol.winbar').get_bar()
|
||||
end
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = custom_gruvbox,
|
||||
|
@ -29,14 +33,17 @@ return {
|
|||
icon = '',
|
||||
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
|
||||
padding = 1,
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
|
||||
padding = 1,
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
lspsaga
|
||||
}
|
||||
},
|
||||
lualine_x = {
|
||||
|
@ -95,14 +102,14 @@ return {
|
|||
'branch',
|
||||
icon = '',
|
||||
padding = 1,
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
padding = 1,
|
||||
path = 1,
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
|
|
|
@ -32,8 +32,9 @@ return {
|
|||
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', '<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>cw', "<cmd>Lspsaga rename mode=n<cr>", bufopts)
|
||||
-- vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts)
|
||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue