local m = require("utility.mappings") local vim = require("vim") local cmd = vim.cmd -- Define dap mappings (:help dap-mapping) local prefix = ":lua require('dap')." m.keymap("n", "", prefix .. "continue()") m.keymap("n", "", prefix .. "step_over()") m.keymap("n", "", prefix .. "step_into()") m.keymap("n", "", prefix .. "step_out()") m.keymap("n", "", prefix .. "toggle_breakpoint()") m.keymap("n", "", prefix .. "set_breakpoint(vim.fn.input('Breakpoint condition: '))") m.keymap("n", "", prefix .. "set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") m.keymap("n", "di", prefix .. "repl.open()") m.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')." m.keymap("n", "dptm", pyprefix .. "test_method()") m.keymap("n", "dptc", pyprefix .. "test_class()") m.keymap("v", "ds", "" .. pyprefix .. "debug_selection()")