From 2895ac732dce0eece5ab2586f5d4d76ee0fab710 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Thu, 23 Apr 2026 23:15:45 -0300 Subject: =?UTF-8?q?feat(neovim):=20integrar=20CodeCompanion/MCPHub,=20a?= =?UTF-8?q?=C3=B1adir=20autocompletado=20AI=20y=20actualizar=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Añadir integración completa de CodeCompanion (mcphub, adaptadores, UI, herramientas, historial, paleta de acciones) - Configuración de build/portado de `mcphub` y opciones de tiempo de ejecución - Configurar adaptadores, herramientas por defecto y múltiples adaptadores para `chat`/`inline`/`cmd` - Añadir autocomandos de CodeCompanion para mostrar/ocultar el spinner - Añadir keymaps relacionados con CodeCompanion - Añadir proveedor de autocompletado AI `minuet-ai` y cambiar la fuente de completado por defecto a `minuet` - Eliminar el archivo de configuración antiguo de Copilot y varios archivos de configuración de plugins obsoletos (`lua/config/copilot.lua`, `lua/plugins/foatterm.lua`, `lua/plugins/img-clip.lua`, `lua/plugins/markdown-preview.lua`, `lua/plugins/markview.lua`) - Actualizar muchos pines de plugins en `lazy-lock.json` (bump/reemplazo de commits) - Comentar los `autocmd` de trim de espacios en blanco y `clang-format` (deshabilita comportamiento de autoformateo/auto-guardar) - Establecer opciones globales: - desactivar el autoformateo global de LazyVim: `vim.g.autoformat = false` - evitar que `:w` agregue automáticamente un salto de línea final: `opt.fixeol = false` - Ajustes de UI: - agregar resaltados `FloatBorder`/`FloatTitle` y hacer `PmenuSel` en negrita - Añadir keymap específico para Rust: sobrescribir `K` para invocar las acciones de hover de `rustaceanvim` - Actualizar/limpiar muchas configuraciones de plugins: - reescritura amplia de `lua/plugins/codecompanion.lua` - añadir/modificar opciones de `lua/plugins/image.lua` (`image.nvim`) - ajustar UI, pickers y keymaps de `lua/plugins/snacks.lua` - actualizar versión de `rustaceanvim` y desactivar `format_on_save` en `navigator` - varias correcciones de formato y consistencia en archivos de plugins - Actualizar `lua/config/keymaps.lua` para incluir bindings de CodeCompanion Notas: - Estos cambios modifican el comportamiento de formateo/autoformateo (autoformateo desactivado y algunos `autocmd` `BufWritePre` comentados). Revisa si quieres reactivar el formateo automático al guardar. --- lua/plugins/completition.lua | 82 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 14 deletions(-) (limited to 'lua/plugins/completition.lua') diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index 91a7b89..071c16c 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -5,16 +5,63 @@ return { "rafamadriz/friendly-snippets", { "L3MON4D3/LuaSnip", version = "v1.*" }, "windwp/nvim-autopairs", - { - "zbirenbaum/copilot.lua", - cmd = { "Copilot" }, - event = { "VeryLazy" }, - opts = { suggestion = { enabled = false }, panel = { enabled = false } }, - }, - -- Add blink.cmp copilot source - "giuxtaposition/blink-cmp-copilot", + -- { + -- "zbirenbaum/copilot.lua", + -- cmd = { "Copilot" }, + -- event = { "VeryLazy" }, + -- opts = { suggestion = { enabled = false }, panel = { enabled = false } }, + -- }, + -- -- Add blink.cmp copilot source + -- { + -- "giuxtaposition/blink-cmp-copilot", + -- }, -- Add blink.cmp latex source for LaTeX/VimTeX support "erooke/blink-cmp-latex", + -- Add minuet-ai for AI completions with llama-server + { + "milanglacier/minuet-ai.nvim", + config = function() + require('minuet').setup { + provider = 'openai_fim_compatible', + n_completions = 1, -- recommend for local model for resource saving + -- I recommend beginning with a small context window size and incrementally + -- expanding it, depending on your local computing power. A context window + -- of 512, serves as an good starting point to estimate your computing + -- power. Once you have a reliable estimate of your local computing power, + -- you should adjust the context window to a larger value. + context_window = 512, + provider_options = { + openai_fim_compatible = { + -- For Windows users, TERM may not be present in environment variables. + -- Consider using APPDATA instead. + api_key = 'TERM', + name = 'Qwen', + end_point = 'http://localhost:8012/v1/completions', + -- The model is set by the llama-cpp server and cannot be altered + -- post-launch. + model = 'PLACEHOLDER', + optional = { + max_tokens = 56, + top_p = 0.9, + }, + -- Llama.cpp does not support the `suffix` option in FIM completion. + -- Therefore, we must disable it and manually populate the special + -- tokens required for FIM completion. + template = { + prompt = function(context_before_cursor, context_after_cursor, _) + return '<|fim_prefix|>' + .. context_before_cursor + .. '<|fim_suffix|>' + .. context_after_cursor + .. '<|fim_middle|>' + end, + suffix = false, + }, + }, + }, + } + end, + }, }, -- use a release tag to download pre-built binaries @@ -60,7 +107,7 @@ return { border = "rounded", draw = { columns = { - { "label", "label_description", gap = 1 }, + { "label", "label_description", gap = 1 }, { "kind_icon", "kind" }, }, }, @@ -70,19 +117,26 @@ return { -- Default list of enabled providers sources = { - default = { "lsp", "path", "snippets", "buffer", "copilot" }, + default = { "lsp", "path", "snippets", "buffer", "minuet" }, + -- default = { "lsp", "path", "snippets", "buffer", "copilot", "minuet" }, per_filetype = { tex = { "lsp", "path", "snippets", "buffer", "latex" }, bib = { "lsp", "path", "snippets", "buffer", "latex" }, codecompanion = { "codecompanion" }, }, providers = { - copilot = { - name = "copilot", - module = "blink-cmp-copilot", - score_offset = 100, + minuet = { + name = "minuet", + module = "minuet.blink", + score_offset = 101, async = true, }, + -- copilot = { + -- name = "copilot", + -- module = "blink-cmp-copilot", + -- score_offset = 100, + -- async = true, + -- }, latex = { name = "latex", module = "blink-cmp-latex", -- cgit v1.2.3