local vim = require("vim") local cmd = vim.cmd -- Define dap mappings (:help dap-mapping) local prefix = ":lua require('dap')." Keymap("n", "", prefix .. "continue()") Keymap("n", "", prefix .. "step_over()") Keymap("n", "", prefix .. "step_into()") Keymap("n", "", prefix .. "step_out()") Keymap("n", "", prefix .. "toggle_breakpoint()") Keymap("n", "", prefix .. "set_breakpoint(vim.fn.input('Breakpoint condition: '))") Keymap("n", "", prefix .. "set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") Keymap("n", "di", prefix .. "repl.open()") Keymap("n", "dl", prefix .. "run_last()") -- Setup dap for python (requires nvim-dap-python plugin) require('dap-python').setup('/usr/bin/python') -- Path to python with `debugpy` library installed require('dap-python').test_runner = 'pytest' -- Use pytest to run unit tests -- Python mappings local pyprefix = ":lua require('dap-python')." Keymap("n", "dptm", pyprefix .. "test_method()") Keymap("n", "dptc", pyprefix .. "test_class()") Keymap("v", "ds", "" .. pyprefix .. "debug_selection()")