diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 4d71879..1050dd0 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -2,11 +2,7 @@ "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, "NvChad": { "branch": "v2.5", "commit": "d042cc975247c2aa55fcb228e5d146dc1dc6c648" }, "base46": { "branch": "v3.0", "commit": "884b990dcdbe07520a0892da6ba3e8d202b46337" }, - "cmp-async-path": { "branch": "main", "commit": "98185a91d49ff5dd249aebf2f7456e18063fa2a0" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, @@ -17,11 +13,15 @@ "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" }, + "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, "nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-tree.lua": { "branch": "master", "commit": "8e8be709c9a93e1ebefde7964884a8b564bfd3e0" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "rustaceanvim": { "branch": "main", "commit": "5a3a4158857ee1f7ec839b6ddd87cc0083a19c5f" }, "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" }, "ui": { "branch": "v3.0", "commit": "3e67e9d5325fd47fdbc90ca00a147db2f3525754" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, diff --git a/config/nvim/lua/mappings.lua b/config/nvim/lua/mappings.lua index 783b78f..be83799 100644 --- a/config/nvim/lua/mappings.lua +++ b/config/nvim/lua/mappings.lua @@ -8,3 +8,21 @@ map("n", ";", ":", { desc = "CMD enter command mode" }) map("i", "jk", "") -- map({ "n", "i", "v" }, "", " w ") + +-- Nvim DAP +map("n", "dl", "lua require'dap'.step_into()", { desc = "Debugger step into" }) +map("n", "dj", "lua require'dap'.step_over()", { desc = "Debugger step over" }) +map("n", "dk", "lua require'dap'.step_out()", { desc = "Debugger step out" }) +map("n", "dc", "lua require'dap'.continue()", { desc = "Debugger continue" }) +map("n", "db", "lua require'dap'.toggle_breakpoint()", { desc = "Debugger toggle breakpoint" }) +map( + "n", + "dd", + "lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))", + { desc = "Debugger set conditional breakpoint" } +) +map("n", "de", "lua require'dap'.terminate()", { desc = "Debugger reset" }) +map("n", "dr", "lua require'dap'.run_last()", { desc = "Debugger run last" }) + +-- rustaceanvim +map("n", "dt", "lua vim.cmd('RustLsp testables')", { desc = "Debugger testables" }) diff --git a/config/nvim/lua/plugins/init.lua b/config/nvim/lua/plugins/init.lua index d028655..8b4b2c4 100644 --- a/config/nvim/lua/plugins/init.lua +++ b/config/nvim/lua/plugins/init.lua @@ -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" + }, + }, + }, }