From be989b024756debc3a0207cb474af0da792292fc Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 9 Dec 2024 12:22:52 +0100 Subject: [PATCH] DAP UI: Toggle UI open/close with F4 --- after/plugin/dap/nvim-dap-ui.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/after/plugin/dap/nvim-dap-ui.lua b/after/plugin/dap/nvim-dap-ui.lua index 75a80da..3b968bb 100644 --- a/after/plugin/dap/nvim-dap-ui.lua +++ b/after/plugin/dap/nvim-dap-ui.lua @@ -9,10 +9,19 @@ dap.listeners.before.event_terminated["dapui_config"] = function() --dapui.close() end dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() + --dapui.close() end -vim.keymap.set('n', '', function() dapui.close() end) +local open = false +vim.keymap.set('n', '', function() + if open then + open = false + dapui.close() + else + open = true + dapui.open() + end +end) vim.keymap.set('n', '', function() dapui.eval() end) vim.api.nvim_set_hl(0, 'DapLogPoint', { ctermbg = 0, fg = '#61afef', bg = '#31353f' })