From 7798ccbe30c3b82ca4ae164eace30f1e82997bc7 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Fri, 7 Apr 2023 20:56:19 +0100 Subject: 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. --- nvim/after/plugin/dap.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nvim/after/plugin/dap.lua (limited to 'nvim/after/plugin/dap.lua') 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', '', function() require('dap').continue() end) +vim.keymap.set('n', '', function() require('dap').step_over() end) +vim.keymap.set('n', '', function() require('dap').step_into() end) +vim.keymap.set('n', '', function() require('dap').step_out() end) +vim.keymap.set('n', '', function() require('dap').toggle_breakpoint() end) +vim.keymap.set('n', 'B', function() require('dap').set_breakpoint() end) +vim.keymap.set('n', 'lp', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end) +vim.keymap.set('n', 'dr', function() require('dap').repl.open() end) +vim.keymap.set('n', 'dl', function() require('dap').run_last() end) +vim.keymap.set({'n', 'v'}, 'dh', function() + require('dap.ui.widgets').hover() +end) +vim.keymap.set({'n', 'v'}, 'dp', function() + require('dap.ui.widgets').preview() +end) +vim.keymap.set('n', 'df', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.frames) +end) +vim.keymap.set('n', 'ds', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.scopes) +end) -- cgit v1.2.3