From 945556897f695f75c4cdfea2279281d5136e5029 Mon Sep 17 00:00:00 2001 From: Adam Cooper Date: Tue, 2 Jan 2024 19:44:48 -0500 Subject: [PATCH] [neovim] Automatic toggling of dap-ui panels --- neovim/init.lua | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/neovim/init.lua b/neovim/init.lua index 8e112ca..6883487 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -495,16 +495,16 @@ vim.api.nvim_create_autocmd('LspAttach', { require('gitsigns').setup({ signs = { - add = { text = '│' }, - change = { text = '│' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, + add = { text = '│' }, + change = { text = '│' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, changedelete = { text = '~' }, - untracked = { text = '┆' }, + untracked = { text = '┆' }, }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { follow_files = true @@ -600,7 +600,18 @@ vim.keymap.set('n', 'st', 'Lspsaga term_toggle') require('dap-go').setup() -require('dapui').setup() +local dap, dapui = require("dap"), require("dapui") +dapui.setup() + +dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() +end +dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() +end +dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() +end -- Tweak GitSigns blame color -- This differentiates the cursorline from the git blame text