This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- User commands to control native LSP (Neovim 0.12+) | |
| -- Replace :LspInfo, :LspRestart, :LspStop, etc. that used to be provided by nvim-lspconfig | |
| -- | |
| -- :LspList → clients attached to the current buffer | |
| -- :LspInfo → :checkhealth vim.lsp (the official replacement for LspInfo) | |
| -- :LspLog → opens the LSP log in a new tab | |
| -- :LspStop [name] → stops clients (! to force) | |
| -- :LspStart → re-triggers autostart on the current buffer | |
| -- :LspRestart [name] → restarts clients and re-attaches the buffers | |
| -- :LspCapabilities → inspect the server's capabilities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Comands: | |
| -- | |
| -- SqlExecute: Ejecuta una sentencia sql | |
| -- SqlDescribe: Descripción de tablas | |
| -- SqlShowIndexes: Muestra las índices de una tabla | |
| -- SqlShowCreateTable: Muestra el CREATE TABLE | |
| -- SqlShowTables: Muestra las tablas | |
| -- Executes a sql query, retuns result | |
| local function execute_sql(sql, extra_params) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- markdown_to_pdf.lua | |
| -- Generates a PDF from a Markdown file in two steps: | |
| -- 1. Markdown -> HTML with pandoc (with embedded CSS) | |
| -- 2. HTML -> PDF with Google Chrome in headless mode | |
| -- The intermediate HTML file is deleted at the end, leaving only the PDF. | |
| -- | |
| -- Usage: :MarkdownToPDF (converts the current buffer) | |
| -- :MarkdownToPDF path.md (converts the given file) | |
| -- | |
| -- Requires Neovim 0.10+ (uses vim.system). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Get work hours, read from markdown files in ./logs folder | |
| -- | |
| -- example: | |
| --- | |
| -- --- | |
| -- date: 2026-05-12 | |
| -- summary: some work summary here | |
| -- hours: 3 | |
| -- --- | |
| -- usage: :GetWorkLogInLogFolder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- use: | |
| -- | |
| -- require("ascii_box").setup() | |
| local M = {} | |
| --- Genera una tabla ASCII alrededor del texto dado | |
| --- @param lines string[] Lista de líneas de texto | |
| --- @return string[] Líneas con la caja ASCII | |
| function M.make_box(lines) | |
| -- Encontrar el ancho máximo para que todas las líneas encajen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------------------------------------- | |
| -- text-case | |
| -- https://github.com/johmsalas/text-case.nvim#setup | |
| ---------------------------------------------------- | |
| vim.pack.add({ | |
| "https://github.com/johmsalas/text-case.nvim", | |
| }) | |
| local textcase = require("textcase") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- tldr.lua | |
| -- Neovim command to browse tldr-pages cheatsheets directly from the editor | |
| -- save as ~/.config/nvim/lua/tldr.lua | |
| -- load with: require("tldr") | |
| -- Commands: | |
| -- :Tldr | |
| -- :Tldr <topic> | |
| vim.api.nvim_create_user_command("Tldr", function(args) | |
| if args.args == "" then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- cht_sh.lua | |
| -- Neovim command to query cht.sh cheatsheets from within the editor | |
| -- save as ~/.config/nvim/lua/cht_sh.lua | |
| -- load with: require("cht_sh") | |
| -- Commands: | |
| -- :Cht | |
| -- :Cht <topic> | |
| vim.api.nvim_create_user_command("Cht", function(args) | |
| if args.args == "" then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- save in lua/auto_calculate.lua | |
| -- load in your init file with `require("auto_calculate")` | |
| -- Shows math expression results as virtual text at the end of each line. | |
| -- Works in markdown files. | |
| -- | |
| -- Example: | |
| -- "2 * (20 + 1)" → displays "= 42" | |
| -- "- 100 / 3" → displays "= 33.333333" (markdown list item) | |
| -- "3 + cos(3)" → displays "= 2.0100075" (using sandboxed math functions) | |
| -- "hello world" → no virtual text (not a math expression) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- automatically reload configuration on change | |
| hs.loadSpoon("ReloadConfiguration") | |
| spoon.ReloadConfiguration:start() | |
| -- cmd + alt + v types the clipboard contents as keystrokes | |
| hs.hotkey.bind({ "cmd", "alt" }, "V", function() | |
| hs.eventtap.keyStrokes(hs.pasteboard.getContents()) | |
| end) | |
| -- move windows like Rectangle app using https://www.hammerspoon.org/Spoons/WindowHalfsAndThirds.html |
NewerOlder