updated secrets baseline config

This commit was merged in pull request #1.
This commit is contained in:
2026-06-06 15:54:15 -06:00
parent 5511da5a98
commit 5656c2d385
13 changed files with 451 additions and 141 deletions

View File

@@ -128,6 +128,16 @@ map("n", "<leader>cgpt", function()
vim.cmd("!go test -run=^$ -bench=. -trace trace.out ./...")
end, { desc = "Go trace profile" })
-- ─────────────────────────────────────────────────────────────────────────────
-- Zig: build / run / test
-- ─────────────────────────────────────────────────────────────────────────────
-- Mirrors the Go <leader>cg* layout: <leader>cz* (Code > Zig).
-- These are quick one-shot runs; for the mouse-driven task picker use <leader>or (OverseerRun),
-- which lists the zig: build/run/test templates from lua/overseer/template/user
map("n", "<leader>czb", "<cmd>!zig build<cr>", { desc = "Zig build" })
map("n", "<leader>czr", "<cmd>!zig build run<cr>", { desc = "Zig build run" })
map("n", "<leader>czt", "<cmd>!zig build test<cr>", { desc = "Zig build test" })
-- ─────────────────────────────────────────────────────────────────────────────
-- Overseer
-- ─────────────────────────────────────────────────────────────────────────────

View File

