feat: update nvom
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
return {
|
||||
return {
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
enabled = false, -- 临时禁用 avante
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return {
|
||||
return {
|
||||
{
|
||||
"marcinjahn/gemini-cli.nvim",
|
||||
cmd = "Gemini", -- 懒加载,使用 :Gemini 命令时加载
|
||||
@@ -6,7 +6,8 @@ return {
|
||||
"folke/snacks.nvim", -- 必需的依赖
|
||||
},
|
||||
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>af", "<cmd>Gemini add_file<cr>", desc = "Add File to Gemini" },
|
||||
{ "<leader>ar", "<cmd>Gemini --resume<cr>", desc = "Resume Gemini" },
|
||||
|
||||
+12
-11
@@ -2,17 +2,18 @@ return {
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"stylua",
|
||||
"selene",
|
||||
"luacheck",
|
||||
--"bashls",
|
||||
"shfmt",
|
||||
--"tailwindcss",
|
||||
--"tsserver",
|
||||
"pylyzer",
|
||||
--"cssls",
|
||||
})
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"stylua",
|
||||
"selene",
|
||||
"luacheck",
|
||||
--"bashls",
|
||||
"shfmt",
|
||||
--"tailwindcss",
|
||||
--"tsserver",
|
||||
"pylyzer",
|
||||
--"cssls",
|
||||
"bufls", -- Protocol Buffers LSP
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ return {
|
||||
inlay_hints = { enabled = false },
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
bufls = {}, -- Protocol Buffers LSP
|
||||
cssls = {},
|
||||
tailwindcss = {
|
||||
root_dir = function(...)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
-- Protocol Buffers 支持通过以下方式提供:
|
||||
-- 1. 语法高亮:通过 treesitter(需要在 treesitter.lua 中添加 "proto")
|
||||
-- 2. LSP 支持:通过 bufls(已在 nvim-lspconfig.lua 和 mason.lua 中配置)
|
||||
--
|
||||
-- 如果需要额外的语法高亮插件,可以使用:
|
||||
-- {
|
||||
-- "protocolbuffers/protobuf",
|
||||
-- ft = { "proto" },
|
||||
-- },
|
||||
}
|
||||
|
||||
@@ -115,9 +115,11 @@ return {
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.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,
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
@@ -127,20 +129,20 @@ return {
|
||||
i = {
|
||||
["<C-c>"] = actions.close,
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open_with_trouble,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<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
|
||||
},
|
||||
},
|
||||
})
|
||||
opts.pickers = {
|
||||
opts.pickers = vim.tbl_deep_extend("force", opts.pickers or {}, {
|
||||
diagnostics = {
|
||||
theme = "ivy",
|
||||
initial_mode = "normal",
|
||||
@@ -148,8 +150,8 @@ return {
|
||||
preview_cutoff = 9999,
|
||||
},
|
||||
},
|
||||
}
|
||||
opts.extensions = {
|
||||
})
|
||||
opts.extensions = vim.tbl_deep_extend("force", opts.extensions or {}, {
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
-- disables netrw and use telescope-file-browser in its place
|
||||
@@ -178,7 +180,7 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
telescope.setup(opts)
|
||||
require("telescope").load_extension("fzf")
|
||||
require("telescope").load_extension("file_browser")
|
||||
|
||||
@@ -4,28 +4,29 @@ return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"astro",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"fish",
|
||||
"gitignore",
|
||||
"go",
|
||||
"graphql",
|
||||
"html",
|
||||
"java",
|
||||
"json",
|
||||
"lua",
|
||||
"php",
|
||||
"rust",
|
||||
"scss",
|
||||
"sql",
|
||||
"svelte",
|
||||
"toml",
|
||||
"tsx",
|
||||
"yaml",
|
||||
},
|
||||
ensure_installed = {
|
||||
"astro",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"fish",
|
||||
"gitignore",
|
||||
"go",
|
||||
"graphql",
|
||||
"html",
|
||||
"java",
|
||||
"json",
|
||||
"lua",
|
||||
"php",
|
||||
"proto", -- Protocol Buffers
|
||||
"rust",
|
||||
"scss",
|
||||
"sql",
|
||||
"svelte",
|
||||
"toml",
|
||||
"tsx",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- matchup = {
|
||||
-- enable = true,
|
||||
|
||||
Reference in New Issue
Block a user