From 8f74db318ccc9f0bc363133933e7435af3bdcef9 Mon Sep 17 00:00:00 2001 From: jyuan0 Date: Fri, 5 Jul 2024 02:22:38 -0400 Subject: [PATCH] refactor(trouble): move options in keymaps for lsp and symbols to `opts` (#3917) ## What is this PR for? A user won't also have to override the keymaps if they set options for `Trouble lsp` or `symbols` in `opts` (assuming they want the mode to always open with certain options). ## Does this PR fix an existing issue? No. ## Checklist - [ x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. ---- The default for `Trouble symbols` already seems to be on the right, and neither lsp/symbols auto-focuses, so I left these out. --- lua/lazyvim/plugins/editor.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 2f035f6a..fa5d676e 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -256,16 +256,18 @@ return { { "folke/trouble.nvim", cmd = { "Trouble" }, - opts = {}, + opts = { + modes = { + lsp = { + win = { position = "right" }, + }, + }, + }, keys = { { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, - { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, - { - "cS", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP references/definitions/... (Trouble)", - }, + { "cs", "Trouble symbols toggle", desc = "Symbols (Trouble)" }, + { "cS", "Trouble lsp toggle", desc = "LSP references/definitions/... (Trouble)" }, { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, {