diff --git a/Configs/nvim/.config/nvim/lazy-lock.json b/Configs/nvim/.config/nvim/lazy-lock.json index 9fc7452..b544204 100644 --- a/Configs/nvim/.config/nvim/lazy-lock.json +++ b/Configs/nvim/.config/nvim/lazy-lock.json @@ -4,6 +4,7 @@ "catppuccin": { "branch": "main", "commit": "56a9dfd1e05868cf3189369aad87242941396563" }, "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, + "dadbod-ui-yank": { "branch": "master", "commit": "b0fe1062485ce4fd44f4f41a1fe56090e7152843" }, "flatten.nvim": { "branch": "main", "commit": "72527798e75b5e34757491947c2cb853ce21dc0e" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "fzf-lua": { "branch": "main", "commit": "758173f499d15410ecb50c5519a41b27c33e645d" }, @@ -15,6 +16,9 @@ "mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" }, + "nvim-dap-view": { "branch": "main", "commit": "390dae6bf67f3342ebb481159932ef0fe54822ba" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" }, "nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, @@ -23,6 +27,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "render-markdown": { "branch": "main", "commit": "4a39681990fb515d00dd898de3d7bf2973805f1a" }, + "rustaceanvim": { "branch": "master", "commit": "66398662c07d265b226897500ed50eafba3dffb4" }, "smart-splits.nvim": { "branch": "master", "commit": "5ef94ca23b28148187846fc46f10184aad4d17b0" }, "transfer.nvim": { "branch": "main", "commit": "ab12253c09f83a5b0b6ee108fc131be45abe446a" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, diff --git a/Configs/nvim/.config/nvim/lua/aleidk/options.lua b/Configs/nvim/.config/nvim/lua/aleidk/options.lua index 07f633b..161dd11 100644 --- a/Configs/nvim/.config/nvim/lua/aleidk/options.lua +++ b/Configs/nvim/.config/nvim/lua/aleidk/options.lua @@ -156,9 +156,11 @@ vim.lsp.enable({ "nushell", "pyright", "ruff", - "rust_analyzer", + -- "rust_analyzer", -- managed by rustacean.nvim }) +vim.lsp.inlay_hint.enable(true) + vim.diagnostic.config({ virtual_lines = { current_line = true }, }) diff --git a/Configs/nvim/.config/nvim/lua/aleidk/plugins/database.lua b/Configs/nvim/.config/nvim/lua/aleidk/plugins/database.lua index 9a942cb..8571340 100644 --- a/Configs/nvim/.config/nvim/lua/aleidk/plugins/database.lua +++ b/Configs/nvim/.config/nvim/lua/aleidk/plugins/database.lua @@ -11,7 +11,7 @@ return { { "DBUIFindBuffer", }, keys = { - { "ud", "DBUIToggle", desc = "Toggle DB UI" }, + { "uD", "DBUIToggle", desc = "Toggle DB UI" }, }, init = function() -- Your DBUI configuration diff --git a/Configs/nvim/.config/nvim/lua/aleidk/plugins/debug.lua b/Configs/nvim/.config/nvim/lua/aleidk/plugins/debug.lua index 3dd6907..1e4764c 100644 --- a/Configs/nvim/.config/nvim/lua/aleidk/plugins/debug.lua +++ b/Configs/nvim/.config/nvim/lua/aleidk/plugins/debug.lua @@ -6,8 +6,93 @@ return { "igorlfs/nvim-dap-view", ---@module 'dap-view' ---@type dapview.Config - opts = {}, + opts = { + auto_toggle = true, + switchbuf = "useopen,uselast", + winbar = { + sections = { "watches", "scopes", "breakpoints", "repl", "console" }, + controls = { + enabled = true, + }, + }, + windows = { + terminal = { + start_hidden = true, + } + } + }, }, + }, + config = function() + local dap = require("dap") + + dap.adapters.codelldb = { + type = "executable", + command = "codelldb", + } + + dap.listeners.before['event_initialized']['toggle_lsp_virtual_text'] = function() + vim.lsp.inlay_hint.enable(false) + end + + dap.listeners.after['event_terminated']['toggle_lsp_virtual_text'] = function() + vim.lsp.inlay_hint.enable(true) + end + + require("nvim-dap-virtual-text").setup() + end, + keys = { + { + "dd", + function() + local dap = require("dap") + if dap.status() == "" then + dap.run_last() + else + dap.restart() + end + end, + desc = "Run last or restart debugger" + }, + { "db", function() require("dap").toggle_breakpoint() end, desc = "Toggle breakpoint" }, + { + "dB", + function() + vim.ui.input({ prompt = "Breakpoint condition: " }, function(input) + require("dap").set_breakpoint(input) + end) + end, + desc = "Conditional Breakpoint", + }, + { "dw", function() require("dap-view").add_expr() end, desc = "Watch expresion under cursor", mode = { "n", "v" } }, + { + "dW", + function() + vim.ui.input({ prompt = "Watch expresion: " }, function(input) + require("dap-view").add_expr(input) + end) + end, + desc = "Watch expression", + }, + { "dj", function() require("dap").step_over() end, desc = "Step over" }, + { "dJ", function() require("dap").continue() end, desc = "Continue" }, + { "dl", function() require("dap").step_into() end, desc = "Step into" }, + { "dk", function() require("dap").step_out() end, desc = "Step out" }, + { "dh", function() require("dap.ui.widgets").hover() end, desc = "Show expresion under cursor" }, + { "dx", function() require("dap").clear_breakpoints() end, desc = "Clear breakpoint" }, + { "dX", function() require("dap").terminate() end, desc = "Terminate" }, + { "ud", function() require("dap-view").toggle(true) end, desc = "Toggle dap-view" }, } - } + }, + { + "theHamsta/nvim-dap-virtual-text", + dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" }, + config = function() + require('nvim-dap-virtual-text').setup({ + only_first_definition = false, + all_references = true, + virt_text_pos = "eol", + }) + end + }, } diff --git a/Configs/nvim/.config/nvim/lua/aleidk/plugins/init.lua b/Configs/nvim/.config/nvim/lua/aleidk/plugins/init.lua index 153e3f6..c7668a8 100644 --- a/Configs/nvim/.config/nvim/lua/aleidk/plugins/init.lua +++ b/Configs/nvim/.config/nvim/lua/aleidk/plugins/init.lua @@ -38,4 +38,9 @@ return { lazy = false, priority = 1001, }, + { + 'mrcjkb/rustaceanvim', + version = '^6', -- Recommended + lazy = false, -- This plugin is already lazy + } } diff --git a/Configs/nvim/.config/nvim/lua/aleidk/plugins/mini.lua b/Configs/nvim/.config/nvim/lua/aleidk/plugins/mini.lua index 4450c78..7a7ab66 100644 --- a/Configs/nvim/.config/nvim/lua/aleidk/plugins/mini.lua +++ b/Configs/nvim/.config/nvim/lua/aleidk/plugins/mini.lua @@ -6,6 +6,14 @@ return { }, config = function() require('mini.icons').setup() + + vim.fn.sign_define("DapBreakpoint", { text = " ", texthl = "DapBreakpoint" }) + vim.fn.sign_define("DapBreakpointCondition", { text = " ", texthl = "DapBreakpointCondition" }) + vim.fn.sign_define("DapBreakpointRejected", { text = " ", texthl = "DapBreakpointRejected" }) + vim.fn.sign_define("DapLogPoint", { text = ".>", texthl = "DapLogPoint" }) + vim.fn.sign_define("DapStopped", { text = "󰁕 ", texthl = "DapStopped", numhl = "debugPC" }) + + require('mini.bracketed').setup({ diagnostic = { options = { severity = vim.diagnostic.severity.ERROR } }, }) @@ -139,6 +147,12 @@ return { { mode = "n", keys = "b", desc = "+Buffers" }, { mode = "n", keys = "bh", postkeys = "b" }, { mode = "n", keys = "bl", postkeys = "b" }, + { mode = "n", keys = "d", desc = "+Debugger" }, + { mode = "n", keys = "dh", postkeys = "d" }, + { mode = "n", keys = "dJ", postkeys = "d" }, + { mode = "n", keys = "dj", postkeys = "d" }, + { mode = "n", keys = "dk", postkeys = "d" }, + { mode = "n", keys = "dl", postkeys = "d" }, { mode = "n", keys = "f", desc = "+Find" }, { mode = "n", keys = "g", desc = "+Git" }, { mode = "n", keys = "l", desc = "+LSP" },