nvim: add lspsage

This commit is contained in:
Moritz Böhme 2023-02-27 23:48:21 +01:00
parent b0c16a0c41
commit f9109b6646
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
2 changed files with 15 additions and 8 deletions

View file

@ -72,6 +72,7 @@ in
gitsigns-nvim gitsigns-nvim
lsp_lines-nvim lsp_lines-nvim
lspkind-nvim lspkind-nvim
lspsaga-nvim-original
lualine-lsp-progress lualine-lsp-progress
lualine-nvim lualine-nvim
luasnip luasnip

View file

@ -259,18 +259,24 @@ vim.diagnostic.config({
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("lspsaga").setup({
symbol_in_winbar = {
enable = false,
},
})
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local on_attach_def = function(_, bufnr) local on_attach_def = function(_, bufnr)
wk.register({ wk.register({
K = { vim.lsp.buf.hover, "show info" }, K = { "<cmd>Lspsaga hover_doc ++quiet<cr>", "show info" },
["<leader>"] = { ["<leader>"] = {
l = { l = {
name = "lsp", name = "lsp",
d = { vim.diagnostic.open_float, "open diagnostic window" }, d = { "<cmd>Lspsaga show_cursor_diagnostics<cr>", "open diagnostic window" },
n = { vim.diagnostic.goto_next, "next error" }, n = { "<cmd>Lspsaga diagnostic_jump_next<CR>", "next error" },
p = { vim.diagnostic.goto_prev, "prev error" }, p = { "<cmd>Lspsaga diagnostic_jump_prev<CR>", "prev error" },
c = { vim.lsp.buf.code_action, "code action" }, c = { "<cmd>Lspsaga code_action<cr>", "code action" },
r = { vim.lsp.buf.rename, "rename" }, r = { "<cmd>Lspsaga rename<cr>", "rename" },
f = { f = {
function() function()
vim.lsp.buf.format({ async = true }) vim.lsp.buf.format({ async = true })
@ -298,10 +304,10 @@ local on_attach_def = function(_, bufnr)
g = { g = {
name = "goto", name = "goto",
r = { vim.lsp.buf.references, "references" }, r = { vim.lsp.buf.references, "references" },
d = { vim.lsp.buf.definition, "definition" }, d = { "<cmd>Lspsaga peek_definition<cr>", "definition" },
D = { vim.lsp.buf.declaration, "declaration" }, D = { vim.lsp.buf.declaration, "declaration" },
i = { vim.lsp.buf.implementation, "implementation" }, i = { vim.lsp.buf.implementation, "implementation" },
t = { vim.lsp.buf.type_definition, "type defininition" }, t = { "<cmd>Lspsaga peek_type_definition<cr>", "type defininition" },
}, },
}, { buffer = bufnr, silent = true }) }, { buffer = bufnr, silent = true })
end end