mirror of
https://github.com/cap153/nvim.git
synced 2025-12-26 19:25:01 +08:00
添加ai工具
This commit is contained in:
parent
ad1ae84e5f
commit
59f0ba6a45
6 changed files with 73 additions and 63 deletions
|
|
@ -42,6 +42,8 @@ vim.o.termguicolors = true
|
|||
vim.opt.updatetime = 200
|
||||
-- 指定keyword
|
||||
vim.opt.iskeyword = "_,49-57,A-Z,a-z"
|
||||
-- 让全局默认边框变成rounded或single
|
||||
vim.o.winborder = 'rounded'
|
||||
|
||||
-- 设置编码格式
|
||||
vim.o.fileencodings = 'utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1'
|
||||
|
|
|
|||
|
|
@ -93,5 +93,5 @@ require("lazy").setup({
|
|||
-- mcp server插件
|
||||
-- require("lazy.plugins.mcphub"),
|
||||
-- 像cursor一样使用neovim
|
||||
-- require("lazy.plugins.avante"),
|
||||
require("lazy.plugins.avante"),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,47 +1,48 @@
|
|||
return {
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
version = false, -- Never set this value to "*"! Never!
|
||||
commit = "7dc5560",
|
||||
-- version = false, -- Never set this value to "*"! Never!
|
||||
opts = {
|
||||
-- behaviour = {
|
||||
-- enable_cursor_planning_mode = true, -- enable cursor planning mode!
|
||||
-- },
|
||||
provider = "openrouter",
|
||||
vendors = {
|
||||
openrouter = {
|
||||
__inherited_from = "openai",
|
||||
disable_tools = true,
|
||||
endpoint = "https://openrouter.ai/api/v1",
|
||||
api_key_name = "OPENROUTER_API_KEY",
|
||||
model = "deepseek/deepseek-chat-v3-0324:free",
|
||||
},
|
||||
},
|
||||
-- provider = "deepseek",
|
||||
-- provider = "openrouter",
|
||||
-- vendors = {
|
||||
-- deepseek = {
|
||||
-- openrouter = {
|
||||
-- __inherited_from = "openai",
|
||||
-- api_key_name = "DEEPSEEK_API_KEY",
|
||||
-- endpoint = "https://api.deepseek.com",
|
||||
-- model = "deepseek-chat",
|
||||
-- disable_tools = true,
|
||||
-- endpoint = "https://openrouter.ai/api/v1",
|
||||
-- api_key_name = "OPENROUTER_API_KEY",
|
||||
-- model = "deepseek/deepseek-chat-v3-0324:free",
|
||||
-- },
|
||||
-- },
|
||||
provider = "deepseek",
|
||||
vendors = {
|
||||
deepseek = {
|
||||
__inherited_from = "openai",
|
||||
api_key_name = "DEEPSEEK_API_KEY",
|
||||
endpoint = "https://api.deepseek.com",
|
||||
model = "deepseek-chat",
|
||||
},
|
||||
},
|
||||
-- The system_prompt type supports both a string and a function that returns a string. Using a function here allows dynamically updating the prompt with mcphub
|
||||
system_prompt = function()
|
||||
local hub = require("mcphub").get_hub_instance()
|
||||
return hub:get_active_servers_prompt()
|
||||
end,
|
||||
-- The custom_tools type supports both a list and a function that returns a list. Using a function here prevents requiring mcphub before it's loaded
|
||||
custom_tools = function()
|
||||
return {
|
||||
require("mcphub.extensions.avante").mcp_tool(),
|
||||
}
|
||||
end,
|
||||
-- system_prompt = function()
|
||||
-- local hub = require("mcphub").get_hub_instance()
|
||||
-- return hub:get_active_servers_prompt()
|
||||
-- end,
|
||||
-- -- The custom_tools type supports both a list and a function that returns a list. Using a function here prevents requiring mcphub before it's loaded
|
||||
-- custom_tools = function()
|
||||
-- return {
|
||||
-- require("mcphub.extensions.avante").mcp_tool(),
|
||||
-- }
|
||||
-- end,
|
||||
},
|
||||
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
|
||||
build = "make",
|
||||
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
|
||||
dependencies = {
|
||||
"ravitemer/mcphub.nvim",
|
||||
-- "ravitemer/mcphub.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
|
@ -69,13 +70,13 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- -- Make sure to set this up properly if you have lazy=true
|
||||
-- "MeanderingProgrammer/render-markdown.nvim",
|
||||
-- opts = {
|
||||
-- file_types = { "markdown", "Avante" },
|
||||
-- },
|
||||
-- ft = { "markdown", "Avante" },
|
||||
-- },
|
||||
{
|
||||
-- Make sure to set this up properly if you have lazy=true
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "Avante" },
|
||||
},
|
||||
ft = { "Avante" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ return {
|
|||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
-- "Kaiser-Yang/blincmp-avante",
|
||||
"Kaiser-Yang/blink-cmp-avante",
|
||||
},
|
||||
version = "*",
|
||||
---@module 'blink.cmp'
|
||||
|
|
@ -75,7 +75,7 @@ return {
|
|||
"lsp",
|
||||
"path",
|
||||
"snippets",
|
||||
-- "avante",
|
||||
"avante",
|
||||
},
|
||||
providers = {
|
||||
-- score_offset设置优先级数字越大优先级越高
|
||||
|
|
@ -92,11 +92,13 @@ return {
|
|||
return 0
|
||||
end,
|
||||
},
|
||||
-- avante = {
|
||||
-- module = "blink-cmp-avante",
|
||||
-- name = "Avante",
|
||||
-- score_offset = 6,
|
||||
-- },
|
||||
avante = {
|
||||
module = "blink-cmp-avante",
|
||||
name = "Avante",
|
||||
opts = {
|
||||
-- options for blink-cmp-avante
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ return {
|
|||
-- "gopls",
|
||||
},
|
||||
automatic_enable = {
|
||||
exclude = {
|
||||
},
|
||||
exclude = {},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue