From df7c711e2a49d51249350f52c63274b72aacb739 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sun, 27 Sep 2026 12:46:49 -0300 Subject: =?UTF-8?q?Migraci=C3=B3n=20de=20plugins=20a=20funcionalidad=20nat?= =?UTF-8?q?iva:=20statusline=20y=20treesitter=20propios,=20se=20quitan=20m?= =?UTF-8?q?ason,=20lualine,=20mini,=20notify=20y=20otros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/plugins/animation.lua | 11 -- lua/plugins/buffer_manager.lua | 24 ---- lua/plugins/close-buffer.lua | 12 -- lua/plugins/code-annotation.lua | 11 -- lua/plugins/codecompanion.lua | 6 +- lua/plugins/color-picker.lua | 7 -- lua/plugins/colorize.lua | 34 +++--- lua/plugins/completition.lua | 20 ++++ lua/plugins/flutter.lua | 1 - lua/plugins/gitsigns.lua | 11 +- lua/plugins/icon-picker.lua | 9 -- lua/plugins/indent-o-matic.lua | 5 - lua/plugins/init.lua | 11 -- lua/plugins/json-nvim.lua | 8 -- lua/plugins/laravel.lua | 8 +- lua/plugins/lsp.lua | 18 +-- lua/plugins/lualine.lua | 233 -------------------------------------- lua/plugins/menu.lua | 28 ----- lua/plugins/mini.lua | 7 -- lua/plugins/minty.lua | 28 ++++- lua/plugins/navigator.lua | 41 ------- lua/plugins/neorg.lua | 3 +- lua/plugins/neotest.lua | 1 - lua/plugins/noice.lua | 243 ++++------------------------------------ lua/plugins/notify.lua | 10 -- lua/plugins/project-config.lua | 5 - lua/plugins/rest.lua | 55 --------- lua/plugins/rustaceanvim.lua | 14 +++ lua/plugins/snacks.lua | 10 ++ lua/plugins/treesitter.lua | 182 +++++++----------------------- lua/plugins/undotree.lua | 11 -- 31 files changed, 171 insertions(+), 896 deletions(-) delete mode 100644 lua/plugins/animation.lua delete mode 100644 lua/plugins/buffer_manager.lua delete mode 100644 lua/plugins/close-buffer.lua delete mode 100644 lua/plugins/color-picker.lua delete mode 100644 lua/plugins/icon-picker.lua delete mode 100644 lua/plugins/indent-o-matic.lua delete mode 100644 lua/plugins/json-nvim.lua delete mode 100644 lua/plugins/lualine.lua delete mode 100644 lua/plugins/menu.lua delete mode 100644 lua/plugins/mini.lua delete mode 100644 lua/plugins/navigator.lua delete mode 100644 lua/plugins/notify.lua delete mode 100644 lua/plugins/project-config.lua delete mode 100644 lua/plugins/rest.lua (limited to 'lua/plugins') diff --git a/lua/plugins/animation.lua b/lua/plugins/animation.lua deleted file mode 100644 index 865287e..0000000 --- a/lua/plugins/animation.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "anuvyklack/animation.nvim", - dependencies = { - "anuvyklack/middleclass", - }, - keys = { - {"AA", function () - require("pi.animations").redraw_buffer() - end} - }, -} diff --git a/lua/plugins/buffer_manager.lua b/lua/plugins/buffer_manager.lua deleted file mode 100644 index 794e178..0000000 --- a/lua/plugins/buffer_manager.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - 'j-morano/buffer_manager.nvim', - dependencies = { 'nvim-lua/plenary.nvim' }, - keys = { - { - desc = 'Buffer Manager', - 'o', - function() require('buffer_manager.ui').toggle_quick_menu() end, - }, - { - desc = 'Next buffer', - ']b', - function() require('buffer_manager.ui').nav_next() end, - }, - { - desc = 'Previous buffer', - '[b', - function() require('buffer_manager.ui').nav_prev() end, - }, - }, - opts = { - width = 0.9, - }, - } diff --git a/lua/plugins/close-buffer.lua b/lua/plugins/close-buffer.lua deleted file mode 100644 index 64a6a82..0000000 --- a/lua/plugins/close-buffer.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - -- Send buffers into early retirement by automatically closing them after x minutes of inactivity. - { - "chrisgrieser/nvim-early-retirement", - config = true, - event = "VeryLazy", - opts = { - -- if a buffer has been inactive for this many minutes, close it - retirementAgeMins = 120, - }, - }, -} diff --git a/lua/plugins/code-annotation.lua b/lua/plugins/code-annotation.lua index eae61d0..52d0379 100644 --- a/lua/plugins/code-annotation.lua +++ b/lua/plugins/code-annotation.lua @@ -9,17 +9,6 @@ if not vim.g.vscode then end return { - -- JsDoc generator - { - "heavenshell/vim-jsdoc", - ft = "javascript,typescript,typescriptreact,svelte", - cmd = "JsDoc", - keys = { - { "jd", "JsDoc", desc = "JsDoc" }, - }, - -- make sure that you will have lehre install locally on plugin folder, refer https://github.com/heavenshell/vim-jsdoc#manual-installation - build = "make install", - }, { -- A better annotation generator. Supports multiple languages and annotation conventions. -- to jump to next annotation, to jump to previous annotation diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 7b805a7..f4230b0 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -216,36 +216,36 @@ return { -- }, }, inline = { + -- adapter = "llama.cpp", adapter = { name ="claude_code", model = "claude-haiku-4-5", -- model = "claude-sonnet-4-6", }, - -- adapter = "llama.cpp", -- adapter = { -- name = "copilot", -- model = "gpt-4.1", -- }, }, cmd = { + -- adapter = "llama.cpp", adapter = { name ="claude_code", model = "claude-haiku-4-5", -- model = "claude-sonnet-4-6", }, - -- adapter = "llama.cpp", -- adapter = { -- name = "copilot", -- model = "gpt-4.1", -- }, }, background = { + -- adapter = "llama.cpp" adapter = { name ="claude_code", model = "claude-haiku-4-5", -- model = "claude-sonnet-4-6", }, - -- adapter = "llama.cpp" -- adapter = { -- name = "copilot", -- model = "gpt-4.1", diff --git a/lua/plugins/color-picker.lua b/lua/plugins/color-picker.lua deleted file mode 100644 index 1e6c88b..0000000 --- a/lua/plugins/color-picker.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "ziontee113/color-picker.nvim", - keys = { - { "", "PickColorInsert", mode = "i", desc = "ColorPicker" }, - }, - config = true, -} diff --git a/lua/plugins/colorize.lua b/lua/plugins/colorize.lua index 41a4006..9f4dcef 100644 --- a/lua/plugins/colorize.lua +++ b/lua/plugins/colorize.lua @@ -1,19 +1,23 @@ return { - 'norcalli/nvim-colorizer.lua', - config = function() - require('colorizer').setup({ - 'css', - 'lua', - }, { + -- Fork mantenido de norcalli/nvim-colorizer.lua (el original usa APIs deprecadas + -- y dejaba el aviso "vim.tbl_flatten is deprecated" en cada arranque) + 'catgoose/nvim-colorizer.lua', + event = 'BufReadPre', + opts = { + filetypes = { + 'css', 'scss', 'sass', 'less', 'html', + 'lua', 'javascript', 'typescript', + 'toml', 'conf', 'yaml', 'json', + }, + user_default_options = { RGB = true, -- Colorear valores RGB - RRGGBB = true, -- Deshabilitar otros formatos + RRGGBB = true, names = false, -- Deshabilitar nombres de colores como "Red" - RRGGBBAA = true, -- Deshabilitar valores RGBA - rgb_fn = true, -- Deshabilitar funciones rgb() y rgba() - hsl_fn = true, -- Deshabilitar funciones hsl() y hsla() - css = false, -- Deshabilitar otros valores CSS - css_fn = false, -- Deshabilitar funciones CSS - }) - end + RRGGBBAA = true, + rgb_fn = true, -- Funciones rgb() y rgba() + hsl_fn = true, -- Funciones hsl() y hsla() + css = false, + css_fn = false, + }, + }, } - diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index 071c16c..bde2568 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -155,6 +155,26 @@ return { -- Experimental signature help support signature = { enabled = true }, + cmdline = { + enabled = true, + keymap = { + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, + [""] = { "accept", "fallback" }, + [""] = { "cancel", "fallback" }, + }, + completion = { + list = { selection = { preselect = false, auto_insert = false } }, + menu = { auto_show = true }, + }, + sources = function() + local type = vim.fn.getcmdtype() + if type == "/" or type == "?" then return { "buffer" } end + if type == ":" or type == "@" then return { "cmdline" } end + return {} + end, + }, + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance fuzzy = { implementation = "prefer_rust_with_warning" }, }, diff --git a/lua/plugins/flutter.lua b/lua/plugins/flutter.lua index 9d83940..36f2101 100644 --- a/lua/plugins/flutter.lua +++ b/lua/plugins/flutter.lua @@ -5,7 +5,6 @@ return filetype = 'dart', dependencies = { 'nvim-lua/plenary.nvim', - 'stevearc/dressing.nvim', -- optional for vim.ui.select }, config = true, } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 251ab40..6dd6145 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -4,7 +4,14 @@ return { opts = { signcolumn = false, numhl = true, - trouble = false, + current_line_blame = false, -- arranca apagado; se activa con el toggle + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 300, + ignore_whitespace = false, + }, + current_line_blame_formatter = " , · ", on_attach = function(bufnr) local gitsigns = require "gitsigns" vim.keymap.set("n", "hs", gitsigns.stage_hunk, { buffer = bufnr }) @@ -13,6 +20,8 @@ return { vim.keymap.set("n", "hp", gitsigns.preview_hunk, { buffer = bufnr }) vim.keymap.set("n", "hj", gitsigns.next_hunk, { buffer = bufnr }) vim.keymap.set("n", "hk", gitsigns.prev_hunk, { buffer = bufnr }) + -- Toggle del blame virtual (autor que modificó la línea) + vim.keymap.set("n", "hb", gitsigns.toggle_current_line_blame, { buffer = bufnr, desc = "Toggle blame línea" }) end, max_file_length = 10000, }, diff --git a/lua/plugins/icon-picker.lua b/lua/plugins/icon-picker.lua deleted file mode 100644 index adb1bb4..0000000 --- a/lua/plugins/icon-picker.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "ziontee113/icon-picker.nvim", - keys = { - { "i", "IconPickerNormal nerd_font", mode = "n", desc = "IconPicker NerdFont Insert" }, - { "y", "IconPickerYank nerd_font", mode = "n", desc = "IconPicker NerdFont Yank" }, - { "", "IconPickerInsert nerd_font emoji alt_font nerd_font_v3 symbols ", mode = "i", desc = "IconPicker NerdFont Insert mode" }, - }, - opts = { disable_legacy_commands = true }, -} diff --git a/lua/plugins/indent-o-matic.lua b/lua/plugins/indent-o-matic.lua deleted file mode 100644 index 39b53d3..0000000 --- a/lua/plugins/indent-o-matic.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'Darazaki/indent-o-matic', - event = 'BufReadPre', - opts = {}, - } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 3df2c55..dc3715b 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,15 +1,4 @@ return { - { - "jwalton512/vim-blade", - enabled = false, - }, - { - "tpope/vim-dispatch", - cmd = { "Make", "Dispatch" }, - }, "tpope/vim-surround", "tpope/vim-repeat", - "tpope/vim-rhubarb", - "tpope/vim-dotenv", - "tpope/vim-eunuch", } diff --git a/lua/plugins/json-nvim.lua b/lua/plugins/json-nvim.lua deleted file mode 100644 index 3866e1b..0000000 --- a/lua/plugins/json-nvim.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "VPavliashvili/json-nvim", - ft = "json", -- only load for json filetype - config = function() - vim.keymap.set("n", "jff", "JsonFormatFile") - vim.keymap.set("n", "jmf", "JsonMinifyFile") - end, -} diff --git a/lua/plugins/laravel.lua b/lua/plugins/laravel.lua index b158221..e524698 100644 --- a/lua/plugins/laravel.lua +++ b/lua/plugins/laravel.lua @@ -1,8 +1,6 @@ return { "adalessa/laravel.nvim", dependencies = { - "rcarriga/nvim-notify", - "nvim-telescope/telescope.nvim", "MunifTanjim/nui.nvim", }, cmd = { "Sail", "Artisan", "Composer", "Npm", "Laravel", "LaravelInfo", "DockerCompose" }, @@ -28,6 +26,11 @@ return { local user_arg = string.format("%s:%s", vim.trim(uid), vim.trim(gid)) require("laravel").setup { + features = { + pickers = { + provider = "snacks", + }, + }, route_info = { position = "top", }, @@ -40,6 +43,5 @@ return { }, }, } - require("telescope").load_extension "laravel" end, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 57e1b09..4448b91 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -13,27 +13,11 @@ return { }, event = "VeryLazy", }, - { - "williamboman/mason-lspconfig.nvim", - event = "VeryLazy", - dependencies = { - "neovim/nvim-lspconfig", - }, - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - event = "VeryLazy", - }, { name = "native-lsp", dir = vim.fn.stdpath("config"), event = "VeryLazy", main = "pi.lsp", - opts = { - mason = { - enable = true, - auto_install = false, - }, - }, + opts = {}, }, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 9409537..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,233 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local native_colorscheme = require "config.native-colorscheme" - local colors = native_colorscheme.colors - local config = { lualine_bold = true } -- Default config since we're not using solarized-osaka plugin - - local personal_colors = { - normal = { - a = { bg = colors.base03, fg = colors.blue100 }, - b = { bg = colors.fg, fg = colors.bg }, - c = { bg = colors.bg_statusline, fg = colors.fg }, - }, - insert = { - a = { bg = colors.base03, fg = colors.green100 }, - }, - - command = { - a = { bg = colors.base03, fg = colors.yellow100 }, - }, - - visual = { - a = { bg = colors.base03, fg = colors.magenta100 }, - }, - - replace = { - a = { bg = colors.base03, fg = colors.red100 }, - }, - - terminal = { - a = { bg = colors.base03, fg = colors.orange100 }, - }, - - inactive = { - a = { bg = colors.bg_statusline, fg = colors.blue }, - b = { bg = colors.bg_statusline, fg = colors.fg, gui = "bold" }, - c = { bg = colors.bg_statusline, fg = colors.fg }, - }, - } - - for _, mode in pairs(personal_colors) do - if config.lualine_bold then - mode.a.gui = "bold" - end - end - - -- local empty = require('lualine.component'):extend() - - -- local function jarak() - -- return ' ' - -- end - - local empty = require("lualine.component"):extend() - function empty:draw(default_highlight) - self.status = "" - self.applied_separator = "" - self:apply_highlights(default_highlight) - self:apply_section_separators() - return self.status - end - - local function process_sections(sections) - for name, section in pairs(sections) do - local left = name:sub(9, 10) < "x" - for pos = 1, name ~= "lualine_z" and #section or #section - 1 do - table.insert(section, pos * 2, { empty, color = { fg = colors.base03, bg = colors.base03 } }) - end - for id, comp in ipairs(section) do - if type(comp) ~= "table" then - comp = { comp } - section[id] = comp - end - -- comp.separator = left and { right = '' } or { left = '' } - comp.separator = left and { right = " " } or { left = " " } - -- comp.separator = {left = '' } and { right = '' } - end - end - return sections - end - - local lazy_status = require "lazy.status" - - require("lualine").setup { - options = { - theme = personal_colors, - -- icons_enabled = true, - -- component_separators = { left = '>', right = '┇' }, - -- section_separators = {left = '', right = '' }, - }, - sections = process_sections { - lualine_a = { - { - "mode", - icons_enabled = true, - icon = { - " ", - color = { fg = colors.base4, bg = colors.base03, gui = "bold" }, - }, - -- color = { fg = colors.base0, bg = colors.green300, gui = 'bold' }, - -- separator = { left = '', right = '' }, - -- left_padding = 2, right_padding = 0, - }, - }, - -- lualine_b = { 'filename', 'branch' }, - lualine_b = { - { - "branch", - -- separator = { left = '', right = '' }, - -- left_padding = 0, right_padding = 2, - icon = { - "", - -- align = 'left', - color = { fg = colors.orange100, bg = colors.base03, gui = "bold" }, - -- -- separator = {left = '', right = ''} - }, - -- left_padding = 0, - color = { fg = colors.orange100, bg = colors.base03, gui = "bold" }, - }, - { - "diff", - -- separator = { right = '',left = ''}, - colored = true, - symbols = { added = " ", modified = " ", removed = " " }, - diff_color = { - added = { fg = colors.green300, bg = colors.base03, gui = "bold" }, - modified = { fg = colors.yellow300, bg = colors.base03, gui = "bold" }, - removed = { fg = colors.red300, bg = colors.base03, gui = "bold" }, - }, - }, - }, - lualine_c = { - { - "filename", - on_click = function() - Snacks.picker.files() - -- print('file name clicked') - end, - icon = " ", - color = { fg = colors.yellow100, bg = colors.base03, gui = "bold" }, - path = 4, - file_status = false, - -- separator = { right = '┇', left = '┇'}, - }, - }, - lualine_x = { - { - "diagnostics", - on_click = function() - Snacks.picker.diagnostics() - end, - -- separator = { left = '' }, - sources = { "nvim_diagnostic" }, - sections = { "error", "warn", "info", "hint" }, - - diagnostics_color = { - error = { fg = colors.red300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' error color. - added = { fg = colors.green300, bg = colors.base03, gui = "bold" }, - warn = { fg = colors.yellow300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' warn color. - info = { fg = colors.blue300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' info color. - hint = { fg = colors.cyan300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' hint color. - }, - symbols = { error = " ", warn = " ", hint = "󰠠 ", info = " " }, - colored = true, -- Displays diagnostics status in color if set to true. - update_in_insert = true, -- Update diagnostics in insert mode. default = false - always_visible = false, -- Show diagnostics even if there are none. - }, - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = colors.orange300 }, - }, - { - -- code from https://github.com/nvim-lualine/lualine.nvim/blob/566b7036f717f3d676362742630518a47f132fff/examples/evil_lualine.lua - -- Lsp server name . - function() - local msg = "No LSP" - local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) - local clients = vim.lsp.get_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - -- icon = ' LSP:', - -- icon = {' ', color = {bg = colors.base03, fg = colors.red100}}, - -- separator = { left = '', right = ''}, - -- separator = { left = ' ', right = ' '}, - color = { fg = colors.base4, gui = "bold", bg = colors.base03 }, - }, - - { - "filetype", - color = { bg = colors.base03, fg = colors.magenta100, gui = "bold" }, - -- separator = { left = '', right = ' ' }, - }, - }, - lualine_y = { - { - "progress", - left_padding = 0, - color = { bg = colors.base03, fg = colors.cyan100, gui = "bold" }, - }, - }, - lualine_z = { - { - -- 'location', - -- function() - -- return "Ln:%l Col:%c" - -- end - -- separator = { right = '' }, left_padding = 2 }, - }, - }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = {}, - } - end, -} diff --git a/lua/plugins/menu.lua b/lua/plugins/menu.lua deleted file mode 100644 index aa5a4d1..0000000 --- a/lua/plugins/menu.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - -- Dependency required by nvzone/menu - { "nvzone/volt", lazy = true }, - - { - "nvzone/menu", - lazy = true, - keys = { - { - "um", - function() - local ok, menu = pcall(require, "menu") - if not ok then - vim.notify("menu.nvim no disponible", vim.log.levels.ERROR) - return - end - local ok_items, items = pcall(require, "menus.oil") - if not ok_items then - vim.notify("menus.oil no encontrado", vim.log.levels.ERROR) - return - end - menu.open(items) - end, - desc = "Abrir menú de Oil", - }, - }, - }, -} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua deleted file mode 100644 index 3fa0493..0000000 --- a/lua/plugins/mini.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'echasnovski/mini.nvim', - dependencies = { - 'echasnovski/mini.icons', - }, - version = false -} diff --git a/lua/plugins/minty.lua b/lua/plugins/minty.lua index 87a15bc..cb1775f 100644 --- a/lua/plugins/minty.lua +++ b/lua/plugins/minty.lua @@ -1,5 +1,5 @@ return { - -- volt is required by minty + -- volt es requerido por minty (motor de UI) { "nvzone/volt", lazy = true }, { @@ -11,8 +11,30 @@ return { }, config = function() require("minty").setup({ - -- Configuraciones opcionales - -- Por ejemplo, para auto-insertar el color seleccionado + huefy = { + border = false, + position = "cursor", -- cursor | center | func(w, h) + + -- Hook (no documentado) para añadir teclas dentro del picker. + -- minty ya trae = "Save": reemplaza el hex bajo el cursor. + -- Aquí añadimos = insertar el color elegido en el cursor, + -- útil cuando NO hay un hex debajo para reemplazar. + mappings = function(bufs) + local state = require("minty.huefy.state") + for _, buf in ipairs(bufs) do + vim.keymap.set("n", "", function() + local hex = "#" .. state.new_hex + require("volt").close() + vim.api.nvim_put({ hex }, "c", true, true) + end, { buffer = buf, desc = "Minty: insertar color en el cursor" }) + end + end, + }, + + shades = { + border = true, + position = "cursor", + }, }) end, }, diff --git a/lua/plugins/navigator.lua b/lua/plugins/navigator.lua deleted file mode 100644 index 954dfeb..0000000 --- a/lua/plugins/navigator.lua +++ /dev/null @@ -1,41 +0,0 @@ --- [[ --- Use or :q! to kill the floating window --- (or , ) to move --- or to open location or apply code actions. Note: might be bound in insert mode by other plugins --- ]] -return { - { - "ray-x/navigator.lua", - event = "LspAttach", - dependencies = { - { "ray-x/guihua.lua", build = "cd lua/fzy && make" }, - }, - opts = { - default_mapping = false, - lsp = { - disable_lsp = "all", -- Uses native LSP configuration instead of lspconfig - format_on_save = false, - hover = { - enable = false, - }, - }, - }, - -- Refer more usage on https://raw.githubusercontent.com/ray-x/navigator.lua/master/lua/navigator/lspclient/mapping.lua - keys = { - { "gr", ":lua require'navigator.reference'.async_ref()", desc = "Navigator - Async reference" }, - { "gS", ":lua require'navigator.symbols'.document_symbols()", desc = "Navigator - Document symbols" }, - { - "gw", - ":lua require'navigator.workspace'.workspace_symbol_live()", - desc = "Navigator - workspace symbols live", - }, - { "gd", ":lua require'navigator.definition'.definition()", desc = "Navigator - Definition" }, - { - "gp", - ":lua require'navigator.definition'.definition_preview()", - desc = "Navigator - Definition preview", - }, - { "ga", ":lua require'navigator.codeAction'.code_action()", desc = "Navigator - Code Action" }, - }, - }, -} diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index bf27994..4fc6e10 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -1,6 +1,7 @@ return { "nvim-neorg/neorg", - build = ":Neorg sync-parsers", + -- `:Neorg sync-parsers` usa `nvim-treesitter.install`, que no existe en la + -- rama `main`. Los parsers norg/norg_meta se instalan aparte (scanner en C++). cmd = { "Neorg" }, dependencies = { "nvim-lua/plenary.nvim" }, config = function() diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index c00f12e..e953dae 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -5,7 +5,6 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", - "antoinemadec/FixCursorHold.nvim", "nvim-neotest/neotest-go", "nvim-neotest/neotest-plenary", "nvim-neotest/neotest-vim-test", diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 57dd934..88b9319 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -1,4 +1,6 @@ return { + -- Noice mínimo: SOLO la cmdline centrada (popup) y su menú de completado. + -- Mensajes, notificaciones y LSP quedan en manos nativas/snacks.notifier. "folke/noice.nvim", dependencies = { "MunifTanjim/nui.nvim", @@ -7,238 +9,31 @@ return { enabled = not vim.g.started_by_firenvim, opts = { cmdline = { - enabled = true, -- enables the Noice cmdline UI - view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = {}, -- global options for the cmdline. See section on views - ---@type table + enabled = true, + view = "cmdline_popup", format = { - -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. - -- view: (default is cmdline view) - -- opts: any options passed to the view - -- icon_hl_group: optional hl_group for the icon - -- title: set to anything or empty string to hide - cmdline = { pattern = "^:", icon = "", lang = "vim" }, - search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, - search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, + cmdline = { pattern = "^:", icon = "", lang = "vim" }, + search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, + search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, - lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" }, - help = { pattern = "^:%s*he?l?p?%s+", icon = "" }, - input = { view = "cmdline_input", icon = "󰥻 " }, -- Used by input() - -- lua = false, -- to disable a format, set to `false` + lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" }, + help = { pattern = "^:%s*he?l?p?%s+", icon = "" }, + input = { view = "cmdline_input", icon = "󰥻 " }, }, }, - messages = { - -- NOTE: If you enable messages, then the cmdline is enabled automatically. - -- This is a current Neovim limitation. - enabled = true, -- enables the Noice messages UI - view = "notify", -- default view for messages - view_error = "notify", -- view for errors - view_warn = "notify", -- view for warnings - view_history = "messages", -- view for :messages - view_search = "virtualtext", -- view for search count messages. Set to `false` to disable - }, popupmenu = { - enabled = true, -- enables the Noice popupmenu UI - ---@type 'nui'|'cmp' - backend = "nui", -- backend to use to show regular cmdline completions - ---@type NoicePopupmenuItemKind|false - -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) - kind_icons = {}, -- set to `false` to disable icons - }, - -- default options for require('noice').redirect - -- see the section on Command Redirection - ---@type NoiceRouteConfig - redirect = { - view = "popup", - filter = { event = "msg_show" }, - }, - -- You can add any custom commands below that will be available with `:Noice command` - ---@type table - commands = { - history = { - -- options for the message history that you get with `:Noice` - view = "split", - opts = { enter = true, format = "details" }, - filter = { - any = { - { event = "notify" }, - { error = true }, - { warning = true }, - { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, - }, - }, - }, - -- :Noice last - last = { - view = "popup", - opts = { enter = true, format = "details" }, - filter = { - any = { - { event = "notify" }, - { error = true }, - { warning = true }, - { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, - }, - }, - filter_opts = { count = 1 }, - }, - -- :Noice errors - errors = { - -- options for the message history that you get with `:Noice` - view = "popup", - opts = { enter = true, format = "details" }, - filter = { error = true }, - filter_opts = { reverse = true }, - }, - all = { - -- options for the message history that you get with `:Noice` - view = "split", - opts = { enter = true, format = "details" }, - filter = {}, - }, - }, - notify = { - -- Noice can be used as `vim.notify` so you can route any notification like other messages - -- Notification messages have their level and other properties set. - -- event is always "notify" and kind can be any log level as a string - -- The default routes will forward notifications to nvim-notify - -- Benefit of using Noice for this is the routing and consistent history view enabled = true, - view = "notify", + backend = "nui", }, + messages = { enabled = false }, + notify = { enabled = false }, lsp = { - progress = { - enabled = true, - -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin - -- See the section on formatting for more details on how to customize. - --- @type NoiceFormat|string - format = "lsp_progress", - --- @type NoiceFormat|string - format_done = "lsp_progress_done", - throttle = 1000 / 30, -- frequency to update lsp progress message - view = "mini", - }, - override = { - -- override the default lsp markdown formatter with Noice - ["vim.lsp.util.convert_input_to_markdown_lines"] = false, - -- override the lsp markdown formatter with Noice - ["vim.lsp.util.stylize_markdown"] = false, - -- override cmp documentation with Noice (needs the other options to work) - ["cmp.entry.get_documentation"] = false, - }, - hover = { - enabled = true, - silent = false, -- set to true to not show a message if hover is not available - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - signature = { - enabled = true, - auto_open = { - enabled = true, - trigger = true, -- Automatically show signature help when typing a trigger character from the LSP - luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes - throttle = 50, -- Debounce lsp signature help request by 50ms - }, - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - message = { - -- Messages shown by lsp servers - enabled = true, - view = "notify", - opts = {}, - }, - -- defaults for hover and signature help - documentation = { - view = "hover", - ---@type NoiceViewOptions - opts = { - lang = "markdown", - replace = true, - render = "plain", - format = { "{message}" }, - win_options = { concealcursor = "n", conceallevel = 3 }, - }, - }, - }, - markdown = { - hover = { - ["|(%S-)|"] = vim.cmd.help, -- vim help links - -- ["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links - }, - highlights = { - ["|%S-|"] = "@text.reference", - ["@%S+"] = "@parameter", - ["^%s*(Parameters:)"] = "@text.title", - ["^%s*(Return:)"] = "@text.title", - ["^%s*(See also:)"] = "@text.title", - ["{%S-}"] = "@parameter", - }, - }, - health = { - checker = true, -- Disable if you don't want health checks to run - }, - ---@type NoicePresets - presets = { - -- you can enable a preset by setting it to true, or a table that will override the preset config - -- you can also add custom presets that you can enable/disable with enabled=true - bottom_search = false, -- use a classic bottom cmdline for search - command_palette = false, -- position the cmdline and popupmenu together - long_message_to_split = false, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. - ---@type NoiceConfigViews - views = {}, ---@see section on views - ---@type NoiceRouteConfig[] - routes = {}, --- @see section on routes - ---@type table - status = {}, --- @see section on statusline components - ---@type NoiceFormatOptions - format = {}, --- @see section on formatting - routes = { - { - view = "split", - filter = { cmdline = "G" }, - opts = { - enter = true, - render = "plain", - format = { "{message}" }, - replace = true, - close = { events = { "BufLeave" }, keys = { "q" } }, - }, - }, - { - view = "split", - filter = { cmdline = "Notifications" }, - opts = { - enter = true, - render = "plain", - format = { "{message}" }, - replace = true, - close = { events = { "BufLeave" }, keys = { "q" } }, - }, - }, - { view = "mini", filter = { cmdline = "w" } }, - { view = "mini", filter = { find = "Config Change Detected. Reloading..." } }, - { - view = "mini", - filter = { - any = { - { event = "msg_show", find = "lines yanked" }, - { event = "msg_show", find = "more lines" }, - { find = "laravel.sail." }, - { find = "Pattern not found" }, - { event = "msg_show", kind = "", find = "change;" }, - }, - }, - }, + progress = { enabled = false }, + hover = { enabled = false }, + signature = { enabled = false }, + message = { enabled = false }, + override = {}, }, + presets = {}, }, } diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua deleted file mode 100644 index 97f6d1f..0000000 --- a/lua/plugins/notify.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "rcarriga/nvim-notify", - config = function() - local notify = require "notify" - -- this for transparency - notify.setup { background_colour = "#000000" } - -- this overwrites the vim notify function - vim.notify = notify.notify - end, -} diff --git a/lua/plugins/project-config.lua b/lua/plugins/project-config.lua deleted file mode 100644 index ffa32f1..0000000 --- a/lua/plugins/project-config.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "windwp/nvim-projectconfig", - enabled = false, - config = true, -} diff --git a/lua/plugins/rest.lua b/lua/plugins/rest.lua deleted file mode 100644 index b716eec..0000000 --- a/lua/plugins/rest.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "NTBBloodbath/rest.nvim", - enabled = false, - dependencies = { "nvim-lua/plenary.nvim" }, - ft = "http", - config = function() - local rest_nvim = require "rest-nvim" - - rest_nvim.setup { - -- Open request results in a horizontal split - result_split_horizontal = false, - -- Skip SSL verification, useful for unknown certificates - skip_ssl_verification = false, - encode_url = false, - -- Highlight request on run - highlight = { - enabled = true, - timeout = 150, - }, - result = { - -- toggle showing URL, HTTP info, headers at top the of result window - show_url = true, - show_http_info = true, - show_headers = true, - }, - -- Jump to request line on run - jump_to_request = false, - env_file = ".env", - custom_dynamic_variables = {}, - yank_dry_run = true, - } - - vim.api.nvim_create_autocmd("FileType", { - pattern = "http", - callback = function() - local buff = tonumber(vim.fn.expand "", 10) - vim.keymap.set( - "n", - "hn", - rest_nvim.run, - { noremap = true, buffer = buff, desc = "Run near http request" } - ) - vim.keymap.set( - "n", - "hl", - rest_nvim.last, - { noremap = true, buffer = buff, desc = "Run last http resquest" } - ) - vim.keymap.set("n", "hp", function() - rest_nvim.run(true) - end, { noremap = true, buffer = buff, desc = "Preview http curl" }) - end, - }) - end, -} diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua index 6a48d93..b567341 100644 --- a/lua/plugins/rustaceanvim.lua +++ b/lua/plugins/rustaceanvim.lua @@ -2,4 +2,18 @@ return { 'mrcjkb/rustaceanvim', version = '^8', -- Recommended lazy = false, -- This plugin is already lazy + config = function() + vim.g.rustaceanvim = { + server = { + cmd = function() + local mason_ra = vim.fn.expand("~/.local/share/nvim/mason/bin/rust-analyzer") + if vim.fn.executable(mason_ra) == 1 then + return { mason_ra } + end + return { "rust-analyzer" } + end, + on_attach = require("pi.lsp.attach"), + }, + } + end, } diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index 6fa90e8..a9bbc93 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -28,6 +28,16 @@ return { layout = { preset = "telescope" }, focus = "list", }, + -- vim.ui.select: el preset `select` capa a max_width=100 y corta + -- líneas largas (p.ej. los comandos de cargo de rustaceanvim) + select = { + layout = { + layout = { + width = 0.8, + max_width = 200, + }, + }, + }, }, }, layout = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index aa17471..7469e17 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,147 +1,51 @@ return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - dependencies = { - 'RRethy/nvim-treesitter-endwise', - "nvim-treesitter/nvim-treesitter-textobjects", - 'nvim-treesitter/playground', - }, - event = { 'BufReadPre', 'BufNew', 'BufNewFile' }, - main = "nvim-treesitter.configs", - cmd = { - 'TSBufDisable', - 'TSBufEnable', - 'TSBufToggle', - 'TSConfigInfo', - 'TSDisable', - 'TSEditQuery', - 'TSEditQueryUserAfter', - 'TSEnable', - 'TSInstall', - 'TSInstallFromGrammar', - 'TSInstallInfo', - 'TSInstallSync', - 'TSModuleInfo', - 'TSToggle', - 'TSUninstall', - 'TSUpdate', - 'TSUpdateSync', - 'TSPlaygroundToggle', + { + -- Rama `main`: reescritura completa, es la única que soporta Neovim >= 0.12. + -- No soporta lazy-loading. + "nvim-treesitter/nvim-treesitter", + branch = "main", + lazy = false, + build = ":TSUpdate", + config = function() + require("pi.treesitter").setup() + end, }, - opts = { - endwise = { - enable = true, - disable = { "markdown", "markdown_inline" }, - }, - auto_install = true, - ensure_installed = { - "bash", - "blade", - "css", - "go", - "gomod", - "html", - "javascript", - "json", - "lua", - "luadoc", - "markdown", - "markdown_inline", - "typst", - "nix", - "org", - "php", - "php_only", - "phpdoc", - "query", - "rust", - "sql", - "svelte", - "typescript", - "twig", - "regex", - "vim", - "yaml", - "latex", - "python", - "dockerfile", - "cpp", - "elixir", - "erlang", - }, - highlight = { - enable = true, - disable = function(_, buf) - local ft = vim.bo[buf].filetype - return ft == "oil" or ft == "snacks_notif" - end, - additional_vim_regex_highlighting = { "org" }, - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Tiempo de actualización en milisegundos para la consulta del árbol. - persist_queries = false, -- Si se debe persistir las consultas entre sesiones. - }, - query_linter = { - enable = true, - use_virtual_text = true, - lint_events = {"BufWrite", "CursorHold"}, - }, - indent = { - enable = true, - disable = { "oil", "snacks_notif" }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@conditional.outer", - ["ic"] = "@conditional.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - }, - }, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - }, - config = function(plug, config) - local parser_config = require "nvim-treesitter.parsers".get_parser_configs() - parser_config.blade = { - install_info = { - url = "https://github.com/EmranMR/tree-sitter-blade", - files = {"src/parser.c"}, - branch = "main", - }, - filetype = "blade" - } - vim.filetype.add({ - pattern = { - ['.*%.blade%.php'] = 'blade', + { + "nvim-treesitter/nvim-treesitter-textobjects", + branch = "main", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter-textobjects").setup { + select = { + lookahead = true, + }, } - }) - -- Reuse markdown parser for plugin-specific scratch buffers. - vim.treesitter.language.register("markdown", "codecompanion") - vim.treesitter.language.register("markdown", "snacks_notif") - vim.treesitter.language.register("markdown", "oil") + local select = require "nvim-treesitter-textobjects.select" + local objects = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@conditional.outer", + ["ic"] = "@conditional.inner", + ["al"] = "@loop.outer", + ["il"] = "@loop.inner", + } - -- Some markdown injections generated by external plugins can point to - -- placeholder languages and crash parser injection resolution. - pcall(vim.treesitter.query.set, "markdown", "injections", "") + for lhs, query in pairs(objects) do + vim.keymap.set({ "x", "o" }, lhs, function() + select.select_textobject(query, "textobjects") + end, { desc = "Textobject " .. query }) + end + end, + }, - require(plug.main).setup(config); - end, + { + -- Se auto-inicializa desde su plugin/; en Neovim >= 0.9 no usa el sistema de + -- módulos de nvim-treesitter, así que funciona igual con la rama `main`. + "RRethy/nvim-treesitter-endwise", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + event = { "BufReadPre", "BufNewFile" }, + }, } diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua index fd105c5..649e69b 100644 --- a/lua/plugins/undotree.lua +++ b/lua/plugins/undotree.lua @@ -23,15 +23,4 @@ return { vim.g.undotree_WindowLayout = 2 end, }, - { - "folke/edgy.nvim", - optional = true, - opts = function(_, opts) - opts.left = opts.left or {} - table.insert(opts.left, { - title = "Undo Tree", - ft = "undotree", - }) - end, - }, } -- cgit v1.2.3