mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
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
This commit is contained in:
28
lua/absolute/after/dap.lua
Normal file
28
lua/absolute/after/dap.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
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)
|
||||
@@ -117,6 +117,13 @@ lspconfig["pyright"].setup({
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure python lsp
|
||||
lspconfig["pylsp"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- configure docker server
|
||||
lspconfig["dockerls"].setup({
|
||||
capabilities = capabilities,
|
||||
|
||||
@@ -14,3 +14,9 @@ require("mason-lspconfig").setup({
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
require("mason-nvim-dap").setup({
|
||||
ensure_installed = {
|
||||
"debugpy", -- python
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
@@ -31,3 +31,4 @@ vim.opt.updatetime = 50
|
||||
vim.opt.colorcolumn = ""
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
13
lua/absolute/plugins/dap.lua
Normal file
13
lua/absolute/plugins/dap.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
-- "theHamsta/nvim-dap-virtual-text",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
-- "nvim-telescope/telescope-dap.nvim",
|
||||
{ "mfussenegger/nvim-dap-python", ft = "python", dependencies = { "mfussenegger/nvim-dap" } },
|
||||
-- "Pocco81/DAPInstall.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("absolute.after.dap")
|
||||
end
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
"dccsillag/magma-nvim",
|
||||
config = function()
|
||||
vim.cmd([[ UpdateRemotePlugins ]])
|
||||
require("absolute.after.magma")
|
||||
end
|
||||
}
|
||||
@@ -2,6 +2,13 @@ return {
|
||||
'williamboman/mason.nvim',
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
require("absolute.after.mason")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>\\", "<cmd>NvimTreeToggle<CR>") -- toggle file explorer
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user