mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 12:48:01 +00:00
[neovim] Add lsp_saga
This commit is contained in:
parent
e04ec2d1b5
commit
9729277222
@ -38,16 +38,21 @@ keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
|
||||
-- Close buffers
|
||||
keymap("n", "<S-q>", "<cmd>Bdelete!<CR>", opts)
|
||||
|
||||
-- Toogle Trouble
|
||||
-- LSP / Diagnostics
|
||||
keymap("n", "<leader>xx", "<cmd>TroubleToggle<cr>", opts)
|
||||
keymap("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", opts)
|
||||
keymap("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", opts)
|
||||
keymap("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>", opts)
|
||||
keymap("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", opts)
|
||||
keymap("n", "gd", "<cmd>TroubleToggle lsp_definitions<cr>", opts)
|
||||
keymap("n", "gt", "<cmd>TroubleToggle lsp_type_definitions<cr>", opts)
|
||||
keymap("n", "gi", "<cmd>TroubleToggle lsp_implementations<cr>", opts)
|
||||
keymap("n", "gr", "<cmd>TroubleToggle lsp_references<cr>", opts)
|
||||
keymap("n", "K", "<cmd>Lspsaga hover_doc<cr>", opts)
|
||||
keymap("n", "D", "<cmd>Lspsaga show_line_diagnostics<cr>", opts)
|
||||
keymap("n", "gd", "<cmd>Lspsaga lsp_finder<cr>", opts)
|
||||
keymap("n", "<leader>ld", "<cmd>Lspsaga lsp_finder<cr>", opts)
|
||||
keymap("n", "<leader>la", "<cmd>Lspsaga code_action<cr>", opts)
|
||||
keymap("n", "<leader>lj", "<cmd>Lspsaga diagnostic_jump_next<cr>", opts)
|
||||
keymap("n", "<leader>lk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", opts)
|
||||
keymap("n", "<leader>lr", "<cmd>Lspsaga rename<cr>", opts)
|
||||
keymap("n", "<leader>lp", "<cmd>Lspsaga peek_definition<cr>", opts)
|
||||
|
||||
-- Better paste
|
||||
keymap("v", "p", '"_dP', opts)
|
||||
@ -95,3 +100,7 @@ keymap("n", "<leader>ss", ":SessionManager save_current_session<cr>", opts)
|
||||
-- Base64
|
||||
keymap("v", "<leader>64e", ":<c-u>lua require'b64'.encode()<cr>", opts)
|
||||
keymap("v", "<leader>64d", ":<c-u>lua require'b64'.decode()<cr>", opts)
|
||||
|
||||
-- Illuminate
|
||||
keymap("n", "<a-n>", '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', { noremap = true })
|
||||
keymap("n", "<a-p>", '<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>', { noremap = true })
|
||||
|
@ -77,13 +77,13 @@ return packer.startup(function(use)
|
||||
use({ "rafamadriz/friendly-snippets", commit = "c93311fbcc840210a2c0db574177d84a35a2c9c1" })
|
||||
|
||||
-- LSP
|
||||
use({ "neovim/nvim-lspconfig", commit = "c96ec574eacfff8ad8dd4bdb6e96a1b3dbd268fd" })
|
||||
use({ "williamboman/mason.nvim", commit = "d85d71e910d1b2c539d17ae0d47dad48f8f3c8a7" })
|
||||
use({ "neovim/nvim-lspconfig", commit = "f40eae01b8e353e9d6e61792567c7d3b9856fd20" })
|
||||
use({ "williamboman/mason.nvim", commit = "45714c54fb61a61c74724f64ca3f728c30ae01d2" })
|
||||
use({ "williamboman/mason-lspconfig.nvim", commit = "a910b4d50f7a32d2f9057d636418a16843094b7c" })
|
||||
use({ "jose-elias-alvarez/null-ls.nvim", commit = "07d4ed4c6b561914aafd787453a685598bec510f" })
|
||||
use({ "RRethy/vim-illuminate", commit = "a6d0b28ea7d6b9d139374be1f94a16bd120fcda3" })
|
||||
use({ "jose-elias-alvarez/null-ls.nvim", commit = "9c19fb55154e53dadb986d5aceed1c53e3131b35" })
|
||||
use({ "RRethy/vim-illuminate", commit = "fb83d835eac50baeef49aac20c524a80727db0ac" })
|
||||
use({ "folke/trouble.nvim", commit = "ed65f84abc4a1e5d8f368d7e02601fc0357ea15e" })
|
||||
use({ "simrat39/symbols-outline.nvim", commit = "6a3ed24c5631da7a5d418bced57c16b32af7747c" })
|
||||
use({ "glepnir/lspsaga.nvim", commit = "201dbbd13d6bafe1144475bbcae9efde224e07ec" })
|
||||
use({ "arkav/lualine-lsp-progress", commit = "56842d097245a08d77912edf5f2a69ba29f275d7" })
|
||||
|
||||
-- Telescope
|
||||
|
@ -3,13 +3,6 @@ if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<a-n>", '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', { noremap = true })
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<a-p>",
|
||||
'<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>',
|
||||
{ noremap = true }
|
||||
)
|
||||
illuminate.configure({
|
||||
delay = 200,
|
||||
filetypes_denylist = {
|
||||
|
@ -13,7 +13,6 @@ require("plugins.indentline")
|
||||
require("plugins.lsp")
|
||||
require("plugins.go")
|
||||
require("plugins.dap")
|
||||
require("plugins.outline")
|
||||
require("plugins.wilder")
|
||||
require("plugins.trouble")
|
||||
require("plugins.autosave")
|
||||
|
@ -53,13 +53,7 @@ local function lsp_keymaps(bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
|
||||
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
keymap(bufnr, "n", "D", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async=true }<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
end
|
||||
|
||||
|
@ -6,5 +6,6 @@ end
|
||||
require("plugins.lsp.mason")
|
||||
require("plugins.lsp.handlers").setup()
|
||||
require("plugins.lsp.null-ls")
|
||||
require("plugins.lsp.lsp-saga")
|
||||
|
||||
win.default_options.border = "rounded"
|
||||
|
15
.config/nvim/lua/plugins/lsp/lsp-saga.lua
Normal file
15
.config/nvim/lua/plugins/lsp/lsp-saga.lua
Normal file
@ -0,0 +1,15 @@
|
||||
local status_ok, lsp_saga = pcall(require, "lspsaga")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
lsp_saga.init_lsp_saga({
|
||||
border_style = "rounded",
|
||||
code_action_icon = "",
|
||||
preview_lines_above = 5,
|
||||
max_preview_lines = 15,
|
||||
show_outline = {
|
||||
win_width = 45,
|
||||
auto_preview = false,
|
||||
},
|
||||
})
|
@ -1,8 +0,0 @@
|
||||
local status_ok, outline = pcall(require, "symbols-outline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
outline.setup({
|
||||
width = 20,
|
||||
})
|
Loading…
Reference in New Issue
Block a user