From 28faa3ceb380cdc9e6359b0165f6f290bbd65a05 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 9 Sep 2024 13:15:01 +0200 Subject: [PATCH] add trouble document systems right --- lua/custom/plugins/lsp.lua | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua index b5f6c43..b399893 100644 --- a/lua/custom/plugins/lsp.lua +++ b/lua/custom/plugins/lsp.lua @@ -36,37 +36,37 @@ return { 'folke/trouble.nvim', cmd = 'Trouble', opts = { use_diagnostic_signs = true }, - -- stylua: ignore - keys = { - { 'ctb', "Trouble diagnostics toggle filter.buf=0", desc = 'Document Diagnostics (Trouble)' }, - { 'ctr', 'Trouble diagnostics toggle', desc = 'Workspace Diagnostics (Trouble)' }, - { 'ctq', "Trouble qflist toggle", desc = 'Quickfix List (Trouble)' }, - { 'ctl', "Trouble loclist toggle", desc = 'Location List (Trouble)' }, - { 'ctd', "Trouble symbols", desc = 'LSP symbols (Trouble)' }, - { 'ctt', "Trouble todo", desc = 'Todos (Trouble)' }, - { - '[q', - function() - if require('trouble').is_open() then - require('trouble').previous({ skip_groups = true, jump = true }) - else - vim.cmd.cprev() - end - end, - desc = 'Previous trouble/quickfix item', - }, - { - ']q', - function() - if require('trouble').is_open() then - require('trouble').next({ skip_groups = true, jump = true }) - else - vim.cmd.cnext() - end - end, - desc = 'Next trouble/quickfix item', - }, - }, + keys = { + { 'ctb', 'Trouble diagnostics toggle filter.buf=0', desc = 'Document Diagnostics (Trouble)' }, + { 'ctr', 'Trouble diagnostics toggle', desc = 'Workspace Diagnostics (Trouble)' }, + { 'ctq', 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)' }, + { 'ctl', 'Trouble loclist toggle', desc = 'Location List (Trouble)' }, + { 'ctd', 'Trouble symbols', desc = 'LSP symbols (Trouble)' }, + { 'ctt', 'Trouble todo', desc = 'Todos (Trouble)' }, + { 'cts', 'Trouble lsp_document_symbols toggle win.position=right', desc = 'Document [S]ymbols side (Trouble)' }, + { + '[q', + function() + if require('trouble').is_open() then + require('trouble').previous { skip_groups = true, jump = true } + else + vim.cmd.cprev() + end + end, + desc = 'Previous trouble/quickfix item', + }, + { + ']q', + function() + if require('trouble').is_open() then + require('trouble').next { skip_groups = true, jump = true } + else + vim.cmd.cnext() + end + end, + desc = 'Next trouble/quickfix item', + }, + }, }, { -- Autocompletion 'hrsh7th/nvim-cmp',