From d9049252370c85603c6ec29327a260eb530b0ccc Mon Sep 17 00:00:00 2001 From: Fabio Montefuscolo Date: Thu, 7 Mar 2024 17:49:33 +0100 Subject: [PATCH] feat: dap --- mappings.lua | 18 ++++++++++++++++++ plugins.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/mappings.lua b/mappings.lua index 9d74d83..9228976 100644 --- a/mappings.lua +++ b/mappings.lua @@ -23,4 +23,22 @@ M.copilot = { } } +M.dap = { + plugin = true, + n = { + ["db"] = {" DapToggleBreakpoint "} + } +} + +M.dap_python = { + plugin = true, + n = { + ["dpr"] = { + function() + require('dap-python').test_method() + end + } + } +} + return M diff --git a/plugins.lua b/plugins.lua index 40d2171..73a6ab2 100644 --- a/plugins.lua +++ b/plugins.lua @@ -1,4 +1,36 @@ local plugins = { + { + "rcarriga/nvim-dap-ui", + dependencies = "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + local dapui = require("dapui") + dapui.setup() + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + end + }, + { + "mfussenegger/nvim-dap", + config = function(_, opts) + require("core.utils").load_mappings("dap") + end + }, + { + "mfussenegger/nvim-dap-python", + ft = "python", + dependencies = { + "mfussenegger/nvim-dap", + "rcarriga/nvim-dap-ui", + }, + config = function(_, opts) + local pyenv = os.getenv("VIRTUAL_ENV") or "/usr" + local path = pyenv .. "/bin/python3" + require("dap-python").setup(path) + require("core.utils").load_mappings("dap_python") + end, + }, { "nvimtools/none-ls.nvim", ft = {"python"},