added more capabilities to my nvim setup
This commit is contained in:
@@ -106,3 +106,11 @@ autocmd("FileType", {
|
|||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
autocmd("DirChanged", {
|
||||||
|
callback = function()
|
||||||
|
if vim.fn.filereadable(".devcontainer/devcontainer.json") == 1 then
|
||||||
|
vim.notify("Devcontainer detected", vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -68,3 +68,37 @@ map("n", "<leader>at", "<cmd>AvanteToggle<cr>", { desc = "AI Toggle" })
|
|||||||
-- Database keymaps
|
-- Database keymaps
|
||||||
map("n", "<leader>db", "<cmd>DBUIToggle<cr>", { desc = "Toggle DB UI" })
|
map("n", "<leader>db", "<cmd>DBUIToggle<cr>", { desc = "Toggle DB UI" })
|
||||||
map("n", "<leader>da", "<cmd>DBUIAddConnection<cr>", { desc = "Add DB Connection" })
|
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>")
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
|
if vim.env.SSH_CONNECTION then
|
||||||
|
opt.clipboard = ""
|
||||||
|
opt.timeoutlen = 1000
|
||||||
|
end
|
||||||
|
|
||||||
-- General
|
-- General
|
||||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||||
opt.confirm = true -- Confirm before closing unsaved buffer
|
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.relativenumber = true -- Relative line numbers
|
||||||
opt.signcolumn = "yes" -- Always show sign column
|
opt.signcolumn = "yes" -- Always show sign column
|
||||||
opt.termguicolors = true -- True color support
|
opt.termguicolors = true -- True color support
|
||||||
opt.wrap = false -- Disable line wrap
|
opt.wrap = true -- Disable line wrap
|
||||||
|
|
||||||
-- Indentation
|
-- Indentation
|
||||||
opt.expandtab = true -- Use spaces instead of tabs
|
opt.expandtab = true -- Use spaces instead of tabs
|
||||||
@@ -45,3 +50,16 @@ opt.completeopt = "menu,menuone,noselect"
|
|||||||
opt.foldmethod = "expr"
|
opt.foldmethod = "expr"
|
||||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
opt.foldlevel = 99 -- Start with all folds open
|
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",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
8
lua/overseer/template/user/go.lua
Normal file
8
lua/overseer/template/user/go.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
name = "go test",
|
||||||
|
builder = function()
|
||||||
|
return {
|
||||||
|
cmd = { "go", "test", "./..." },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
-- Default provider (switch with :AvanteProvider command)
|
-- Default provider (switch with :AvanteProvider command)
|
||||||
-- Options: "claude", "openai", "azure", "gemini", "copilot", "cohere"
|
-- Options: "claude", "openai", "azure", "gemini", "copilot", "cohere"
|
||||||
provider = "claude",
|
provider = "openai",
|
||||||
|
|
||||||
-- Provider configurations
|
-- Provider configurations
|
||||||
providers = {
|
providers = {
|
||||||
@@ -59,7 +59,7 @@ return {
|
|||||||
},
|
},
|
||||||
openai = {
|
openai = {
|
||||||
endpoint = "https://api.openai.com/v1",
|
endpoint = "https://api.openai.com/v1",
|
||||||
model = "gpt-4o",
|
model = "gpt-4o-mini",
|
||||||
timeout = 30000,
|
timeout = 30000,
|
||||||
extra_request_body = {
|
extra_request_body = {
|
||||||
temperature = 0.75,
|
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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,16 @@ return {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"go",
|
||||||
|
"python",
|
||||||
|
"node2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
-- Virtual text for debugging
|
-- Virtual text for debugging
|
||||||
{
|
{
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
|||||||
8
lua/plugins/dashboard.lua
Normal file
8
lua/plugins/dashboard.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
opts = {
|
||||||
|
use_diagnostic_signs = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
10
lua/plugins/devcontainer.lua
Normal file
10
lua/plugins/devcontainer.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"jamestthompson3/nvim-remote-containers",
|
||||||
|
cmd = {
|
||||||
|
"AttachToContainer",
|
||||||
|
"BuildImage",
|
||||||
|
"StartImage",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -2,6 +2,27 @@
|
|||||||
-- Custom keybindings for file explorer (snacks.nvim built into LazyVim)
|
-- Custom keybindings for file explorer (snacks.nvim built into LazyVim)
|
||||||
|
|
||||||
return {
|
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)
|
-- Configure snacks.nvim explorer (already included in LazyVim)
|
||||||
{
|
{
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
|
|||||||
7
lua/plugins/go-coverage.lua
Normal file
7
lua/plugins/go-coverage.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"andythigpen/nvim-coverage",
|
||||||
|
dependencies = "nvim-lua/plenary.nvim",
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
10
lua/plugins/go-profiling.lua
Normal file
10
lua/plugins/go-profiling.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"davecheney/profile",
|
||||||
|
ft = "go",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rbong/vim-flog",
|
||||||
|
cmd = { "Flog" },
|
||||||
|
},
|
||||||
|
}
|
||||||
40
lua/plugins/lsp-roots.lua
Normal file
40
lua/plugins/lsp-roots.lua
Normal 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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
6
lua/plugins/neotest-python.lua
Normal file
6
lua/plugins/neotest-python.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest-python",
|
||||||
|
dependencies = { "nvim-neotest/neotest" },
|
||||||
|
},
|
||||||
|
}
|
||||||
19
lua/plugins/neotest.lua
Normal file
19
lua/plugins/neotest.lua
Normal 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
8
lua/plugins/overseer.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/overseer.nvim",
|
||||||
|
opts = {
|
||||||
|
templates = { "builtin", "user.go", "user.npm" }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
15
lua/plugins/performance.lua
Normal file
15
lua/plugins/performance.lua
Normal 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
10
lua/plugins/symbols.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/aerial.nvim",
|
||||||
|
opts = {
|
||||||
|
layout = {
|
||||||
|
max_width = 40,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
20
lua/plugins/theme.lua
Normal file
20
lua/plugins/theme.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user