feat: update nvom
This commit is contained in:
@@ -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,4 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"yetone/avante.nvim",
|
"yetone/avante.nvim",
|
||||||
enabled = false, -- 临时禁用 avante
|
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",
|
"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" },
|
||||||
|
|||||||
+12
-11
@@ -2,17 +2,18 @@ return {
|
|||||||
{
|
{
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
vim.list_extend(opts.ensure_installed, {
|
vim.list_extend(opts.ensure_installed, {
|
||||||
"stylua",
|
"stylua",
|
||||||
"selene",
|
"selene",
|
||||||
"luacheck",
|
"luacheck",
|
||||||
--"bashls",
|
--"bashls",
|
||||||
"shfmt",
|
"shfmt",
|
||||||
--"tailwindcss",
|
--"tailwindcss",
|
||||||
--"tsserver",
|
--"tsserver",
|
||||||
"pylyzer",
|
"pylyzer",
|
||||||
--"cssls",
|
--"cssls",
|
||||||
})
|
"bufls", -- Protocol Buffers LSP
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(...)
|
||||||
|
|||||||
@@ -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 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" },
|
||||||
@@ -127,20 +129,20 @@ return {
|
|||||||
i = {
|
i = {
|
||||||
["<C-c>"] = actions.close,
|
["<C-c>"] = actions.close,
|
||||||
["<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")
|
||||||
|
|||||||
@@ -4,28 +4,29 @@ return {
|
|||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"astro",
|
"astro",
|
||||||
"cmake",
|
"cmake",
|
||||||
"cpp",
|
"cpp",
|
||||||
"css",
|
"css",
|
||||||
"fish",
|
"fish",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
"go",
|
"go",
|
||||||
"graphql",
|
"graphql",
|
||||||
"html",
|
"html",
|
||||||
"java",
|
"java",
|
||||||
"json",
|
"json",
|
||||||
"lua",
|
"lua",
|
||||||
"php",
|
"php",
|
||||||
"rust",
|
"proto", -- Protocol Buffers
|
||||||
"scss",
|
"rust",
|
||||||
"sql",
|
"scss",
|
||||||
"svelte",
|
"sql",
|
||||||
"toml",
|
"svelte",
|
||||||
"tsx",
|
"toml",
|
||||||
"yaml",
|
"tsx",
|
||||||
},
|
"yaml",
|
||||||
|
},
|
||||||
|
|
||||||
-- matchup = {
|
-- matchup = {
|
||||||
-- enable = true,
|
-- enable = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user