Compare commits

...

2 commits

Author SHA1 Message Date
7b1dcff3ce
feat: toggle dap ui shortcut 2024-04-04 20:38:47 +02:00
28ebd31fb9
feat: attach to debug py 2024-04-04 14:35:22 +02:00
2 changed files with 25 additions and 3 deletions

View file

@ -33,9 +33,25 @@ M.dap = {
M.dap_python = {
plugin = true,
n = {
["<leader>dpr"] = {
["<leader>dpu"] = {
function ()
local dapui = require("dapui")
dapui.toggle()
end
},
["<leader>dpa"] = {
function()
require('dap-python').test_method()
local dap = require('dap')
dap.run({
type = 'python',
request = 'attach',
name = 'Debugpy',
justMyCode = false,
connect = {
host = '127.0.0.1',
port = 5678,
}
})
end
}
}

View file

@ -16,6 +16,12 @@ local plugins = {
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
end
},
{
@ -34,7 +40,7 @@ local plugins = {
config = function(_, opts)
local pyenv = os.getenv("VIRTUAL_ENV") or "/usr"
local path = pyenv .. "/bin/python3"
require("dap-python").setup(path)
require("dap-python").setup(path, opts)
require("core.utils").load_mappings("dap_python")
end,
},