local use_google = require("utils").use_google local flags = require("utils").flags local kind_icons = { -- LLM Provider icons claude = "󰋦", openai = "󱢆", codestral = "󱎥", gemini = "", nvim_ciderlsp = "󱜚", Groq = "", Openrouter = "󱂇", Ollama = "󰳆", ["Llama.cpp"] = "󰳆", Deepseek = "", } return { { "yetone/avante.nvim", event = "VeryLazy", version = false, -- Never set this value to "*"! Never! opts = { -- add any opts here -- for example provider = "openai", openai = { endpoint = "https://api.openai.com/v1", model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models temperature = 0, max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models) --reasoning_effort = "medium", -- low|medium|high, only used for reasoning models }, }, -- 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 = { "nvim-treesitter/nvim-treesitter", "stevearc/dressing.nvim", "Kaiser-Yang/blink-cmp-avante", "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim", --- The below dependencies are optional, "echasnovski/mini.pick", -- for file_selector provider mini.pick "nvim-telescope/telescope.nvim", -- for file_selector provider telescope "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions "ibhagwan/fzf-lua", -- for file_selector provider fzf "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons "zbirenbaum/copilot.lua", -- for providers='copilot' { -- support for image pasting "HakonHarnes/img-clip.nvim", event = "VeryLazy", opts = { -- recommended settings default = { embed_image_as_base64 = false, prompt_for_file_name = false, drag_and_drop = { insert_mode = true, }, -- required for Windows users use_absolute_path = true, }, }, }, { -- Make sure to set this up properly if you have lazy=true 'MeanderingProgrammer/render-markdown.nvim', opts = { file_types = { "markdown", "Avante" }, }, ft = { "markdown", "Avante" }, }, }, }, { "saghen/blink.compat", -- use the latest release, via version = '*', if you also use the latest release for blink.cmp version = "*", -- lazy.nvim will automatically load the plugin when it's required by blink.cmp lazy = true, cond = flags.blink, -- make sure to set opts so that lazy.nvim calls blink.compat's setup opts = { impersonate_nvim_cmp = true, debug = true, }, }, { "saghen/blink.cmp", lazy = false, -- lazy loading handled internally cond = flags.blink, dependencies = { "chrisgrieser/cmp-nerdfont", "hrsh7th/cmp-nvim-lsp", "mikavilpas/blink-ripgrep.nvim", "moyiz/blink-emoji.nvim", "rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source "saghen/blink.compat", }, version = "v0.*", -- use a release tag to download pre-built binaries -- build = 'cargo build --release', ---@module 'blink.cmp' ---@type blink.cmp.Config opts = { -- stylua: ignore keymap = { preset = "none", [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "hide", "fallback" }, [""] = { "accept", "fallback" }, [""] = { "select_next", "snippet_forward", "accept", "fallback" }, [""] = { "select_prev", "snippet_backward", "fallback" }, [""] = { "select_prev", "fallback" }, [""] = { "select_next", "fallback" }, [""] = { "scroll_documentation_up", "fallback" }, [""] = { "scroll_documentation_down", "fallback" }, }, appearance = { use_nvim_cmp_as_default = true, nerd_font_variant = "normal", kind_icons = kind_icons, }, sources = { default = function(ctx) local providerToEnable = { "lsp", "path", "snippets", "ripgrep", "emoji", "nerdfont", "buffer", } if use_google() then table.insert(providerToEnable, "nvim_ciderlsp") table.insert(providerToEnable, "buganizer") else table.insert(providerToEnable, "avante") table.insert(providerToEnable, "minuet") end return providerToEnable end, providers = { lsp = { name = "LSP", module = "blink.cmp.sources.lsp", score_offset = 90 }, -- dont show LuaLS require statements when lazydev has items lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } }, ripgrep = { module = "blink-ripgrep", name = "Ripgrep", -- the options below are optional, some default values are shown ---@module "blink-ripgrep" ---@type blink-ripgrep.Options opts = { prefix_min_len = 3, context_size = 5, max_filesize = "1M", additional_rg_options = {}, }, score_offset = 20, -- the higher the number, the higher the priority }, -- https://github.com/moyiz/blink-emoji.nvim emoji = { module = "blink-emoji", name = "Emoji", score_offset = 1, -- the higher the number, the higher the priority opts = { insert = true }, -- Insert emoji (default) or complete its name }, buffer = { name = "Buffer", enabled = true, max_items = 3, module = "blink.cmp.sources.buffer", min_keyword_length = 4, score_offset = 15, -- the higher the number, the higher the priority }, -- compat sources nerdfont = { name = "nerdfont", module = "blink.compat.source", score_offset = 1, -- the higher the number, the higher the priority }, minuet = { name = "minuet", module = "minuet.blink", score_offset = 100, -- Gives minuet higher priority among suggestions }, avante = { module = 'blink-cmp-avante', name = 'Avante', opts = { -- options for blink-cmp-avante } }, nvim_ciderlsp = { name = "nvim_ciderlsp", module = "blink.compat.source", score_offset = 100, }, buganizer = { name = "nvim_buganizer", module = "blink.compat.source", }, }, }, -- experimental signature help support signature = { enabled = true }, completion = { -- Recommended to avoid unnecessary request trigger = { prefetch_on_insert = false }, list = { -- stylua: ignore selection = { preselect = function(ctx) return ctx.mode ~= 'cmdline' end, auto_insert = function(ctx) return ctx.mode ~= 'cmdline' end, }, }, documentation = { auto_show = true, }, -- Displays a preview of the selected item on the current line ghost_text = { enabled = true, }, trigger = { show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" }, }, }, }, -- allows extending the providers array elsewhere in your config -- without having to redefine it opts_extend = { "sources.default" }, }, }