From 03088ca0b34ba4112bd97d04a19d62aa477d701b Mon Sep 17 00:00:00 2001 From: pmcc Date: Sun, 2 Aug 2026 14:18:41 -0400 Subject: [PATCH] Update nvim --- dot_config/nvim/lsp/ols.lua | 5 ++ dot_config/nvim/lua/config/lsp.lua | 1 + dot_config/nvim/lua/plugins/conform.lua | 1 + dot_config/nvim/lua/plugins/dap.lua | 80 ++++++++++++++++++++++ dot_config/nvim/lua/plugins/init.lua | 2 + dot_config/nvim/lua/plugins/mini-icons.lua | 5 ++ dot_config/nvim/lua/plugins/treesitter.lua | 2 +- dot_config/nvim/nvim-pack-lock.json | 17 +++++ dot_tmux.conf | 2 + 9 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 dot_config/nvim/lsp/ols.lua create mode 100644 dot_config/nvim/lua/plugins/dap.lua create mode 100644 dot_config/nvim/lua/plugins/mini-icons.lua diff --git a/dot_config/nvim/lsp/ols.lua b/dot_config/nvim/lsp/ols.lua new file mode 100644 index 0000000..28f28d0 --- /dev/null +++ b/dot_config/nvim/lsp/ols.lua @@ -0,0 +1,5 @@ +return { + cmd = { "ols" }, + filetypes = { "odin" }, + root_markers = { "ols.json", ".git" }, +} diff --git a/dot_config/nvim/lua/config/lsp.lua b/dot_config/nvim/lua/config/lsp.lua index aa638c8..0430c27 100644 --- a/dot_config/nvim/lua/config/lsp.lua +++ b/dot_config/nvim/lua/config/lsp.lua @@ -53,6 +53,7 @@ vim.api.nvim_create_autocmd("LspAttach", { -- Enable LSP servers for Neovim 0.11+ vim.lsp.enable({ "lua_ls", + "ols", }) -- Load Lsp on-demand, e.g: eslint is disable by default diff --git a/dot_config/nvim/lua/plugins/conform.lua b/dot_config/nvim/lua/plugins/conform.lua index f4c642a..62e89a7 100644 --- a/dot_config/nvim/lua/plugins/conform.lua +++ b/dot_config/nvim/lua/plugins/conform.lua @@ -5,6 +5,7 @@ vim.pack.add({ require("conform").setup({ formatters_by_ft = { lua = { "stylua" }, + odin = { "odinfmt" }, go = { "goimports", "gofmt" }, python = { "ruff_format", "black", stop_after_first = true }, json = { "biome", "prettier", stop_after_first = true }, diff --git a/dot_config/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..06fbd02 --- /dev/null +++ b/dot_config/nvim/lua/plugins/dap.lua @@ -0,0 +1,80 @@ +vim.pack.add({ + { src = "https://github.com/mfussenegger/nvim-dap" }, + { src = "https://github.com/rcarriga/nvim-dap-ui" }, + { src = "https://github.com/nvim-neotest/nvim-nio" }, +}) + +local dap = require("dap") +local dapui = require("dapui") + +local lldb_dap = vim.fn.exepath("lldb-dap") +if lldb_dap == "" then + vim.notify("lldb-dap not found — install lldb (pacman -S lldb)", vim.log.levels.WARN) +end + +dap.adapters.lldb = { + type = "executable", + command = lldb_dap, + name = "lldb", +} + +local function project_binary() + local cwd = vim.fn.getcwd() + return cwd .. "/" .. vim.fn.fnamemodify(cwd, ":t") +end + +dap.configurations.odin = { + { + type = "lldb", + request = "launch", + name = "Launch Odin", + cwd = function() + return vim.fn.getcwd() + end, + program = project_binary, + }, +} + +dapui.setup({}) + +dap.listeners.after.event_initialized["dapui"] = dapui.open +dap.listeners.before.event_terminated["dapui"] = dapui.close +dap.listeners.before.event_exited["dapui"] = dapui.close + +local function run_or_continue() + if dap.session() then + dap.continue() + elseif vim.bo.filetype == "odin" then + vim.system({ "odin", "build", ".", "-debug" }, { cwd = vim.fn.getcwd() }, function(obj) + if obj.code ~= 0 then + vim.notify("odin build failed (code " .. obj.code .. ")", vim.log.levels.ERROR) + return + end + dap.run(dap.configurations.odin[1]) + end) + else + dap.continue() + end +end + +local maps = { + { "n", "", run_or_continue, "Start/Continue" }, + { "n", "dc", run_or_continue, "Start/Continue" }, + { "n", "", function() dap.step_over() end, "Step Over" }, + { "n", "do", function() dap.step_over() end, "Step Over" }, + { "n", "", function() dap.step_into() end, "Step Into" }, + { "n", "di", function() dap.step_into() end, "Step Into" }, + { "n", "", function() dap.step_out() end, "Step Out" }, + { "n", "dO", function() dap.step_out() end, "Step Out" }, + { "n", "db", function() dap.toggle_breakpoint() end, "Toggle Breakpoint" }, + { "n", "dB", function() dap.set_breakpoint(vim.fn.input("Condition: ")) end, "Conditional Breakpoint" }, + { "n", "dt", function() dap.terminate() end, "Terminate" }, + { "n", "dq", function() dap.close() end, "Close Session" }, + { "n", "dr", function() dap.repl.toggle() end, "REPL" }, + { "n", "du", function() dapui.toggle() end, "Toggle DAP UI" }, + { "n", "d?", function() dap.list_breakpoints() end, "List Breakpoints" }, +} + +for _, map in ipairs(maps) do + vim.keymap.set(map[1], map[2], map[3], { desc = "DAP: " .. map[4] }) +end diff --git a/dot_config/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua index 37d9853..d915cb1 100644 --- a/dot_config/nvim/lua/plugins/init.lua +++ b/dot_config/nvim/lua/plugins/init.lua @@ -15,6 +15,7 @@ vim.api.nvim_create_autocmd("PackChanged", { }) require("plugins.theme") +require("plugins.mini-icons") require("plugins.treesitter") require("plugins.blink") require("plugins.whichkey") @@ -22,6 +23,7 @@ require("plugins.lualine") require("plugins.telescope") require("plugins.neotree") require("plugins.conform") +require("plugins.dap") require("plugins.git") require("plugins.markdown") require("plugins.log-highlight") diff --git a/dot_config/nvim/lua/plugins/mini-icons.lua b/dot_config/nvim/lua/plugins/mini-icons.lua new file mode 100644 index 0000000..709d945 --- /dev/null +++ b/dot_config/nvim/lua/plugins/mini-icons.lua @@ -0,0 +1,5 @@ +vim.pack.add({ + { src = "https://github.com/nvim-mini/mini.nvim", version = vim.version.range("^0.18") }, +}) + +require("mini.icons").setup() diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua index eeb3d6b..0c638e1 100644 --- a/dot_config/nvim/lua/plugins/treesitter.lua +++ b/dot_config/nvim/lua/plugins/treesitter.lua @@ -9,7 +9,7 @@ require("nvim-treesitter").install({ "fish", "gitcommit", "gitignore", "go", "gomod", "gosum", "gowork", "html", "ini", "javascript", "jsdoc", "json", "lua", "luadoc", "luap", "make", "markdown", "markdown_inline", "nginx", "nix", - "proto", "python", "query", "regex", "rust", "scss", "sql", + "odin", "proto", "python", "query", "regex", "rust", "scss", "sql", "terraform", "toml", "tsx", "typescript", "vim", "vimdoc", "xml", "yaml", "zig", }) diff --git a/dot_config/nvim/nvim-pack-lock.json b/dot_config/nvim/nvim-pack-lock.json index 9cc6cc4..be9a323 100644 --- a/dot_config/nvim/nvim-pack-lock.json +++ b/dot_config/nvim/nvim-pack-lock.json @@ -29,6 +29,11 @@ "rev": "221ce6b2d999187044529f49da6554a92f740a96", "src": "https://github.com/nvim-lualine/lualine.nvim" }, + "mini.nvim": { + "rev": "1345d191bb3da9c7b0e977f4387c5761f9bff68d", + "src": "https://github.com/nvim-mini/mini.nvim", + "version": "0.18.0 - 0.19.0" + }, "neo-tree.nvim": { "rev": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61", "src": "https://github.com/nvim-neo-tree/neo-tree.nvim", @@ -38,6 +43,18 @@ "rev": "de740991c12411b663994b2860f1a4fd0937c130", "src": "https://github.com/MunifTanjim/nui.nvim" }, + "nvim-dap": { + "rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570", + "src": "https://github.com/mfussenegger/nvim-dap" + }, + "nvim-dap-ui": { + "rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43", + "src": "https://github.com/rcarriga/nvim-dap-ui" + }, + "nvim-nio": { + "rev": "edcc181a875301dd21840189aa2f2f9ad69fc172", + "src": "https://github.com/nvim-neotest/nvim-nio" + }, "nvim-treesitter": { "rev": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025", "src": "https://github.com/nvim-treesitter/nvim-treesitter" diff --git a/dot_tmux.conf b/dot_tmux.conf index 87ad43f..22a507c 100644 --- a/dot_tmux.conf +++ b/dot_tmux.conf @@ -41,6 +41,8 @@ set -g status-interval 10 set -g allow-passthrough on set -g set-clipboard on +set -g focus-events on + set -ga update-environment TERM set -ga update-environment TERM_PROGRAM set -ga update-environment SSH_CONNECTION