diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2026-09-27 12:46:49 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2026-09-27 12:46:49 -0300 |
| commit | df7c711e2a49d51249350f52c63274b72aacb739 (patch) | |
| tree | 426da3b65371f857f3ee3d9893d7ff3279aac02e | |
| parent | a0bd84df02ce235123dfc939327e8bd33dffdd7e (diff) | |
| download | nvim-conf-df7c711e2a49d51249350f52c63274b72aacb739.tar.gz nvim-conf-df7c711e2a49d51249350f52c63274b72aacb739.zip | |
Migración de plugins a funcionalidad nativa: statusline y treesitter propios, se quitan mason, lualine, mini, notify y otros
46 files changed, 935 insertions, 1079 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index a1895a0..8ae6199 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,107 +1,70 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "ab5cf12ea8b8c8af82feb616bf7fbac096edc0e0" }, - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LazyVim": { "branch": "main", "commit": "459a4c3b1059671e766a46c7cc223827dc67e3d0" }, - "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, + "CopilotChat.nvim": { "branch": "main", "commit": "004ced055d8db59561cfcddc5f141ccd8d5a033b" }, "SmoothCursor.nvim": { "branch": "main", "commit": "12518b284e1e3f7c6c703b346815968e1620bee2" }, - "animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" }, "blink-cmp-latex": { "branch": "main", "commit": "4f2910b98dabed17a1667ab806354faa8763098e" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, - "buffer_manager.nvim": { "branch": "main", "commit": "a0ac2db39c8bd4a2b6ca897f38c88770f90d9323" }, "codecompanion-history.nvim": { "branch": "main", "commit": "bc1b4fe06eaaf0aa2399be742e843c22f7f1652a" }, - "codecompanion.nvim": { "branch": "main", "commit": "7cc35b7f7f08d093469fa9ae67d3af716bd729c3" }, - "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, + "codecompanion.nvim": { "branch": "main", "commit": "b9d31246b0646a775fa75e8a73d47698eba26129" }, "composer.nvim": { "branch": "main", "commit": "ec9537969adc7fc128cfe9c3a9925850455896c8" }, - "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "elixir-tools.nvim": { "branch": "main", "commit": "b51b48edc668924a6b2f6610f9a0aff34741d20e" }, - "firenvim": { "branch": "master", "commit": "af775c4a1cef5a1e833ae5c6d81afe229ceb639e" }, - "flutter-tools.nvim": { "branch": "main", "commit": "7d1acfd139215e02d2784733af69a61aaebe06e8" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" }, - "guihua.lua": { "branch": "master", "commit": "f8e06bd8a26dee3377d63c2adf1e57cdb58ac474" }, + "firenvim": { "branch": "master", "commit": "7456b09491337bb53d2146012e8d0c9858f04557" }, + "friendly-snippets": { "branch": "main", "commit": "30bfd475adadfd4f286f86168831348dfd8aecdc" }, + "gitsigns.nvim": { "branch": "main", "commit": "f2421c550618d257048afa650413d9e542ddbe67" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, - "icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, - "img-clip.nvim": { "branch": "main", "commit": "b6ddfb97b5600d99afe3452d707444afda658aca" }, - "indent-o-matic": { "branch": "master", "commit": "764da1f30b5bb4a49035c3abc9a586322296b812" }, - "json-nvim": { "branch": "master", "commit": "beb76a5ffa0a936677695bc82cc868654aad4398" }, - "laravel.nvim": { "branch": "main", "commit": "0c12031c8c049c423c6c31951beba721115ce6cc" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, - "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, - "markview.nvim": { "branch": "main", "commit": "e27dee8b2a61f89ac3a06deae0264ad1d3f7b62c" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21c5b3ebeaa0412e28096bb0701434c51c1fbf76" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "img-clip.nvim": { "branch": "main", "commit": "99848daf801789dbebe2192b475eb887d375002c" }, + "laravel.nvim": { "branch": "main", "commit": "587db9f2f272d141ed8aa45b122828262d800d89" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "mcphub.nvim": { "branch": "main", "commit": "7cd5db330f41b7bae02b2d6202218a061c3ebc1f" }, - "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, - "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, - "mini.diff": { "branch": "main", "commit": "05be51814a718e74244829754a2a900a430a8d8b" }, - "mini.icons": { "branch": "main", "commit": "ac38c983aed0a2bd32a65ca3e2348e12e58ca292" }, - "mini.nvim": { "branch": "main", "commit": "bf8169f3e518be8de3f88073ace37d91f576cb04" }, + "mini.diff": { "branch": "main", "commit": "626b8a5b93874c4d05ca25aedec56cfff0b378fb" }, + "mini.icons": { "branch": "main", "commit": "98faae31e9be1cc054ae63485e58ceb185efcad0" }, "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, - "minuet-ai.nvim": { "branch": "main", "commit": "d29dec4c36be2b41aa10e70938b7b09a03f0bdba" }, - "navigator.lua": { "branch": "master", "commit": "cdf118b21a2b7c05a6e8e6d57acbe7a41d4ea41b" }, + "minuet-ai.nvim": { "branch": "main", "commit": "3b0a4c5f97b7124d94302c608fbe01c0270d4fbe" }, "neogen": { "branch": "main", "commit": "23e7e9f883d01289ebd90e98025acc860ea26366" }, - "neorg": { "branch": "main", "commit": "1f14d72aad7165eac307a2a2f6be0fb97a04b3c2" }, - "neotest": { "branch": "master", "commit": "ad991822b7076b1d940b33a9d6d0d30416d5df81" }, + "neorg": { "branch": "main", "commit": "6fda795b0108c92840fd32db6d5dd54e7f997fa8" }, + "neotest": { "branch": "master", "commit": "27bf921498043f7ecd821d6db68d05de244bbd02" }, "neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" }, "neotest-plenary": { "branch": "master", "commit": "3523adcf9ffaad1911960c5813b0136c1b63a2ec" }, - "neotest-python": { "branch": "master", "commit": "e6df4f1892f6137f58135917db24d1655937d831" }, + "neotest-python": { "branch": "master", "commit": "1b56ca4ba51c6014f986d6548ee629bdc95589d1" }, "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "27681d797a26f1b4d6119296df42f5204c88a2dc" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "9a8b8a9aeb43382e5aaf49b00b7cfb5d42d32118" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, "none-ls-shellcheck.nvim": { "branch": "main", "commit": "0f84461241e76e376a95fb7391deac82dc3efdbf" }, - "none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "numb.nvim": { "branch": "master", "commit": "167fbbb8de5529eac4f66ef054c260636cd9af51" }, - "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "531771530d4f82ad2d21e436e3cc052d68d7aebb" }, + "none-ls.nvim": { "branch": "main", "commit": "c4b82bb63b13856ba4d6b971b7aad3bb38fc6fe2" }, + "nui.nvim": { "branch": "main", "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97" }, + "numb.nvim": { "branch": "master", "commit": "36260c446465b1303b0b1922c722904791bdb03f" }, + "nvim-autopairs": { "branch": "master", "commit": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "72a05f62c52241bc7441c820eb53946f92b2e6a4" }, + "nvim-dap": { "branch": "master", "commit": "c9a0738e45f1bd41d792a126941348dce661cf9b" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, - "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, + "nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-early-retirement": { "branch": "main", "commit": "3b05315a61c8f01bb893249f9e044fc359122c9d" }, - "nvim-lspconfig": { "branch": "master", "commit": "a683e0ddf0cf64c6cd689e18ffb480ade3c162b7" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-python-repl": { "branch": "main", "commit": "09e77dcb9b44e28062a754f8019003bb88fe9734" }, "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, - "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b311b30818951d01f7b4bf650521b868b3fece16" }, + "nvim-treesitter": { "branch": "main", "commit": "427e9222363d07c32d6db6169e4049c28d58d141" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f3061339b8eaf9fda873600bc425b8d2d8502533" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8fe8a95630f4f2c72a87ba1927af649e0bfaa244" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187" }, "nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" }, - "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, "oil-git-status.nvim": { "branch": "main", "commit": "a3e2ccb00cb8822115e28a9a1791eda051d940c9" }, "oil-image-preview.nvim": { "branch": "master", "commit": "a71eacc879e1264339a62019ee3c2ff376f2cc39" }, "oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, - "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, - "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, - "refactoring.nvim": { "branch": "master", "commit": "7eaa150061ea18fdbe18fbb924d236e3ddccc57d" }, - "rustaceanvim": { "branch": "master", "commit": "f69c85a955b9a83d495e3dc8d43adb6364a0b765" }, - "rustowl": { "branch": "main", "commit": "f7bdd868df2501acff029b2d85fa544ec66ef9b6" }, + "refactoring.nvim": { "branch": "master", "commit": "64e10d782ae5b9653558482910213b8946651456" }, + "rustaceanvim": { "branch": "main", "commit": "a968f5133b8b24f481de12f08cd79420d1ace559" }, "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, "spinner.nvim": { "branch": "main", "commit": "67ae7f64a6a7940be10c226301413521da26ea72" }, - "telescope.nvim": { "branch": "master", "commit": "9377230aa5305d9e9aca4ed8dadf1070fb4aa9fc" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, - "tree-sitter-norg": { "branch": "main", "commit": "d7edfaf89198aab652c7a1f0f818196efedaccfb" }, - "tree-sitter-norg-meta": { "branch": "main", "commit": "729d4e54fb881ba0ddf0f925ec78401354c7c6db" }, "treesj": { "branch": "main", "commit": "79aedb401bbdc7e4202f7881eab5f6feb2105b0a" }, "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, - "vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" }, - "vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" }, - "vim-eunuch": { "branch": "master", "commit": "e86bb794a1c10a2edac130feb0ea590a00d03f1e" }, "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, - "vim-jsdoc": { "branch": "master", "commit": "6e5bc2a1f98a69e4902081c9f5969b228a7a5fd6" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, - "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-test": { "branch": "master", "commit": "2676d84c6901e484df00b5d728bd6a345d47ee12" }, - "vimtex": { "branch": "master", "commit": "fedb7ffc1bebf254cc74e7419c3a5930b6719065" }, + "vimtex": { "branch": "master", "commit": "e355987594cbf16283bee7b37e3aa3a65d5e1c5c" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index ffb5d57..ccb9bd0 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -15,7 +15,6 @@ vim.api.nvim_create_autocmd("FileType", { "lspinfo", "spectre_panel", "startuptime", - "tsplayground", "PlenaryTestPopup", }, callback = function(event) @@ -162,6 +161,128 @@ vim.api.nvim_create_autocmd("User", { end, }) +-- Progreso LSP como notificación de snacks.notifier (reemplaza noice lsp.progress) +---@type table<number, {token:lsp.ProgressToken, msg:string, done:boolean}[]> +local lsp_progress = vim.defaulttable() +vim.api.nvim_create_autocmd("LspProgress", { + group = augroup "lsp_progress_notify", + ---@param ev {data: {client_id: integer, params: lsp.ProgressParams}} + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + local value = ev.data.params.value --[[@as {percentage?: number, title?: string, message?: string, kind: "begin" | "report" | "end"}]] + if not client or type(value) ~= "table" then + return + end + local p = lsp_progress[client.id] + + for i = 1, #p + 1 do + if i == #p + 1 or p[i].token == ev.data.params.token then + p[i] = { + token = ev.data.params.token, + msg = ("[%3d%%] %s%s"):format( + value.kind == "end" and 100 or value.percentage or 100, + value.title or "", + value.message and (" **%s**"):format(value.message) or "" + ), + done = value.kind == "end", + } + break + end + end + + local msg = {} ---@type string[] + lsp_progress[client.id] = vim.tbl_filter(function(v) + return table.insert(msg, v.msg) or not v.done + end, p) + + local spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" } + vim.notify(table.concat(msg, "\n"), vim.log.levels.INFO, { + id = "lsp_progress", + title = client.name, + opts = function(notif) + notif.icon = #lsp_progress[client.id] == 0 and " " + or spinner[math.floor(vim.uv.hrtime() / (1e6 * 80)) % #spinner + 1] + end, + }) + end, +}) + +-- Formatear/minificar JSON con jq (reemplaza json-nvim) +vim.api.nvim_create_autocmd("FileType", { + group = augroup "json_jq", + pattern = "json", + callback = function(event) + vim.keymap.set("n", "<leader>jff", ":%!jq .<CR>", { buffer = event.buf, desc = "Formatear JSON con jq" }) + vim.keymap.set("n", "<leader>jmf", ":%!jq -c .<CR>", { buffer = event.buf, desc = "Minificar JSON con jq" }) + end, +}) + +-- Cerrar buffers inactivos tras 120 min (reemplaza nvim-early-retirement) +local retirement_age_mins = 120 +local buf_last_used = {} +vim.api.nvim_create_autocmd("BufEnter", { + group = augroup "early_retirement", + callback = function(event) + buf_last_used[event.buf] = os.time() + end, +}) +local retirement_timer = assert(vim.uv.new_timer()) +retirement_timer:start( + 60000, + 60000, + vim.schedule_wrap(function() + local now = os.time() + for _, buf in ipairs(vim.api.nvim_list_bufs()) do + if + vim.api.nvim_buf_is_valid(buf) + and vim.bo[buf].buflisted + and not vim.bo[buf].modified + and #vim.fn.win_findbuf(buf) == 0 + then + local last = buf_last_used[buf] + if last == nil then + buf_last_used[buf] = now + elseif now - last > retirement_age_mins * 60 then + pcall(vim.api.nvim_buf_delete, buf, {}) + buf_last_used[buf] = nil + end + end + end + end) +) + +-- Detección simple de indentación (reemplaza indent-o-matic); editorconfig nativo tiene prioridad +vim.api.nvim_create_autocmd("BufReadPost", { + group = augroup "detect_indent", + callback = function(event) + local ec = vim.b[event.buf].editorconfig + if ec and (ec.indent_style or ec.indent_size) then + return + end + local tabs, spaces, min_spaces = 0, 0, math.huge + for _, line in ipairs(vim.api.nvim_buf_get_lines(event.buf, 0, 200, false)) do + local ws = line:match "^%s+" + if ws then + if ws:find "\t" then + tabs = tabs + 1 + else + spaces = spaces + 1 + if #ws > 1 and #ws < min_spaces then + min_spaces = #ws + end + end + end + end + if tabs > spaces then + vim.bo[event.buf].expandtab = false + elseif spaces > 0 and min_spaces ~= math.huge then + vim.bo[event.buf].expandtab = true + vim.bo[event.buf].shiftwidth = min_spaces + vim.bo[event.buf].softtabstop = min_spaces + end + end, +}) + -- vim.api.nvim_create_autocmd("User", { @@ -177,3 +298,17 @@ vim.api.nvim_create_autocmd("User", { -- end -- end, -- }) + +-- WezTerm no implementa el borrado de imágenes del protocolo kitty (snacks.image +-- usa el modo fallback sin placeholders), así que al salir de un buffer de imagen +-- quedan restos en pantalla. Forzar un repintado completo los limpia. +if vim.env.TERM_PROGRAM == "WezTerm" then + vim.api.nvim_create_autocmd("BufWinLeave", { + group = vim.api.nvim_create_augroup("wezterm_image_cleanup", { clear = true }), + callback = function(ev) + if vim.bo[ev.buf].filetype == "image" then + vim.schedule(function() vim.cmd "mode" end) + end + end, + }) +end diff --git a/lua/config/init.lua b/lua/config/init.lua index 5da196b..fe60f1f 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -7,6 +7,9 @@ require "config.options" local colorscheme = require "config.native-colorscheme" colorscheme.setup() +-- Statusline nativa (reemplaza lualine.nvim) +require("config.statusline").setup() + -- Additional UI Enhancements vim.opt.guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50" vim.opt.cursorline = true diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index c1e126e..00ef762 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -173,3 +173,54 @@ map("n", "<leader>ft", "<CMD>FloatermToggle<CR>", { desc = "run terminal" }) map({ "n", "v" }, "<C-a>", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true }) map({ "n", "v" }, "<LocalLeader>a", "<cmd>CodeCompanionChat Toggle<cr>", { noremap = true, silent = true }) map("v", "ga", "<cmd>CodeCompanionChat Add<cr>", { noremap = true, silent = true }) + +-- Historial de notificaciones (reemplaza :Noice history) +map("n", "<leader>nh", function() + Snacks.notifier.show_history() +end, { desc = "Historial de notificaciones" }) + +-- Abrir archivo/selección en el navegador (reemplaza vim-rhubarb :GBrowse) +map({ "n", "v" }, "<leader>go", function() + Snacks.gitbrowse() +end, { desc = "Git browse en el navegador" }) + +-- Picker de iconos/emoji (reemplaza icon-picker.nvim) +map("n", "<leader><leader>i", function() + Snacks.picker.icons() +end, { desc = "Insertar icono/emoji" }) +map("n", "<leader><leader>y", function() + Snacks.picker.icons { confirm = "yank" } +end, { desc = "Copiar icono/emoji" }) +map("i", "<C-o>", function() + Snacks.picker.icons() +end, { desc = "Insertar icono/emoji" }) + +-- Menú de acciones de Oil vía vim.ui.select (reemplaza menu.nvim) +map("n", "<leader>um", function() + local items = vim.tbl_filter(function(item) + return item.cmd ~= nil + end, require "menus.oil") + vim.ui.select(items, { + prompt = "Oil", + format_item = function(item) + return item.name .. (item.rtxt and " (" .. item.rtxt .. ")" or "") + end, + }, function(choice) + if choice then + choice.cmd() + end + end) +end, { desc = "Abrir menú de Oil" }) + +-- Animación de retipeo del buffer (antes plugin animation.nvim) +map("n", "<leader>AA", function() + require("pi.animations").redraw_buffer() +end, { desc = "Retype buffer animation" }) + +-- Buffers abiertos y navegación entre ellos (reemplaza buffer_manager.nvim, +-- roto en Neovim: usa el autocmd BufModifiedSet, que Vim soporta pero Neovim no implementa) +map("n", "<leader>o", function() + Snacks.picker.buffers() +end, { desc = "Buffers abiertos" }) +map("n", "]b", ":bnext<CR>", { desc = "Buffer siguiente" }) +map("n", "[b", ":bprevious<CR>", { desc = "Buffer anterior" }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 34e034f..89a14a8 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -13,7 +13,7 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup { -- leave nil when passing the spec as the first argument to setup() - spec = { { "LazyVim/LazyVim", import = "plugins" } }, + spec = { { import = "plugins" } }, local_spec = true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec. defaults = { -- Set this to `true` to have all your plugins lazy-loaded by default. diff --git a/lua/config/options.lua b/lua/config/options.lua index 2d80d08..1598c1c 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -103,8 +103,10 @@ opt.listchars = "tab:\\ ,trail:-" -- Siempre muestra la línea de estado. opt.laststatus = 3 --- Configura la altura del área de comandos. -opt.cmdheight = 1 +-- Sin fila de comandos: la cmdline la dibuja noice como popup centrado. +-- (Antes lo forzaba noice con messages activado; ahora lo seteamos nosotros.) +-- En firenvim no hay noice, así que ahí se mantiene la fila clásica. +opt.cmdheight = vim.g.started_by_firenvim and 1 or 0 -- Establece el tiempo de actualización en milisegundos. opt.updatetime = 50 diff --git a/lua/config/statusline.lua b/lua/config/statusline.lua new file mode 100644 index 0000000..c74d8d4 --- /dev/null +++ b/lua/config/statusline.lua @@ -0,0 +1,214 @@ +-- Statusline nativa (reemplaza lualine.nvim), con la paleta de config.native-colorscheme. +local M = {} + +local colors = require("config.native-colorscheme").colors + +local mode_names = { + n = "NORMAL", + no = "O-PENDING", + nt = "NORMAL", + v = "VISUAL", + V = "V-LINE", + ["\22"] = "V-BLOCK", + s = "SELECT", + S = "S-LINE", + ["\19"] = "S-BLOCK", + i = "INSERT", + R = "REPLACE", + Rv = "V-REPLACE", + c = "COMMAND", + cv = "EX", + r = "PROMPT", + ["r?"] = "CONFIRM", + ["!"] = "SHELL", + t = "TERMINAL", +} + +local mode_hl = { + n = "StlModeNormal", + i = "StlModeInsert", + v = "StlModeVisual", + V = "StlModeVisual", + ["\22"] = "StlModeVisual", + s = "StlModeVisual", + S = "StlModeVisual", + c = "StlModeCommand", + R = "StlModeReplace", + r = "StlModeReplace", + t = "StlModeTerminal", + ["!"] = "StlModeTerminal", +} + +function M.set_highlights() + local hl = function(name, fg, bg, bold) + vim.api.nvim_set_hl(0, name, { fg = fg, bg = bg, bold = bold ~= false }) + end + hl("StlModeIcon", colors.base4, colors.base03) + hl("StlModeNormal", colors.blue100, colors.base03) + hl("StlModeInsert", colors.green100, colors.base03) + hl("StlModeVisual", colors.magenta100, colors.base03) + hl("StlModeCommand", colors.yellow100, colors.base03) + hl("StlModeReplace", colors.red100, colors.base03) + hl("StlModeTerminal", colors.orange100, colors.base03) + hl("StlBranch", colors.orange100, colors.base03) + hl("StlDiffAdd", colors.green300, colors.base03) + hl("StlDiffChange", colors.yellow300, colors.base03) + hl("StlDiffDelete", colors.red300, colors.base03) + hl("StlFile", colors.yellow100, colors.base03) + hl("StlDiagError", colors.red300, colors.base03) + hl("StlDiagWarn", colors.yellow300, colors.base03) + hl("StlDiagInfo", colors.blue300, colors.base03) + hl("StlDiagHint", colors.cyan300, colors.base03) + hl("StlUpdates", colors.orange300, colors.bg_statusline, false) + hl("StlLsp", colors.base4, colors.base03) + hl("StlFt", colors.magenta100, colors.base03) + hl("StlProgress", colors.cyan100, colors.base03) + hl("StlSep", colors.base00, colors.base03, false) + hl("StlBg", colors.fg, colors.bg_statusline, false) +end + +-- Handlers de click (:h 'statusline' %@); globales porque %@ necesita un nombre simple. +function _G.StlClickFile() + Snacks.picker.files() +end + +function _G.StlClickDiag() + Snacks.picker.diagnostics() +end + +local function filename() + local name = vim.api.nvim_buf_get_name(0) + if name == "" then + return "[Sin nombre]" + end + local file = vim.fn.fnamemodify(name, ":t") + local parent = vim.fn.fnamemodify(name, ":h:t") + return parent .. "/" .. file +end + +local function git() + local out = {} + -- vim.b para el repo del buffer; vim.g como fallback (repo del cwd, ej. en oil) + local head = vim.b.gitsigns_head or vim.g.gitsigns_head + if head and head ~= "" then + out[#out + 1] = "%#StlBranch# " .. head + end + local status = vim.b.gitsigns_status_dict + if status then + if (status.added or 0) > 0 then + out[#out + 1] = "%#StlDiffAdd# " .. status.added + end + if (status.changed or 0) > 0 then + out[#out + 1] = "%#StlDiffChange# " .. status.changed + end + if (status.removed or 0) > 0 then + out[#out + 1] = "%#StlDiffDelete# " .. status.removed + end + end + if #out == 0 then + return "" + end + return table.concat(out) +end + +local diag_specs = { + { vim.diagnostic.severity.ERROR, "StlDiagError", " " }, + { vim.diagnostic.severity.WARN, "StlDiagWarn", " " }, + { vim.diagnostic.severity.INFO, "StlDiagInfo", " " }, + { vim.diagnostic.severity.HINT, "StlDiagHint", " " }, +} + +local function diagnostics() + local counts = vim.diagnostic.count(0) + local parts = {} + for _, spec in ipairs(diag_specs) do + local n = counts[spec[1]] + if n and n > 0 then + parts[#parts + 1] = "%#" .. spec[2] .. "#" .. spec[3] .. n + end + end + if #parts == 0 then + return "" + end + return "%@v:lua.StlClickDiag@" .. table.concat(parts, " ") .. "%X " +end + +local function lsp_clients() + local clients = vim.lsp.get_clients { bufnr = 0 } + if #clients == 0 then + return "No LSP" + end + local names = {} + for _, client in ipairs(clients) do + names[#names + 1] = client.name + end + return table.concat(names, ",") +end + +local function lazy_updates() |