nvim(avante) choose provider based on os

This commit is contained in:
Kacper Marzecki 2025-03-18 22:06:14 +01:00
parent 8effb9cb27
commit ae54f5b6dc
2 changed files with 25 additions and 18 deletions

View File

@ -16,7 +16,7 @@
"fzf-lua": { "branch": "main", "commit": "15d5cd9a74da7f8739030a5c411c046c70f66a60" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
"gp.nvim": { "branch": "main", "commit": "2372d5323c6feaa2e9c19f7ccb537c615d878e18" },
"grug-far.nvim": { "branch": "main", "commit": "1b7a54633071cbb7a378162b8f04a38913987d64" },
"grug-far.nvim": { "branch": "main", "commit": "f9a74468d909d3893eec01b39b17dae9a4fe308f" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"img-clip.nvim": { "branch": "main", "commit": "24c13df08e3fe66624bed5350a2a780f77f1f65b" },
"inc-rename.nvim": { "branch": "main", "commit": "f9b9e5b9a75074810f40881b7e254b5bbeaf122e" },
@ -47,7 +47,7 @@
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-parinfer": { "branch": "master", "commit": "5ca09287ab3f4144f78ff7977fabc27466f71044" },
"nvim-spider": { "branch": "main", "commit": "9b9a1cf88a10790de69d3b0562d7d612f23561d5" },
"nvim-treesitter": { "branch": "master", "commit": "cf0eabc16cf32d69f7612d0e023ef210d84cdde6" },
"nvim-treesitter": { "branch": "master", "commit": "38959800c2439c890e3238af559f0dc3be45e393" },
"nvim-treesitter-context": { "branch": "master", "commit": "198720b4016af04c9590f375d714d5bf8afecc1a" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "143856b1cee509a190cc8c17ddb0638002171235" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },

View File

@ -385,10 +385,10 @@ return {
{
"yetone/avante.nvim",
event = "VeryLazy",
version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes.
opts = {
-- add any opts here
-- for example
version = false,
-- for macos
opts = vim.loop.os_uname().sysname == "Darwin"
and {
provider = "copilot",
copilot = {
-- endpoint = "https://api.githubcopilot.com/chat/completions",
@ -398,6 +398,13 @@ return {
-- max_tokens = 4096,
-- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.)
},
}
-- for linux
or {
provider = "openai",
openai = {
model = "gpt-4o",
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
@ -449,8 +456,8 @@ return {
opts = {
file_with_line = {
create_list_item = function()
local file_path = vim.fn.expand("%:p") -- Absolute path of the file
local line_number = vim.fn.line(".") -- Current line number
local file_path = vim.fn.expand("%:p") -- Absolute file path
local line_number = vim.fn.line(".")
if file_path == "" then
return nil
@ -465,7 +472,7 @@ return {
select = function(list_item, list, option)
vim.cmd("edit " .. list_item.context.file_path)
-- Jump to the specified line
-- Jump to the line
vim.api.nvim_win_set_cursor(0, { list_item.context.line_number, 0 })
end,
},