@@ -0,0 +1,21 @@
return {
name = "zig: build",
desc = "Build the project (zig build)",
-- Only offered as a task when a build.zig is present in the project root.
condition = {
callback = function()
return vim.fn.filereadable(vim.fn.getcwd() .. "/build.zig") == 1
end,
},
builder = function()
return {
cmd = { "zig" },
args = { "build" },
components = {
"default",
"on_output_quickfix",
{ "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } },
},
}
end,
}

View File

@@ -0,0 +1,20 @@
return {
name = "zig: run",
desc = "Build and run (zig build run)",
condition = {
callback = function()
return vim.fn.filereadable(vim.fn.getcwd() .. "/build.zig") == 1
end,
},
builder = function()
return {
cmd = { "zig" },
args = { "build", "run" },
components = {
"default",
"on_output_quickfix",
{ "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } },
},
}
end,
}

View File

@@ -0,0 +1,20 @@
return {
name = "zig: test",
desc = "Run the test step (zig build test)",
condition = {
callback = function()
return vim.fn.filereadable(vim.fn.getcwd() .. "/build.zig") == 1
end,
},
builder = function()
return {
cmd = { "zig" },
args = { "build", "test" },
components = {
"default",
"on_output_quickfix",
{ "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } },
},
}
end,
}

View File

@@ -167,6 +167,68 @@ return {
},
},
-- -------------------------------------------------------------------------
-- Zig (+ C/C++) debugging via codelldb
-- -------------------------------------------------------------------------
{
"mfussenegger/nvim-dap",
ft = { "zig" },
config = function()
local dap = require("dap")
-- Prefer codelldb on $PATH, fall back to Mason's install location
local codelldb = vim.fn.exepath("codelldb")
if codelldb == "" then
codelldb = vim.fn.stdpath("data") .. "/mason/bin/codelldb"
end
dap.adapters.codelldb = {
type = "server",
port = "${port}",
executable = {
command = codelldb,
args = { "--port", "${port}" },
},
}
dap.configurations.zig = {
{
-- Project build (build.zig). Runs `zig build` first so a fresh
-- debug binary exists, then asks which exec under zig-out/bin to run.
name = "Launch (zig build)",
type = "codelldb",
request = "launch",
program = function()
vim.fn.system({ "zig", "build", "--summary", "none" })
return vim.fn.input("Executable: ", vim.fn.getcwd() .. "/zig-out/bin/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
},
{
-- Single file. Compiles the current .zig with debug info next to it,
-- then launches that binary.
name = "Launch (current file)",
type = "codelldb",
request = "launch",
program = function()
local src = vim.fn.expand("%:p")
local out = vim.fn.expand("%:p:r")
vim.fn.system({ "zig", "build-exe", src, "-O", "Debug", "-femit-bin=" .. out })
return out
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
},
}
-- Reuse the same configs for C/C++ buffers - codelldb handles them too
dap.configurations.c = dap.configurations.zig
dap.configurations.cpp = dap.configurations.zig
end,
},
-- ─────────────────────────────────────────────────────────────────────────
-- DAP UI keymaps + auto open/close (the spec itself is loaded as a dep above)
-- ─────────────────────────────────────────────────────────────────────────
@@ -239,7 +301,7 @@ return {
{
"jay-babu/mason-nvim-dap.nvim",
opts = {
ensure_installed = { "python", "delve", "js" },
ensure_installed = { "python", "delve", "js", "codelldb" },
},
},

View File

@@ -77,6 +77,7 @@ return {
{ "<leader>c", group = "Code" },
{ "<leader>cg", group = "Go" },
{ "<leader>cgp", group = "Profile" },
{ "<leader>cz", group = "Zig" },
{ "<leader>d", group = "Debug" },
{ "<leader>D", group = "Database" },
{ "<leader>f", group = "Find" },

View File

@@ -11,9 +11,9 @@ return {
"neovim/nvim-lspconfig",
opts = {
servers = {
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
-- Go
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
gopls = {
root_markers = { "go.work", "go.mod", ".git" },
settings = {
@@ -60,9 +60,29 @@ return {
},
},
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
-- Zig
-- -----------------------------------------------------------------
zig = {
root_markers = { "build.zig", "build.zig.zon" },
settings = {
zls = {
enable_build_on_save = true,
-- "watch" or specify a step name your build.zig defines
build_on_save_step = "install",
semantic_tokens = "full",
enable_inlay_hints = true,
inlay_hints_show_parameter_name = true,
inlay_hints_show_builtin = true,
inlay_hints_show_variable_type_hints = true,
warn_style = true,
},
},
},
-- -----------------------------------------------------------------
-- Lua
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
lua_ls = {
root_markers = {
".luarc.json",
@@ -83,9 +103,9 @@ return {
},
},
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
-- TypeScript / JavaScript
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
ts_ls = {
root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" },
settings = {
@@ -114,9 +134,9 @@ return {
},
},
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
-- Web (HTML / CSS / JSON / YAML)
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
html = {
root_markers = { "package.json", ".git" },
filetypes = { "html", "templ" },
@@ -143,9 +163,9 @@ return {
},
},
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
-- Markdown / SQL / Docker
-- ─────────────────────────────────────────────────────────────────
-- -----------------------------------------------------------------
marksman = {
root_markers = { ".marksman.toml", ".git" },
},

View File

@@ -37,6 +37,7 @@ return {
-- DAP adapters
"delve",
"js-debug-adapter",
"codelldb",
},
},
},

View File

@@ -7,15 +7,17 @@ return {
{
"nvim-neotest/neotest",
lazy = true,
ft = { "go", "ptyhon" },
ft = { "go", "ptyhon", "zig" },
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter", -- noetest-zig parses tests via treesitter
-- Adapters
"nvim-neotest/neotest-go",
"nvim-neotest/neotest-python",
"lawrence-laz/neotest-zig",
},
config = function()
require("neotest").setup({
@@ -39,6 +41,14 @@ return {
dap = { justMyCode = false },
args = { "--disable-warnings", "-q" },
}),
-- Zig: requires a standard `test` step in build.zig for project-wide runs;
-- individual .zig files also work.
-- dap.adapter must match the adapter named registered in dap.lua (codelldb) so <leader>dT-style
-- debug-test works from the summary too
require("neotest-zig")({
dap = { adapter = "codelldb" },
}),
},
})
end,

View File

@@ -36,6 +36,9 @@ return {
"markdown",
"markdown_inline",
-- Zig
"zig",
-- Build / config
"ninja",
"sql",

View File

@@ -1,5 +1,14 @@
-- Zig language support via the official Codeberg-hosted plugin.
-- Loads only on zig files.
--
-- The rest of the Zig toolchain is wired in alongside the other languages so
-- it benefits from the same lazy-loading and config:
-- * LSP (zls) ........... lspconfig.lua (servers.zls) + mason.lua
-- * Treesitter parser ... treesitter.lua ("zig")
-- * Tests in-buffer ..... neotest.lua (neotest-zig adapter, ft=zig)
-- * Debug (codelldb) .... dap.lua (dap.configurations.zig) + mason
-- * Run/build tasks ..... overseer/template/user/zig_{build,run,test}.lua
-- * Quick keymaps ....... keymaps.lua (<leader>cz*) + which-key group
return {
{