Files
hotfiles/.config/nvim/lua/plugins/comp.lua
2026-02-01 15:31:04 +01:00

138 lines
3.6 KiB
Lua

return {
{
"saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets", "saghen/blink.compat" },
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = "default" },
appearance = {
nerd_font_variant = "mono",
},
completion = { documentation = { auto_show = false } },
sources = {
default = {
"lazydev",
"lsp",
"path",
"snippets",
"buffer",
"avante_commands",
"avante_mentions",
"avante_shortcuts",
"avante_files",
},
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
avante_commands = {
name = "avante_commands",
module = "blink.compat.source",
score_offset = 90, -- show at a higher priority than lsp
opts = {},
},
avante_files = {
name = "avante_files",
module = "blink.compat.source",
score_offset = 100, -- show at a higher priority than lsp
opts = {},
},
avante_mentions = {
name = "avante_mentions",
module = "blink.compat.source",
score_offset = 1000, -- show at a higher priority than lsp
opts = {},
},
avante_shortcuts = {
name = "avante_shortcuts",
module = "blink.compat.source",
score_offset = 1000, -- show at a higher priority than lsp
opts = {},
},
},
},
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
},
{
"yetone/avante.nvim",
-- ⚠️ must add this setting! ! !
build = vim.fn.has("win32") ~= 0
and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make",
event = "VeryLazy",
version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = {
instructions_file = "avante.md",
provider = "ollama_ministral",
providers = {
ollama_devstral = {
endpoint = "http://10.0.32.128:11434",
__inherited_from = "ollama",
model = "devstral-small-2:latest",
},
ollama_ministral = {
endpoint = "http://10.0.32.128:11434",
__inherited_from = "ollama",
model = "ministral-3:3b",
},
},
},
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"folke/snacks.nvim", -- for input provider snacks
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
{
-- 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" },
},
},
},
}