feat: dap

This commit is contained in:
Fabio Montefuscolo 2024-03-07 17:49:33 +01:00
parent b33c5b6f26
commit d904925237
Signed by: fabiomontefuscolo
GPG key ID: B98DA1C6A4DE48B5
2 changed files with 50 additions and 0 deletions

View file

@ -23,4 +23,22 @@ M.copilot = {
}
}
M.dap = {
plugin = true,
n = {
["<leader>db"] = {"<cmd> DapToggleBreakpoint <CR>"}
}
}
M.dap_python = {
plugin = true,
n = {
["<leader>dpr"] = {
function()
require('dap-python').test_method()
end
}
}
}
return M

View file

@ -1,4 +1,36 @@
local plugins = {
{
"rcarriga/nvim-dap-ui",
dependencies = "mfussenegger/nvim-dap",
config = function()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
end
},
{
"mfussenegger/nvim-dap",
config = function(_, opts)
require("core.utils").load_mappings("dap")
end
},
{
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
config = function(_, opts)
local pyenv = os.getenv("VIRTUAL_ENV") or "/usr"
local path = pyenv .. "/bin/python3"
require("dap-python").setup(path)
require("core.utils").load_mappings("dap_python")
end,
},
{
"nvimtools/none-ls.nvim",
ft = {"python"},