From a158be77247f8fb5d05ec4eb05d7547af511d849 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 24 Jul 2023 17:52:13 -0500 Subject: [PATCH] feat(nvim): improve trouble setup --- dots/.config/nvim/lua/plugins/plugins.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dots/.config/nvim/lua/plugins/plugins.lua b/dots/.config/nvim/lua/plugins/plugins.lua index 0d72b63c..3dfb6f6e 100755 --- a/dots/.config/nvim/lua/plugins/plugins.lua +++ b/dots/.config/nvim/lua/plugins/plugins.lua @@ -808,13 +808,24 @@ lazy.setup({ { "folke/trouble.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("trouble").setup({ + auto_close = true, + position = "right", + }) + vim.api.nvim_create_autocmd("BufLeave", { + pattern = "*Trouble*", + callback = function() + vim.api.nvim_win_close(0, true) + end, + }) + end, cmd = { "Trouble", "TroubleClose", "TroubleToggle", "TroubleRefresh", }, - opts = {}, }, -- Github CLI integration