From 34813d1dde1327f1a6214db9d50b12339e47210e Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Fri, 11 Sep 2026 21:57:50 +0530 Subject: feat(development/nixvim): added dap to nixvim Added debugging capabilities to nixvim with the nvim-dap plugin + some other supporting plugins for the interface. --- modules/development/nixvim/plugins/dap.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modules/development/nixvim/plugins/dap.nix (limited to 'modules/development/nixvim/plugins/dap.nix') diff --git a/modules/development/nixvim/plugins/dap.nix b/modules/development/nixvim/plugins/dap.nix new file mode 100644 index 0000000..215a41c --- /dev/null +++ b/modules/development/nixvim/plugins/dap.nix @@ -0,0 +1,7 @@ +# Debug Adapter Protocol client implementation for Neovim. +{ config, lib, ... }: +{ + config.programs.nixvim.plugins.dap = lib.mkIf config.development.nixvim.enable { + enable = true; + }; +} -- cgit v1.2.3 From 4befa9082c71e6ae323222de2838a1b2afc685be Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Mon, 14 Sep 2026 05:24:52 +0530 Subject: feat(development/nixvim): added dap keybindings --- modules/development/nixvim/plugins/dap-ui.nix | 22 ++++- modules/development/nixvim/plugins/dap.nix | 119 +++++++++++++++++++++++++- 2 files changed, 137 insertions(+), 4 deletions(-) (limited to 'modules/development/nixvim/plugins/dap.nix') diff --git a/modules/development/nixvim/plugins/dap-ui.nix b/modules/development/nixvim/plugins/dap-ui.nix index 5885e54..cc25d2d 100644 --- a/modules/development/nixvim/plugins/dap-ui.nix +++ b/modules/development/nixvim/plugins/dap-ui.nix @@ -1,7 +1,25 @@ # A UI for nvim-dap. { config, lib, ... }: { - config.programs.nixvim.plugins.dap-ui = lib.mkIf config.development.nixvim.enable { - enable = true; + config.programs.nixvim = lib.mkIf config.development.nixvim.enable { + plugins.dap-ui = { + enable = true; + }; + + keymaps = [ + # dap-ui controls + { + mode = "n"; + key = "du"; + action = "lua require('dapui').toggle()"; + options.desc = "Debug: Toggle UI"; + } + { + mode = "n"; + key = "de"; + action = "lua require('dapui').eval()"; + options.desc = "Debug: Eval Expression Under Cursor"; + } + ]; }; } diff --git a/modules/development/nixvim/plugins/dap.nix b/modules/development/nixvim/plugins/dap.nix index 215a41c..f45e029 100644 --- a/modules/development/nixvim/plugins/dap.nix +++ b/modules/development/nixvim/plugins/dap.nix @@ -1,7 +1,122 @@ # Debug Adapter Protocol client implementation for Neovim. { config, lib, ... }: { - config.programs.nixvim.plugins.dap = lib.mkIf config.development.nixvim.enable { - enable = true; + config.programs.nixvim = lib.mkIf config.development.nixvim.enable { + plugins.dap = { + enable = true; + + # Example adapter — adjust/add per language you actually debug. + # This one assumes you have `netcoredbg`/`codelldb`/etc. available, + # swap for whatever debuggers you use. + adapters.servers = { + # Example: python debugpy adapter + # python = { + # command = "${pkgs.python3Packages.debugpy}/bin/python"; + # args = [ "-m" "debugpy.adapter" ]; + # }; + }; + }; + + keymaps = [ + # Core DAP controls + { + mode = "n"; + key = "dc"; + action = "lua require('dap').continue()"; + options.desc = "Debug: Continue"; + } + { + mode = "n"; + key = "di"; + action = "lua require('dap').step_into()"; + options.desc = "Debug: Step Into"; + } + { + mode = "n"; + key = "do"; + action = "lua require('dap').step_over()"; + options.desc = "Debug: Step Over"; + } + { + mode = "n"; + key = "dO"; + action = "lua require('dap').step_out()"; + options.desc = "Debug: Step Out"; + } + { + mode = "n"; + key = "db"; + action = "lua require('dap').toggle_breakpoint()"; + options.desc = "Debug: Toggle Breakpoint"; + } + { + mode = "n"; + key = "dB"; + action = "lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))"; + options.desc = "Debug: Conditional Breakpoint"; + } + { + mode = "n"; + key = "dl"; + action = "lua require('dap').run_last()"; + options.desc = "Debug: Run Last"; + } + { + mode = "n"; + key = "dt"; + action = "lua require('dap').terminate()"; + options.desc = "Debug: Terminate"; + } + { + mode = "n"; + key = "dr"; + action = "lua require('dap').repl.toggle()"; + options.desc = "Debug: Toggle REPL"; + } + { + mode = "n"; + key = "dd"; + action = "lua vim.diagnostic.open_float()"; + options.desc = "Diagnostics: Line diagnostics float"; + } + { + mode = "n"; + key = "dx"; + action = "lua vim.diagnostic.close()"; + options.desc = "Diagnostics: Close float"; + } + { + mode = "n"; + key = "dn"; + action = "lua vim.diagnostic.goto_next()"; + options.desc = "Diagnostics: Next"; + } + { + mode = "n"; + key = "dp"; + action = "lua vim.diagnostic.goto_prev()"; + options.desc = "Diagnostics: Previous"; + } + { + mode = "n"; + key = "dq"; + action = "lua vim.diagnostic.setloclist()"; + options.desc = "Diagnostics: Load location list"; + } + ]; + + # Auto open/close dap-ui with the debug session lifecycle + extraConfigLua = '' + local dap, dapui = require("dap"), require("dapui") + 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 + ''; }; } -- cgit v1.2.3 From cd39b87e3d04ddeb5e6f35037badfa17a5918c5a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Tue, 15 Sep 2026 03:13:25 +0530 Subject: chore(development/nixvim): removed duplicate keymaps from dap and lsp --- modules/development/nixvim/plugins/dap.nix | 41 ------------------------------ 1 file changed, 41 deletions(-) (limited to 'modules/development/nixvim/plugins/dap.nix') diff --git a/modules/development/nixvim/plugins/dap.nix b/modules/development/nixvim/plugins/dap.nix index f45e029..02bffa6 100644 --- a/modules/development/nixvim/plugins/dap.nix +++ b/modules/development/nixvim/plugins/dap.nix @@ -4,17 +4,6 @@ config.programs.nixvim = lib.mkIf config.development.nixvim.enable { plugins.dap = { enable = true; - - # Example adapter — adjust/add per language you actually debug. - # This one assumes you have `netcoredbg`/`codelldb`/etc. available, - # swap for whatever debuggers you use. - adapters.servers = { - # Example: python debugpy adapter - # python = { - # command = "${pkgs.python3Packages.debugpy}/bin/python"; - # args = [ "-m" "debugpy.adapter" ]; - # }; - }; }; keymaps = [ @@ -73,36 +62,6 @@ action = "lua require('dap').repl.toggle()"; options.desc = "Debug: Toggle REPL"; } - { - mode = "n"; - key = "dd"; - action = "lua vim.diagnostic.open_float()"; - options.desc = "Diagnostics: Line diagnostics float"; - } - { - mode = "n"; - key = "dx"; - action = "lua vim.diagnostic.close()"; - options.desc = "Diagnostics: Close float"; - } - { - mode = "n"; - key = "dn"; - action = "lua vim.diagnostic.goto_next()"; - options.desc = "Diagnostics: Next"; - } - { - mode = "n"; - key = "dp"; - action = "lua vim.diagnostic.goto_prev()"; - options.desc = "Diagnostics: Previous"; - } - { - mode = "n"; - key = "dq"; - action = "lua vim.diagnostic.setloclist()"; - options.desc = "Diagnostics: Load location list"; - } ]; # Auto open/close dap-ui with the debug session lifecycle -- cgit v1.2.3