Add rust DAP debugging setup to nvim

Wires up nvim-dap, nvim-dap-ui and rustaceanvim, enables the
NvChad blink completion lazyspec, activates the treesitter
ensure_installed list and adds DAP/rustaceanvim keymaps.
This commit is contained in:
2026-06-28 21:02:24 +02:00
parent b59f07bdc1
commit 7acb45c3a9
3 changed files with 89 additions and 16 deletions

View File

@@ -13,16 +13,71 @@ return {
end,
},
-- test new blink
-- { import = "nvchad.blink.lazyspec" },
{
'mrcjkb/rustaceanvim',
-- To avoid being surprised by breaking changes,
-- I recommend you set a version range
version = '^9',
-- This plugin implements proper lazy-loading (see :h lua-plugin-lazy).
-- No need for lazy.nvim to lazy-load it.
lazy = false,
config = function()
local mason_registry = require('mason-registry')
local codelldb = mason_registry.get_package('codelldb')
local extension_path = codelldb:get_install_path() .. "/extension/"
local codelldb_path = extension_path .. "adapter/codelldb"
local liblldb_ext = vim.uv.os_uname().sysname == "Darwin" and "dylib" or "so"
local liblldb_path = extension_path .. "lldb/lib/liblldb." .. liblldb_ext
local cfg = require('rustaceanvim.config')
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
vim.g.rustaceanvim = {
dap = {
adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path),
},
}
end
},
{
'mfussenegger/nvim-dap',
config = function()
local dap, dapui = require('dap'), require('dapui')
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.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
end
},
{
'rcarriga/nvim-dap-ui',
dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' },
config = function()
require('dapui').setup()
end,
},
{ import = "nvchad.blink.lazyspec" },
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim", "lua", "vimdoc",
"html", "css"
},
},
},
}