chore: optimize trouble launch

This commit is contained in:
2026-02-21 17:58:47 +02:00
parent 5fd60bd2ca
commit d980afbae1
2 changed files with 5 additions and 4 deletions

View File

@@ -27,7 +27,5 @@ require("lazy").setup({
install = { colorscheme = { "rose-pine" } }, install = { colorscheme = { "rose-pine" } },
ui = { border = "rounded" }, ui = { border = "rounded" },
change_detection = { enabled = false }, change_detection = { enabled = false },
rocks = { rocks = { hererocks = false },
hererocks = true,
},
}) })

View File

@@ -56,7 +56,7 @@ return {
end end
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc })
end end
local trouble = require("trouble") local trouble = nil
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
@@ -83,9 +83,11 @@ return {
vim.diagnostic.jump({ count = -1, float = true }) vim.diagnostic.jump({ count = -1, float = true })
end, "Diagnostic Prev") end, "Diagnostic Prev")
nmap("]d", function() nmap("]d", function()
trouble = trouble or require("trouble")
trouble.next({ mode = "diagnostics", skip_groups = true, jump = true }) trouble.next({ mode = "diagnostics", skip_groups = true, jump = true })
end, "LSP: Trouble Next") end, "LSP: Trouble Next")
nmap("[d", function() nmap("[d", function()
trouble = trouble or require("trouble")
trouble.prev({ mode = "diagnostics", skip_groups = true, jump = true }) trouble.prev({ mode = "diagnostics", skip_groups = true, jump = true })
end, "Trouble Prev") end, "Trouble Prev")
vim.keymap.set( vim.keymap.set(
@@ -95,6 +97,7 @@ return {
{ buffer = event.buf, desc = "LSP: Code [A]ction" } { buffer = event.buf, desc = "LSP: Code [A]ction" }
) )
nmap("gr", function() nmap("gr", function()
trouble = trouble or require("trouble")
trouble.toggle("lsp_references") trouble.toggle("lsp_references")
end, "[G]oto [R]eferences") end, "[G]oto [R]eferences")
nmap("gR", function() nmap("gR", function()