Files
absolute-vim/lua/absolute/after/dap.lua
David Ibia 68421c4615 feat(dap.lua): add configuration for dap and dap-ui plugins to enable debugging features in Neovim
feat(lsp-config.lua): configure python lsp using pylsp to provide language server capabilities for Python files
refactor(magma.lua): remove magma plugin configuration as it is no longer used
feat(mason.lua): add configuration for mason and mason-nvim-dap plugins to enable package management and debugging features in Neovim
refactor(init.lua): set maplocalleader to "\\" for easier keybindings
refactor(remap.lua): remove setting mapleader to " " as it is no longer needed, add keybinding for toggling file explorer using NvimTreeToggle command
2024-01-03 01:13:50 +01:00

29 lines
751 B
Lua

local dap = require("dap")
local dapui = require("dapui")
local dap_python = require("dap-python")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
dap_python.setup(path)
-- Setup Mappings
local opts = { noremap = true, silent = true }
opts.desc = "Toggle breakpoint"
vim.keymap.set("n", "<leader>db", "<cmd> DapToggleBreakpoint<CR>", opts)
opts.desc = "Debug Python Run"
vim.keymap.set("n", "<leader>dpr", function()
dap_python.test_method()
end, opts)