vim.loader.enable() require("set") require("remap") require("autocmd") require("lazy_init") -- Cargar configuración de tipos de archivo pcall(require, 'filetype') -- Ignorar errores si filetype.lua no existe function ReplaceWordUnderCursor() local word = vim.fn.expand("") local replace = vim.fn.input("Replace \"" .. word .. "\" with: ") if replace ~= "" then vim.cmd("%s/\\V" .. word .. "/" .. replace .. "/g") end end vim.api.nvim_set_keymap("n", "r", ":lua ReplaceWordUnderCursor()", { noremap = true, silent = true }) function ReplacePhraseUnderCursor() -- Obtén la palabra o frase bajo el cursor en modo visual local phrase = vim.fn.input("Replace phrase: ") if phrase == "" then print("No phrase provided.") return end local replace = vim.fn.input("Replace \"" .. phrase .. "\" with: ") if replace ~= "" then vim.cmd("%s/\\V" .. vim.fn.escape(phrase, "/\\") .. "/" .. replace .. "/g") end end vim.api.nvim_set_keymap("n", "f", ":lua ReplacePhraseUnderCursor()", { noremap = true, silent = true }) vim.filetype.add({ extension = { yml = "ansible", yaml = "ansible", }, -- Puedes agregar otras asociaciones si es necesario }) vim.cmd([[ autocmd BufRead,BufNewFile *.yml,*.yaml set filetype=ansible ]]) require("catppuccin").setup({ flavour = "macchiato", -- Puedes elegir entre 'latte', 'frappe', 'macchiato', 'mocha' background = { light = "latte", dark = "macchiato", }, -- Otras configuraciones de Catppuccin... custom_highlights = function(colors) return { -- Personalizar DiagnosticWarn con un tono de rojo menos intrusivo DiagnosticWarn = { fg = colors.red6, -- Tono de rojo menos brillante bg = "NONE", bold = false, italic = false, }, DiagnosticVirtualTextWarn = { fg = colors.red6, bg = "NONE", italic = false, }, -- Opcional: Personalizar otros grupos de diagnóstico si lo deseas -- DiagnosticError = { -- fg = colors.red, -- bg = "NONE", -- bold = true, -- italic = false, -- }, -- DiagnosticInfo = { -- fg = colors.blue, -- bg = "NONE", -- bold = false, -- italic = false, -- }, -- DiagnosticHint = { -- fg = colors.cyan, -- bg = "NONE", -- bold = false, -- italic = false, -- }, } end, }) -- Aplicar el esquema de colores vim.cmd.colorscheme("catppuccin")