diff options
Diffstat (limited to 'nvim-primeagen/after/plugin/dap.lua')
-rw-r--r-- | nvim-primeagen/after/plugin/dap.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/nvim-primeagen/after/plugin/dap.lua b/nvim-primeagen/after/plugin/dap.lua new file mode 100644 index 0000000..fcfb94a --- /dev/null +++ b/nvim-primeagen/after/plugin/dap.lua @@ -0,0 +1,41 @@ +local dap = require('dap') +dap.adapters.python = { + type = 'executable'; + command = '.venv/bin/python'; + args = { '-m', 'debugpy.adapter' }; +} +dap.configurations.python = { + { + type = 'python'; + request = 'launch'; + name = "Launch file"; + program = "${file}"; + pythonPath = function() + return '.venv/bin/python' + end; + }, +} + +vim.keymap.set('n', '<F5>', function() require('dap').continue() end) +vim.keymap.set('n', '<F10>', function() require('dap').step_over() end) +vim.keymap.set('n', '<F11>', function() require('dap').step_into() end) +vim.keymap.set('n', '<F12>', function() require('dap').step_out() end) +vim.keymap.set('n', '<F9>', function() require('dap').toggle_breakpoint() end) +vim.keymap.set('n', '<Leader>B', function() require('dap').set_breakpoint() end) +vim.keymap.set('n', '<Leader>lp', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end) +vim.keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end) +vim.keymap.set('n', '<Leader>dl', function() require('dap').run_last() end) +vim.keymap.set({'n', 'v'}, '<Leader>dh', function() + require('dap.ui.widgets').hover() +end) +vim.keymap.set({'n', 'v'}, '<Leader>dp', function() + require('dap.ui.widgets').preview() +end) +vim.keymap.set('n', '<Leader>df', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.frames) +end) +vim.keymap.set('n', '<Leader>ds', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.scopes) +end) |