diff --git a/.config/nvim/lua/plugins/debugging.lua b/.config/nvim/lua/plugins/debugging.lua new file mode 100644 index 0000000..8edac7d --- /dev/null +++ b/.config/nvim/lua/plugins/debugging.lua @@ -0,0 +1,85 @@ +return { + { + "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + + vim.keymap.set("n", "db", dap.toggle_breakpoint, { desc = "Toggle Breakpoint" }) + vim.keymap.set("n", "dc", dap.continue, { desc = "Start/Continue" }) + vim.keymap.set("n", "do", dap.step_over, { desc = "Step Over" }) + vim.keymap.set("n", "di", dap.step_into, { desc = "Step Into" }) + vim.keymap.set("n", "dt", dap.terminate, { desc = "Terminate Session" }) + end, + }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "mfussenegger/nvim-dap-python", + "nvim-neotest/nvim-nio", + }, + config = function() + require("dapui").setup({ + layouts = { + { + elements = { + { id = "scopes", size = 0.5 }, + { id = "breakpoints", size = 0.25 }, + --{ id = "stacks", size = 0.25 }, + { id = "watches", size = 0.25 }, + }, + size = 0.3, + position = "left", + }, + { + elements = { + { id = "console", size = 0.6 }, + { id = "repl", size = 0.4 }, + }, + size = 10, + position = "bottom", + }, + }, + }) + require("dap-python").setup("uv") + local dap = require("dap") + + dap.listeners.after.event_initialized["dapui_config"] = function() + require("dapui").open() + end + + dap.listeners.before.event_terminated["dapui_config"] = function() + require("dapui").close() + end + + dap.listeners.before.event_exited["dapui_config"] = function() + require("dapui").close() + end + end, + }, + { + "linux-cultist/venv-selector.nvim", + branch = "regexp", + lazy = false, + dependencies = { + "neovim/nvim-lspconfig", + "mfussenegger/nvim-dap", + "mfussenegger/nvim-dap-python", + { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, + }, + keys = { + { "ea", "VenvSelect", desc = "Activate Virtual Environment" }, + { "es", "lua print(require('venv-selector').venv())", desc = "Show Active Virtual Environment" }, + }, + opts = { + search = { + vscode_venvs = { + command = "fdfind -p '.*/bin/python$' ~/VSCode/.venvs", + }, + code_venvs = { + command = "fdfind -p '.*/bin/python$' ~/Code/.venvs", + }, + }, + }, + }, +}