From e184d7cee358abc277a51f040cacf236f1eaceab Mon Sep 17 00:00:00 2001 From: JP Appel Date: Fri, 16 Aug 2024 16:28:22 -0400 Subject: removed lspzero, updated keymaps --- nvim/lua/plugins/diagnostics.lua | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 nvim/lua/plugins/diagnostics.lua (limited to 'nvim/lua/plugins/diagnostics.lua') diff --git a/nvim/lua/plugins/diagnostics.lua b/nvim/lua/plugins/diagnostics.lua new file mode 100644 index 0000000..78c3f02 --- /dev/null +++ b/nvim/lua/plugins/diagnostics.lua @@ -0,0 +1,67 @@ +return { + 'folke/trouble.nvim', + opts = {}, + cmd = 'Trouble', + keys = { + { + "df", + function() + local trouble = require("trouble") + local opts = { + mode = "diagnostics", + focus = true, + follow = false + } + if trouble.is_open(opts) then + trouble.close(opts) + else + trouble.open(opts) + end + end, + desc = "Diagnostics (Trouble)", + }, + { + "dF", + function() + local trouble = require("trouble") + local opts = { + mode = "diagnostics", + focus = true, + follow = false, + filter = { buf = 0 } + } + if not trouble.is_open(opts) then + trouble.open(opts) + trouble.focus(opts) + else + trouble.close(opts) + end + end, + desc = "Buffer Diagnostics (Trouble)", + }, + { + "[d", + function() + require("trouble").prev({ mode = "diagnostics", jump = true }) + end, + desc = "Previous project wide diagnostic" + }, + { + "]d", + function() + require("trouble").next({ mode = "diagnostics", jump = true }) + end, + desc = "Next project wide diagnostic" + }, + { + "dl", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "dq", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} -- cgit v1.2.3