feat(nvim): add dap nvim

nixos
Moritz Böhme 2023-10-28 15:17:59 +02:00
parent c7e7b39d83
commit 8bc546daf0
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
{ pkgs, lib, ... }:
with builtins;
{
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-dap;
keys = [
{ key = "<leader>cb"; cmd = "<cmd>lua require('dap').toggle_breakpoint()<cr>"; desc = "Toggle breakpoint"; }
{ key = "<leader>cd"; cmd = "<cmd>lua require('dap').continue()<cr>"; desc = "Continue"; }
];
dependencies = [
{
plugin = nvim-dap-python;
ft = [ "python" ];
conf =
let
pythonWithDebugpy = pkgs.python3.withPackages (ps: with ps; [ debugpy ]);
in
/* lua */ ''
require("dap-python").setup("${lib.getExe pythonWithDebugpy}")
'';
}
{
plugin = nvim-dap-virtual-text;
opts = { };
}
{
plugin = nvim-dap-ui;
opts = { };
conf = /* lua */ ''
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
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
'';
}
];
}
];
}