Compare commits
2 commits
11aa5558aa
...
7b1dcff3ce
Author | SHA1 | Date | |
---|---|---|---|
7b1dcff3ce | |||
28ebd31fb9 |
2 changed files with 25 additions and 3 deletions
20
mappings.lua
20
mappings.lua
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue