added more capabilities to my nvim setup

This commit is contained in:
2026-01-19 18:45:00 -07:00
parent aa84c4997e
commit a9b956e141
18 changed files with 312 additions and 44 deletions

View File

@@ -106,3 +106,11 @@ autocmd("FileType", {
vim.opt_local.spell = true
end,
})
autocmd("DirChanged", {
callback = function()
if vim.fn.filereadable(".devcontainer/devcontainer.json") == 1 then
vim.notify("Devcontainer detected", vim.log.levels.INFO)
end
end,
})

View File

@@ -68,3 +68,37 @@ map("n", "<leader>at", "<cmd>AvanteToggle<cr>", { desc = "AI Toggle" })
-- Database keymaps
map("n", "<leader>db", "<cmd>DBUIToggle<cr>", { desc = "Toggle DB UI" })
map("n", "<leader>da", "<cmd>DBUIAddConnection<cr>", { desc = "Add DB Connection" })
-- Neotest
local neotest = require("neotest")
map("n", "<leader>tt", neotest.run.run, { desc = "Run nearest test" })
map("n", "<leader>tf", function()
neotest.run.run(vim.fn.expand("%"))
end, { desc = "Run test file" })
map("n", "<leader>ts", neotest.summary.toggle)
map("n", "<leader>to", neotest.output.open)
map("n", "<leader>tc", "<cmd>Coverage<cr>", { desc = "Show coverage" })
-- Go benchmark
map("n", "<leader>gb", function()
vim.cmd("!go test -bench . ./...")
end, { desc = "Go benchmarks" })
map("n", "<leader>gp", function()
vim.cmd("!go test -cpuprofile cpu.out && go tool pprof cpu.out")
end, { desc = "Go CPU profile" })
-- Overseer
map("n", "<leader>or", "<cmd>OverseerRun<cr>", { desc = "Run task" })
map("n", "<leader>ot", "<cmd>OverseerToogle<cr>", { desc = "Task list" })
-- Aerial
map("n", "<leader>so", "<cmd>AerialToggle<cr>", { desc = "Symbols outline" })
map("n", "<leader>sh", vim.lsp.buf.incoming_calls, { desc = "Incoming calls" })
map("n", "<leader>sc", vim.lsp.buf.outgoing_calls, { desc = "Outgoing calls" })
-- Diagnostics
map("n", "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>")
map("n", "<leader>xw", "<cmd>Trouble workspace_diagnostics<cr>")
map("n", "<leader>xt", "<cmd>Trouble todo<cr>")

View File

@@ -3,6 +3,11 @@
local opt = vim.opt
if vim.env.SSH_CONNECTION then
opt.clipboard = ""
opt.timeoutlen = 1000
end
-- General
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.confirm = true -- Confirm before closing unsaved buffer
@@ -12,7 +17,7 @@ opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers
opt.signcolumn = "yes" -- Always show sign column
opt.termguicolors = true -- True color support
opt.wrap = false -- Disable line wrap
opt.wrap = true -- Disable line wrap
-- Indentation
opt.expandtab = true -- Use spaces instead of tabs
@@ -45,3 +50,16 @@ opt.completeopt = "menu,menuone,noselect"
opt.foldmethod = "expr"
opt.foldexpr = "nvim_treesitter#foldexpr()"
opt.foldlevel = 99 -- Start with all folds open
opt.exrc = true
opt.secure = true
vim.diagnostic.config({
virtual_text = {
prefix = "",
},
severity_sort = true,
float = {
border = "rounded",
},
})

View File

@@ -0,0 +1,8 @@
return {
name = "go test",
builder = function()
return {
cmd = { "go", "test", "./..." },
}
end,
}

View File

@@ -44,7 +44,7 @@ return {
opts = {
-- Default provider (switch with :AvanteProvider command)
-- Options: "claude", "openai", "azure", "gemini", "copilot", "cohere"
provider = "claude",
provider = "openai",
-- Provider configurations
providers = {
@@ -59,7 +59,7 @@ return {
},
openai = {
endpoint = "https://api.openai.com/v1",
model = "gpt-4o",
model = "gpt-4o-mini",
timeout = 30000,
extra_request_body = {
temperature = 0.75,
@@ -193,4 +193,21 @@ return {
},
},
},
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
opts = {
suggestion = {
enabled = true,
auto_trigger = true,
keymap = {
accept = "<C-l>",
next = "<C-n>",
prev = "<C-p>",
},
},
panel = { enabled = false },
},
}
}

View File

@@ -135,7 +135,16 @@ return {
end
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
opts = {
ensure_installed = {
"go",
"python",
"node2",
},
},
},
-- Virtual text for debugging
{
"theHamsta/nvim-dap-virtual-text",

View File

@@ -0,0 +1,8 @@
return {
{
"folke/trouble.nvim",
opts = {
use_diagnostic_signs = true,
},
},
}

View File

@@ -0,0 +1,10 @@
return {
{
"jamestthompson3/nvim-remote-containers",
cmd = {
"AttachToContainer",
"BuildImage",
"StartImage",
},
},
}

View File

@@ -2,6 +2,27 @@
-- Custom keybindings for file explorer (snacks.nvim built into LazyVim)
return {
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
hidden = true,
file_ignore_patterns = {},
},
pickers = {
find_files = {
hidden = true,
no_ignore = true,
no_ignore_parent = true,
},
live_grep = {
additional_args = function()
return { "--hidden", "--no-ignore" }
end,
},
},
},
},
-- Configure snacks.nvim explorer (already included in LazyVim)
{
"folke/snacks.nvim",

View File

@@ -0,0 +1,7 @@
return {
{
"andythigpen/nvim-coverage",
dependencies = "nvim-lua/plenary.nvim",
config = true,
},
}

View File

@@ -0,0 +1,10 @@
return {
{
"davecheney/profile",
ft = "go",
},
{
"rbong/vim-flog",
cmd = { "Flog" },
},
}

40
lua/plugins/lsp-roots.lua Normal file
View File

@@ -0,0 +1,40 @@
return {
{
"neovim/nvim-lspconfig",
opts = {
servers = {
tsserver = {
root_dir = function(fname)
return require("lspconfig.util").root_pattern(
"pnpm-workspace.yaml",
"nx.json",
"turbo.json",
"package.json",
".git"
)(fname)
end,
},
gopls = {
root_dir = function(fname)
return require("lspconfig.util").root_pattern(
"go.work",
"go.mod",
".git"
)(fname)
end,
},
pyright = {
root_dir = function(fname)
return require("lspconfig.util").root_pattern(
"pyproject.toml",
"setup.py",
".git"
)(fname)
end,
},
},
},
},
}

View File

@@ -0,0 +1,6 @@
return {
{
"nvim-neotest/neotest-python",
dependencies = { "nvim-neotest/neotest" },
},
}

19
lua/plugins/neotest.lua Normal file
View File

@@ -0,0 +1,19 @@
return {
{
"nvim-neotest/neotest",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-go",
},
opts = {
adapters = {
require("neotest-go"),
require("neotest-python")({
dap = { justMyCode = false },
}),
},
},
},
}

8
lua/plugins/overseer.lua Normal file
View File

@@ -0,0 +1,8 @@
return {
{
"stevearc/overseer.nvim",
opts = {
templates = { "builtin", "user.go", "user.npm" }
},
},
}

View File

@@ -0,0 +1,15 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
highlight = {
enable = true,
disable = function(_, buf)
local max_filesize = 200 * 1024 -- 200 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
return ok and stats and stats.size > max_filesize
end,
},
},
}
}

10
lua/plugins/symbols.lua Normal file
View File

@@ -0,0 +1,10 @@
return {
{
"stevearc/aerial.nvim",
opts = {
layout = {
max_width = 40,
},
},
},
}

20
lua/plugins/theme.lua Normal file
View File

@@ -0,0 +1,20 @@
return {
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
opts = {
integrations = {
treesitter = true,
cmp = true,
gitsigns = true,
neotest = true,
dap = true,
},
},
config = function(_, opts)
require("catppuccin").setup(opts)
vim.cmd.colorscheme("catppuccin-mocha")
end,
},
}