update lsp setup for rust, toml and trouble plugin

This commit is contained in:
Alexander Navarro 2025-01-21 10:31:01 -03:00
parent ca6a15812d
commit 6a7b800f8c
4 changed files with 19 additions and 8 deletions

View file

@ -1,3 +1,5 @@
---@module 'trouble'
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
@ -40,7 +42,7 @@ return {
---@type trouble.Config
return {
focus = false,
focus = true,
---@type trouble.Window.opts
preview = {
@ -51,13 +53,24 @@ return {
---@type table<string, trouble.Action.spec|false>
keys = {
["<cr>"] = "jump_close",
["<2-leftmouse>"] = "jump_close",
["<s-cr>"] = "jump_close",
["<cr>"] = "jump",
["<2-leftmouse>"] = "jump",
["<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
["a"] = function(view, ctx)
-- TODO: this is not possible until this issue is solved
-- https://github.com/neovim/neovim/issues/31206
local trouble = require("trouble")
view:action("jump_only")
vim.lsp.buf.code_action()
trouble.focus(view, ctx)
end,
},
win = win_opts,
---@type table<string, trouble.Mode>