diff options
author | Matthew Lemon <y@yulqen.org> | 2023-04-07 20:56:19 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-04-07 20:56:19 +0100 |
commit | 7798ccbe30c3b82ca4ae164eace30f1e82997bc7 (patch) | |
tree | 08c867ed77d96ad119ae83c03bd5f2029ed9baa7 /nvim/after/plugin/dap.lua | |
parent | 3fde8747b178ab76788e245419653f3c173a2abc (diff) |
DAP debugging set up - but not as impressive as pdb
This has UI for debugging but it is nothing compared to vim-test and
pdbpp.
Diffstat (limited to '')
-rw-r--r-- | nvim/after/plugin/dap.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua new file mode 100644 index 0000000..495445f --- /dev/null +++ b/nvim/after/plugin/dap.lua @@ -0,0 +1,30 @@ +local dap = require('dap') +dap.adapters.python = { + type = 'executable'; + command = '.venv/bin/python'; + args = { '-m', 'debugpy.adapter' }; +} + +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) |