neovim plugin cleanup

This commit is contained in:
Alexander Navarro 2024-11-22 16:54:43 -03:00
parent 4a5a878a7f
commit 7c0c670e29
13 changed files with 311 additions and 360 deletions

View file

@ -1,24 +1,80 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = { "TroubleToggle", "Trouble" },
cmd = { "Trouble" },
keys = {
{ "<leader>fq", "<CMD>TroubleToggle<CR>", desc = "Toggle trouble" },
{ "<leader>fd", "<CMD>TroubleToggle workspace_diagnostics<CR>", desc = "Find diagnostics" },
{
"<leader>fD",
"<CMD>TroubleToggle document_diagnostics<CR>",
desc = "Find diagnostics in workspace",
"<cmd>Trouble diagnostics open<cr>",
desc = "Find diagnostics (Trouble)",
},
{
"<leader>fd",
"<cmd>Trouble diagnostics open filter.buf=0<cr>",
desc = "Find buffer diagnostics (Trouble)",
},
{
"<leader>ll",
"<cmd>Trouble symbols open<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>li",
"<cmd>Trouble lsp open<cr>",
desc = "LSP info of node (Trouble)",
},
{
"<leader>fq",
"<cmd>Trouble qflist open<cr>",
desc = "Quickfix List (Trouble)",
},
},
config = function()
require("trouble").setup({
mode = "document_diagnostics",
action_keys = {
open_split = "s",
open_vsplit = "v",
open_tab = "t",
opts = function()
---@type trouble.Window.opts
local win_opts = {
-- size = { width = 30, height = 0.5 },
minimal = true,
border = "rounded",
position = "bottom",
}
---@type trouble.Config
return {
focus = false,
---@type trouble.Window.opts
preview = {
type = "split",
relative = "win",
position = "top",
},
})
end,
---@type table<string, trouble.Action.spec|false>
keys = {
["<cr>"] = "jump_close",
["<2-leftmouse>"] = "jump_close",
["<c-v>"] = "jump_split_close",
["<c-s>"] = "jump_vsplit_close",
["v"] = "jump_split_close",
["s"] = "jump_vsplit_close",
["<c-k>"] = "cancel", -- hack to fool myself into thinking I move to the avobe window
},
win = win_opts,
---@type table<string, trouble.Mode>
modes = {
symbols = {
focus = true,
win = win_opts
},
lsp_references = {
focus = true,
win = win_opts
},
lsp = {
focus = true,
win = win_opts
},
}
}
end
}