feat: update nvom

This commit is contained in:
2026-01-17 14:43:27 +08:00
parent 108a8420f9
commit 72fb4fc412
9 changed files with 126 additions and 47 deletions
+2
View File
@@ -6,8 +6,10 @@
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
"blink-cmp-avante": { "branch": "master", "commit": "4f494c6e124acbe31a8f5d58effa0c14aa38a6d5" }, "blink-cmp-avante": { "branch": "master", "commit": "4f494c6e124acbe31a8f5d58effa0c14aa38a6d5" },
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"buf": { "branch": "main", "commit": "49785647e5e0e316f3fa2c2dab7bca225579018b" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, "catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
"codecompanion.nvim": { "branch": "main", "commit": "e0780fa9fda504ffb89307cabcb6cbe1ce8eb60c" },
"conform.nvim": { "branch": "master", "commit": "5ac2bb57a9096f00ca50e1a3c46020d5930319b8" }, "conform.nvim": { "branch": "master", "commit": "5ac2bb57a9096f00ca50e1a3c46020d5930319b8" },
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
+1 -1
View File
@@ -1,4 +1,4 @@
return { return {
{ {
"yetone/avante.nvim", "yetone/avante.nvim",
enabled = false, -- 临时禁用 avante enabled = false, -- 临时禁用 avante
+59
View File
@@ -0,0 +1,59 @@
return {
{
"olimorris/codecompanion.nvim",
enabled = false, -- 临时禁用 CodeCompanion
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>a", nil, desc = "CodeCompanion" },
{ "<leader>ac", "<cmd>CodeCompanionChat<cr>", desc = "CodeCompanion Chat" },
{ "<leader>ai", "<cmd>CodeCompanionInline<cr>", desc = "CodeCompanion Inline" },
{ "<leader>am", "<cmd>CodeCompanionCmd<cr>", desc = "CodeCompanion Cmd" },
{ "<leader>at", "<cmd>CodeCompanionToggle<cr>", desc = "CodeCompanion Toggle" },
},
opts = {
-- 配置策略,使用 gemini_cli adapter
strategies = {
chat = {
adapter = "gemini_cli", -- chat 模式使用 gemini_cli
},
inline = {
adapter = "gemini_cli", -- inline 模式使用 gemini_cli
},
cmd = {
adapter = "gemini_cli", -- cmd 模式使用 gemini_cli
},
},
-- 配置 adapters
adapters = {
acp = {
gemini_cli = function()
return require("codecompanion.adapters").extend("gemini_cli", {
-- 使用 OAuth 登录方式,不使用 API key
defaults = {
auth_method = "oauth", -- 使用 OAuth 网页登录
timeout = 20000,
},
-- 不设置 GEMINI_API_KEY,强制使用 OAuth 登录
env = {
-- 不设置 GEMINI_API_KEY,让 Gemini CLI 使用已缓存的 OAuth 凭证
-- 代理配置(如果需要通过代理访问)
HTTP_PROXY = os.getenv("HTTP_PROXY") or os.getenv("http_proxy"),
HTTPS_PROXY = os.getenv("HTTPS_PROXY") or os.getenv("https_proxy"),
ALL_PROXY = os.getenv("ALL_PROXY") or os.getenv("all_proxy"),
NO_PROXY = os.getenv("NO_PROXY") or os.getenv("no_proxy"),
},
-- Gemini CLI 命令配置
commands = {
default = { "gemini", "cli", "--experimental-acp" },
},
})
end,
},
},
},
},
}
+3 -2
View File
@@ -1,4 +1,4 @@
return { return {
{ {
"marcinjahn/gemini-cli.nvim", "marcinjahn/gemini-cli.nvim",
cmd = "Gemini", -- 懒加载,使用 :Gemini 命令时加载 cmd = "Gemini", -- 懒加载,使用 :Gemini 命令时加载
@@ -6,7 +6,8 @@ return {
"folke/snacks.nvim", -- 必需的依赖 "folke/snacks.nvim", -- 必需的依赖
}, },
keys = { keys = {
{ "<leader>aa", "<cmd>Gemini ask<cr>", desc = "Ask Gemini" }, { "<leader>a", nil, desc = "Gemini CLI" },
{ "<leader>aq", "<cmd>Gemini ask<cr>", desc = "Ask Gemini" },
{ "<leader>ac", "<cmd>Gemini toggle<cr>", desc = "Toggle Gemini CLI" }, { "<leader>ac", "<cmd>Gemini toggle<cr>", desc = "Toggle Gemini CLI" },
{ "<leader>af", "<cmd>Gemini add_file<cr>", desc = "Add File to Gemini" }, { "<leader>af", "<cmd>Gemini add_file<cr>", desc = "Add File to Gemini" },
{ "<leader>ar", "<cmd>Gemini --resume<cr>", desc = "Resume Gemini" }, { "<leader>ar", "<cmd>Gemini --resume<cr>", desc = "Resume Gemini" },
+1
View File
@@ -12,6 +12,7 @@ return {
--"tsserver", --"tsserver",
"pylyzer", "pylyzer",
--"cssls", --"cssls",
"bufls", -- Protocol Buffers LSP
}) })
end, end,
}, },
+1
View File
@@ -9,6 +9,7 @@ return {
inlay_hints = { enabled = false }, inlay_hints = { enabled = false },
---@type lspconfig.options ---@type lspconfig.options
servers = { servers = {
bufls = {}, -- Protocol Buffers LSP
cssls = {}, cssls = {},
tailwindcss = { tailwindcss = {
root_dir = function(...) root_dir = function(...)
+12
View File
@@ -0,0 +1,12 @@
return {
-- Protocol Buffers 支持通过以下方式提供:
-- 1. 语法高亮:通过 treesitter(需要在 treesitter.lua 中添加 "proto")
-- 2. LSP 支持:通过 bufls(已在 nvim-lspconfig.lua 和 mason.lua 中配置)
--
-- 如果需要额外的语法高亮插件,可以使用:
-- {
-- "protocolbuffers/protobuf",
-- ft = { "proto" },
-- },
}
+10 -8
View File
@@ -115,9 +115,11 @@ return {
local telescope = require("telescope") local telescope = require("telescope")
local actions = require("telescope.actions") local actions = require("telescope.actions")
local fb_actions = require("telescope").extensions.file_browser.actions local fb_actions = require("telescope").extensions.file_browser.actions
local trouble = require("trouble.providers.telescope") local trouble = require("trouble.sources.telescope")
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, { -- 确保 opts 和其子表存在
opts = opts or {}
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
wrap_results = true, wrap_results = true,
layout_strategy = "horizontal", layout_strategy = "horizontal",
layout_config = { prompt_position = "top" }, layout_config = { prompt_position = "top" },
@@ -129,18 +131,18 @@ return {
["<ESC>"] = actions.close, ["<ESC>"] = actions.close,
["<C-j>"] = actions.move_selection_next, ["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
["<c-t>"] = trouble.open_with_trouble, ["<c-t>"] = trouble.open,
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
}, },
n = { n = {
["<C-j>"] = actions.move_selection_next, ["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
["<c-t>"] = trouble.open_with_trouble, ["<c-t>"] = trouble.open,
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
}, },
}, },
}) })
opts.pickers = { opts.pickers = vim.tbl_deep_extend("force", opts.pickers or {}, {
diagnostics = { diagnostics = {
theme = "ivy", theme = "ivy",
initial_mode = "normal", initial_mode = "normal",
@@ -148,8 +150,8 @@ return {
preview_cutoff = 9999, preview_cutoff = 9999,
}, },
}, },
} })
opts.extensions = { opts.extensions = vim.tbl_deep_extend("force", opts.extensions or {}, {
file_browser = { file_browser = {
theme = "dropdown", theme = "dropdown",
-- disables netrw and use telescope-file-browser in its place -- disables netrw and use telescope-file-browser in its place
@@ -178,7 +180,7 @@ return {
}, },
}, },
}, },
} })
telescope.setup(opts) telescope.setup(opts)
require("telescope").load_extension("fzf") require("telescope").load_extension("fzf")
require("telescope").load_extension("file_browser") require("telescope").load_extension("file_browser")
+1
View File
@@ -18,6 +18,7 @@ return {
"json", "json",
"lua", "lua",
"php", "php",
"proto", -- Protocol Buffers
"rust", "rust",
"scss", "scss",
"sql", "sql",