diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua index 084ccb5..488c184 100644 --- a/lua/custom/plugins/lsp.lua +++ b/lua/custom/plugins/lsp.lua @@ -359,9 +359,36 @@ return { { 'mfussenegger/nvim-dap', lazy = false, - init = function() - require('core.utils').load_mappings 'debug' - end, + keys = { + { + 'db', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Set [D]ebug [B]reakpoint', + }, + { + 'dc', + function() + require('dap').continue() + end, + desc = '[D]ebug [C]ontinue', + }, + { + 'ds', + function() + require('dap').step_over() + end, + desc = 'Set [D]ebug [S]tep over', + }, + { + 'di', + function() + require('dap').step_into() + end, + desc = 'Set [D]ebug step [I]nto', + }, + }, config = function() local dap = require 'dap' local mason_registry = require 'mason-registry' @@ -408,9 +435,79 @@ return { }, { 'rcarriga/nvim-dap-ui', - init = function() - require('core.utils').load_mappings 'debug' - end, + keys = { + { + 'du', + function() + require('dapui').toggle() + end, + + desc = 'Open [D]ebug [U]i', + }, + { + 'dK', + function() + require('dap.ui.widgets').hover() + end, + + desc = 'Open [D]ebug [K] hover', + }, + { + 'du', + function() + require('dapui').toggle() + end, + + desc = 'Open [D]ebug [U]i', + }, + { + 'dws', + function() + local widgets = require 'dap.ui.widgets' + local my_sidebar = widgets.sidebar(widgets.scopes) + my_sidebar.open() + end, + desc = 'Open [D]ebug [W]indow [S]copes', + }, + { + 'dwf', + function() + local widgets = require 'dap.ui.widgets' + local my_sidebar = widgets.sidebar(widgets.frames) + my_sidebar.open() + end, + + desc = 'Open [D]ebug [W]indow [F]rames', + }, + { + 'dwi', + function() + local widgets = require 'dap.ui.widgets' + local my_sidebar = widgets.sidebar(widgets.sessions) + my_sidebar.open() + end, + desc = 'Open [D]ebug [W]indow sess[I]ons', + }, + { + 'dwt', + function() + local widgets = require 'dap.ui.widgets' + local my_sidebar = widgets.sidebar(widgets.threads) + my_sidebar.open() + end, + desc = 'Open [D]ebug [W]indow [T]hreads', + }, + { + 'dwe', + function() + local widgets = require 'dap.ui.widgets' + local my_sidebar = widgets.sidebar(widgets.expression) + my_sidebar.open() + end, + + desc = 'Open [D]ebug [W]indow [E]xpression', + }, + }, dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio',