update nvim

This commit is contained in:
2025-09-12 00:41:38 -07:00
parent f632c549d9
commit 7f2e13e034
11 changed files with 365 additions and 107 deletions

View File

@@ -164,6 +164,17 @@ return {
},
},
},
opts = {
---Decorate the user message before it's sent to the LLM
---@param message string
---@param adapter CodeCompanion.Adapter
---@param context table
---@return string
prompt_decorator = function(message, adapter, context)
return string.format([[<prompt>%s</prompt>]], message)
end,
completion_provider = "cmp",
},
},
inline = {
adapter = "copilot",

View File

@@ -1,36 +0,0 @@
return {
"nvimdev/dashboard-nvim",
event = "VimEnter",
opts = {
theme = "hyper",
config = {
week_header = {
enable = true,
},
shortcut = {
{ desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" },
{
icon = "",
icon_hl = "@variable",
desc = "Files",
group = "Label",
action = "Telescope find_files",
key = "f",
},
{
desc = " Apps",
group = "DiagnosticHint",
action = "Telescope app",
key = "a",
},
{
desc = " dotfiles",
group = "Number",
action = "Telescope ~/.config",
key = "d",
},
},
},
},
depends = { "nvim-tree/nvim-web-devicons" },
}

View File

@@ -1,35 +0,0 @@
return {
"lukas-reineke/indent-blankline.nvim",
config = function()
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require("ibl.hooks")
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#ED8796" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#EED49F" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#8AADF4" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#F5A97F" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#A6DA95" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C6A0F6" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#8BD5CA" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup({
scope = { highlight = highlight },
exclude = { filetypes = { "dashboard" } },
})
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
end,
}

View File

@@ -0,0 +1,86 @@
return {
"ravitemer/mcphub.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
build = "npm install -g mcp-hub@latest", -- Installs `mcp-hub` node binary globally
config = function()
require("mcphub").setup({
--- `mcp-hub` binary related options-------------------
config = vim.fn.expand("~/.config/mcphub/servers.json"), -- Absolute path to MCP Servers config file (will create if not exists)
port = 37373, -- The port `mcp-hub` server listens to
shutdown_delay = 5 * 60 * 000, -- Delay in ms before shutting down the server when last instance closes (default: 5 minutes)
use_bundled_binary = false, -- Use local `mcp-hub` binary (set this to true when using build = "bundled_build.lua")
mcp_request_timeout = 60000, --Max time allowed for a MCP tool or resource to execute in milliseconds, set longer for long running tasks
global_env = {}, -- Global environment variables available to all MCP servers (can be a table or a function returning a table)
workspace = {
enabled = true, -- Enable project-local configuration files
look_for = { ".mcphub/servers.json", ".vscode/mcp.json", ".cursor/mcp.json" }, -- Files to look for when detecting project boundaries (VS Code format supported)
reload_on_dir_changed = true, -- Automatically switch hubs on DirChanged event
port_range = { min = 40000, max = 41000 }, -- Port range for generating unique workspace ports
get_port = nil, -- Optional function returning custom port number. Called when generating ports to allow custom port assignment logic
},
---Chat-plugin related options-----------------
auto_approve = false, -- Auto approve mcp tool calls
auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically
extensions = {
avante = {
make_slash_commands = true, -- make /slash commands from MCP server prompts
},
},
--- Plugin specific options-------------------
native_servers = {}, -- add your custom lua native servers here
builtin_tools = {
edit_file = {
parser = {
track_issues = true,
extract_inline_content = true,
},
locator = {
fuzzy_threshold = 0.8,
enable_fuzzy_matching = true,
},
ui = {
go_to_origin_on_complete = true,
keybindings = {
accept = ".",
reject = ",",
next = "n",
prev = "p",
accept_all = "ga",
reject_all = "gr",
},
},
},
},
ui = {
window = {
width = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number)
height = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number)
align = "center", -- "center", "top-left", "top-right", "bottom-left", "bottom-right", "top", "bottom", "left", "right"
relative = "editor",
zindex = 50,
border = "rounded", -- "none", "single", "double", "rounded", "solid", "shadow"
},
wo = { -- window-scoped options (vim.wo)
winhl = "Normal:MCPHubNormal,FloatBorder:MCPHubBorder",
},
},
json_decode = nil, -- Custom JSON parser function (e.g., require('json5').parse for JSON5 support)
on_ready = function(hub)
-- Called when hub is ready
end,
on_error = function(err)
-- Called on errors
end,
log = {
level = vim.log.levels.WARN,
to_file = false,
file_path = nil,
prefix = "MCPHub",
},
})
end,
}

