~whynothugo/dotfiles

f137e4114d51951b30bfb5fa73eaa692f8ce0852 — Hugo Osvaldo Barrera 26 days ago f5ee7f9
nvim: Avoid wrapper command for Trouble
1 files changed, 6 insertions(+), 2 deletions(-)

M home/.config/nvim/lua/mappings.lua
M home/.config/nvim/lua/mappings.lua => home/.config/nvim/lua/mappings.lua +6 -2
@@ 100,8 100,12 @@ vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { remap = true })
vim.keymap.set("n", "<Leader>h", vim.lsp.buf.hover, { remap = true })
-- TODO: focus the hover float after creating it.
-- TODO: Also map <Esc> to closing it. The goal is to be able to easily scroll AND dismiss it.
vim.keymap.set("n", "<Leader>r", "<cmd>Trouble lsp_references<CR>", { remap = true })
vim.keymap.set("n", "<Leader>e", "<cmd>TroubleToggle document_diagnostics group=false<CR>", { remap = true })
vim.keymap.set("n", "<Leader>r", function()
  require("trouble").toggle("lsp_references")
end)
vim.keymap.set("n", "<Leader>e", function()
  require("trouble").toggle({ "document_diagnostics", group = false })
end)

-- TODO: goto_next calls vim.diagnostic.show_line_diagnostics
-- Overrride that to make it wrap and also maybe use a split.