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/snacks.lua | 154 +++++++++++++++++++++++++++++++------------------ 1 file changed, 97 insertions(+), 57 deletions(-) (limited to 'lua/plugins/snacks.lua') diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index bcec3e5..c6b63b3 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -10,79 +10,119 @@ return { indent = { enabled = true }, input = { enabled = true }, notifier = { enabled = true }, - picker = { enabled = true }, + picker = { + enabled = true, + ui_select = false, + jump = { + reuse_win = true, + }, + on_show = function(picker) + vim.schedule(function() + -- vim.api.nvim_win_call(picker.input.win.win, function() + vim.cmd 'startinsert' + -- end) + end) + end, + sources = { + files = { + layout = { preset = "telescope" }, + focus = "list", + }, + }, + }, + layout = { + preset = "dropdown", + layout = { + backdrop = false, + width = 0.4, + min_width = 80, + height = 0.25, + min_height = 10, + border = "none", + box = "vertical", + { + box = "vertical", + border = true, + title = "{title} {live} {flags}", + title_pos = "center", + { win = "input", height = 1, border = "bottom" }, + { win = "list", border = "none" }, + }, + }, + }, quickfile = { enabled = true }, scope = { enabled = true }, scroll = { enabled = true }, statuscolumn = { enabled = true }, words = { enabled = true }, + image = { enabled = true }, }, keys = { -- Top Pickers & Explorer - { "", function() Snacks.picker.smart() end, desc = "Smart Find Files" }, - { ",", function() Snacks.picker.buffers() end, desc = "Buffers" }, - { "/", function() Snacks.picker.grep() end, desc = "Grep" }, - { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, - { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, - { "e", function() Snacks.explorer() end, desc = "File Explorer" }, + { "", function() Snacks.picker.smart() end, desc = "Smart Find Files" }, + { ",", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "/", function() Snacks.picker.grep() end, desc = "Grep" }, + { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, + { "e", function() Snacks.explorer() end, desc = "File Explorer" }, -- find - { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, - { "fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" }, - { "ff", function() Snacks.picker.files() end, desc = "Find Files" }, - { "gf", function() Snacks.picker.git_files() end, desc = "Find Git Files" }, - { "fr", function() Snacks.picker.recent() end, desc = "Recent" }, + { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" }, + { "ff", function() Snacks.picker.files() end, desc = "Find Files" }, + { "gf", function() Snacks.picker.git_files() end, desc = "Find Git Files" }, + { "fr", function() Snacks.picker.recent() end, desc = "Recent" }, -- git - { "gl", function() Snacks.picker.git_log() end, desc = "Git Log" }, - { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, + { "gl", function() Snacks.picker.git_log() end, desc = "Git Log" }, + { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, -- Grep - { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, - { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, - { "sg", function() Snacks.picker.grep() end, desc = "Grep" }, - { "sw", function() Snacks.picker.grep_word() end, desc = "Visual selection or word", mode = { "n", "x" } }, + { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, + { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, + { "sg", function() Snacks.picker.grep() end, desc = "Grep" }, + { "sw", function() Snacks.picker.grep_word() end, desc = "Visual selection or word", mode = { "n", "x" } }, -- search - { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, - { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, - { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, - { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, - { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, - { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, - { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, - { "si", function() Snacks.picker.icons() end, desc = "Icons" }, - { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, - { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, - { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, - { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, - { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, - { "su", function() Snacks.picker.undo() end, desc = "Undo History" }, - { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, - { "sT", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, - { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, + { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, + { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, + { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, + { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, + { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, + { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, + { "si", function() Snacks.picker.icons() end, desc = "Icons" }, + { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, + { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, + { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, + { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, + { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, + { "su", function() Snacks.picker.undo() end, desc = "Undo History" }, + { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, + { "sT", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, + { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, -- LSP - { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" }, - { "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" }, - { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, - { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, - { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, - { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" }, - { "sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" }, - + { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" }, + { "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" }, + { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, + { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, + { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, + { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" }, + { "sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" }, + -- Migrated from Telescope - { "pp", function() Snacks.picker.smart() end, desc = "Open Project files" }, - { "gc", function() Snacks.picker.git_branches() end, desc = "Git Branches selector" }, - { "pw", function() Snacks.picker.grep_word() end, desc = "Grep word under cursor" }, - { "ps", function() Snacks.picker.grep() end, desc = "Grep provided input string" }, - { "rc", function() Snacks.picker.git_files({ cwd = vim.fn.expand("~/.dotfiles") }) end, desc = "Search Files in .dotfiles directory" }, - { "rn", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Search Files in nvim config directory" }, - { "rp", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/plugins" }) end, desc = "Search Neovim plugins" }, - { "rs", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/scratchs" }) end, desc = "Search Neovim Scratchs files" }, - { "ph", function() Snacks.picker.help() end, desc = "Neovim Help" }, - { "pe", function() Snacks.picker.buffers() end, desc = "Open buffers" }, + { "pp", function() Snacks.picker.smart() end, desc = "Open Project files" }, + { "gc", function() Snacks.picker.git_branches() end, desc = "Git Branches selector" }, + { "pw", function() Snacks.picker.grep_word() end, desc = "Grep word under cursor" }, + { "ps", function() Snacks.picker.grep() end, desc = "Grep provided input string" }, + { "rc", function() Snacks.picker.git_files({ cwd = vim.fn.expand("~/.dotfiles") }) end, desc = "Search Files in .dotfiles directory" }, + { "rn", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Search Files in nvim config directory" }, + { "rp", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/plugins" }) end, desc = "Search Neovim plugins" }, + { "rs", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/scratchs" }) end, desc = "Search Neovim Scratchs files" }, + { "ph", function() Snacks.picker.help() end, desc = "Neovim Help" }, + { "pe", function() Snacks.picker.buffers() end, desc = "Open buffers" }, -- { "pr", function() Snacks.picker.treesitter() end, desc = "Treesitter buffer elements" }, -- Check if treesitter exists - { "bb", function() Snacks.explorer() end, desc = "Current directory" }, - { "bp", function() Snacks.explorer() end, desc = "Project directory" }, + { "bb", function() Snacks.explorer() end, desc = "Current directory" }, + { "bp", function() Snacks.explorer() end, desc = "Project directory" }, -- { "gs", function() Snacks.picker.git_status() end, desc = "Git status" }, -- Already in default - { "ve", function() Snacks.picker.diagnostics() end, desc = "Diagnostic of the buffer" }, - { "po", function() Snacks.picker.git_files({ cwd = "./api-specification" }) end, desc = "Openapi directory" }, + { "ve", function() Snacks.picker.diagnostics() end, desc = "Diagnostic of the buffer" }, + { "po", function() Snacks.picker.git_files({ cwd = "./api-specification" }) end, desc = "Openapi directory" }, -- { "pm", "gateway", { desc = "Graphql mutations and queries" }) -- Skipped }, } -- cgit v1.2.3