View File

@@ -0,0 +1,167 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = {
priority = 1,
enabled = true, -- enable indent guides
char = "",
only_scope = false, -- only show indent guides of the scope
only_current = false, -- only show indent guides in the current window
-- hl = "SnacksIndent", ---@type string|string[] hl groups for indent guides
-- can be a list of hl groups to cycle through
hl = {
"SnacksIndent1",
"SnacksIndent2",
"SnacksIndent3",
"SnacksIndent4",
"SnacksIndent5",
"SnacksIndent6",
"SnacksIndent7",
"SnacksIndent8",
},
animate = {
-- enabled = vim.fn.has("nvim-0.10") == 1,
enabled = false,
style = "out",
easing = "linear",
duration = {
step = 20, -- ms per step
total = 500, -- maximum duration
},
},
filter = function(buf)
return vim.g.snacks_indent ~= false and vim.b[buf].snacks_indent ~= false and vim.bo[buf].buftype == ""
end,
},
input = {
enabled = true,
icon = "",
icon_hl = "SnacksInputIcon",
icon_pos = "left",
prompt_pos = "title",
win = { style = "input" },
expand = true,
backdrop = true,
position = "float",
border = "rounded",
title_pos = "center",
height = 1,
width = 60,
relative = "editor",
noautocmd = true,
row = 2,
-- relative = "cursor",
-- row = -3,
-- col = 0,
wo = {
winhighlight = "NormalFloat:SnacksInputNormal,FloatBorder:SnacksInputBorder,FloatTitle:SnacksInputTitle",
cursorline = false,
},
bo = {
filetype = "snacks_input",
buftype = "prompt",
},
--- buffer local variables
b = {
completion = false, -- disable blink completions in input
},
keys = {
n_esc = { "<esc>", { "cmp_close", "cancel" }, mode = "n", expr = true },
i_esc = { "<esc>", { "cmp_close", "stopinsert" }, mode = "i", expr = true },
i_cr = { "<cr>", { "cmp_accept", "confirm" }, mode = { "i", "n" }, expr = true },
i_tab = { "<tab>", { "cmp_select_next", "cmp" }, mode = "i", expr = true },
i_ctrl_w = { "<c-w>", "<c-s-w>", mode = "i", expr = true },
i_up = { "<up>", { "hist_up" }, mode = { "i", "n" } },
i_down = { "<down>", { "hist_down" }, mode = { "i", "n" } },
q = "cancel",
},
},
lazygit = { enabled = true },
picker = { enabled = true },
notifier = {
enabled = true,
timeout = 3000, -- default timeout in ms
width = { min = 40, max = 0.4 },
height = { min = 1, max = 0.6 },
-- editor margin to keep free. tabline and statusline are taken into account automatically
margin = { top = 0, right = 1, bottom = 0 },
padding = true, -- add 1 cell of left/right padding to the notification window
sort = { "level", "added" }, -- sort by level and time
-- minimum log level to display. TRACE is the lowest
-- all notifications are stored in history
level = vim.log.levels.TRACE,
icons = {
error = "",
warn = "",
info = "",
debug = "",
trace = "",
},
keep = function(notif)
return vim.fn.getcmdpos() > 0
end,
---@type snacks.notifier.style
style = "compact",
top_down = true, -- place notifications from top to bottom
date_format = "%R", -- time format for notifications
-- format for footer when more lines are available
-- `%d` is replaced with the number of lines.
-- only works for styles with a border
---@type string|boolean
more_format = " ↓ %d lines ",
refresh = 50, -- refresh at most every 50ms
},
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = false },
words = { enabled = false },
terminal = {
enabled = true,
bo = {
filetype = "snacks_terminal",
},
wo = {},
keys = {
q = "hide",
gf = function(self)
local f = vim.fn.findfile(vim.fn.expand("<cfile>"), "**")
if f == "" then
Snacks.notify.warn("No file under cursor")
else
self:hide()
vim.schedule(function()
vim.cmd("e " .. f)
end)
end
end,
term_normal = {
"<esc>",
function(self)
self.esc_timer = self.esc_timer or (vim.uv or vim.loop).new_timer()
if self.esc_timer:is_active() then
self.esc_timer:stop()
vim.cmd("stopinsert")
else
self.esc_timer:start(200, 0, function() end)
return "<esc>"
end
end,
mode = "t",
expr = true,
desc = "Double escape to normal mode",
},
},
},
win = { enabled = true },
},
}