Update nvim

This commit is contained in:
2026-08-02 14:18:41 -04:00
parent 22a1fcb0b5
commit 03088ca0b3
9 changed files with 114 additions and 1 deletions
+1
View File
@@ -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
+1
View File
@@ -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 },
+80
View File
@@ -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", "<F5>", run_or_continue, "Start/Continue" },
{ "n", "<leader>dc", run_or_continue, "Start/Continue" },
{ "n", "<F10>", function() dap.step_over() end, "Step Over" },
{ "n", "<leader>do", function() dap.step_over() end, "Step Over" },
{ "n", "<F11>", function() dap.step_into() end, "Step Into" },
{ "n", "<leader>di", function() dap.step_into() end, "Step Into" },
{ "n", "<F12>", function() dap.step_out() end, "Step Out" },
{ "n", "<leader>dO", function() dap.step_out() end, "Step Out" },
{ "n", "<leader>db", function() dap.toggle_breakpoint() end, "Toggle Breakpoint" },
{ "n", "<leader>dB", function() dap.set_breakpoint(vim.fn.input("Condition: ")) end, "Conditional Breakpoint" },
{ "n", "<leader>dt", function() dap.terminate() end, "Terminate" },
{ "n", "<leader>dq", function() dap.close() end, "Close Session" },
{ "n", "<leader>dr", function() dap.repl.toggle() end, "REPL" },
{ "n", "<leader>du", function() dapui.toggle() end, "Toggle DAP UI" },
{ "n", "<leader>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
+2
View File
@@ -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")
@@ -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()
+1 -1
View File
@@ -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",
})