return { "nvimdev/lspsaga.nvim", dependencies = { 'nvim-treesitter/nvim-treesitter', -- optional 'nvim-tree/nvim-web-devicons', -- optional }, config = function() local keymap = vim.keymap.set local saga = require('lspsaga') -- saga.init_lsp_saga() -- Lsp finder find the symbol definition implement reference -- if there is no implement it will hide -- when you use action in finder like open vsplit then you can -- use to jump back keymap("n", "gh", "Lspsaga lsp_finder", { silent = true }) -- Code action keymap({ "n", "v" }, "ca", "Lspsaga code_action", { silent = true }) -- Rename keymap("n", "gr", "Lspsaga rename", { silent = true }) -- Peek Definition -- you can edit the definition file in this flaotwindow -- also support open/vsplit/etc operation check definition_action_keys -- support tagstack C-t jump back keymap("n", "gd", "Lspsaga peek_definition", { silent = true }) -- Show line diagnostics keymap("n", "cd", "Lspsaga show_line_diagnostics", { silent = true }) -- Show cursor diagnostic keymap("n", "cd", "Lspsaga show_cursor_diagnostics", { silent = true }) -- Diagnsotic jump can use `` to jump back keymap("n", "[e", "Lspsaga diagnostic_jump_prev", { silent = true }) keymap("n", "]e", "Lspsaga diagnostic_jump_next", { silent = true }) -- Only jump to error keymap("n", "[E", function() require("lspsaga.diagnostic").goto_prev({ severity = vim.diagnostic.severity.ERROR }) end, { silent = true }) keymap("n", "]E", function() require("lspsaga.diagnostic").goto_next({ severity = vim.diagnostic.severity.ERROR }) end, { silent = true }) -- Outline keymap("n", "o", "LSoutlineToggle", { silent = true }) -- Hover Doc keymap("n", "K", "Lspsaga hover_doc", { silent = true }) -- Float terminal keymap("n", "", "Lspsaga open_floaterm", { silent = true }) -- if you want pass somc cli command into terminal you can do like this -- open lazygit in lspsaga float terminal keymap("n", "", "Lspsaga open_floaterm lazygit", { silent = true }) -- close floaterm keymap("t", "", [[Lspsaga close_floaterm]], { silent = true }) end }