How do you use a macro to convert plain URLs to Markdown links?
qayiWi[<Esc>ea](<Esc>pa)<Esc>q
Record a macro that yanks the URL, wraps the text before it in brackets, and appends the URL in parentheses for Markdown link format.
272 results for ":q"
qayiWi[<Esc>ea](<Esc>pa)<Esc>q
Record a macro that yanks the URL, wraps the text before it in brackets, and appends the URL in parentheses for Markdown link format.
qa$bywdw0Pa <Esc>q
Record a macro that yanks the last word, deletes it, pastes it at the beginning of the line.
qa/true\|false\ncgn<C-r>=@"=='true'?'false':'true'\n<Esc>q
Record a macro using cgn with an expression register to toggle between true and false.
qaYp<C-a>q
Record a macro that yanks the current line, pastes it below, and increments the number with .
qaciWmyFunc(<C-r>")<Esc>q
Record a macro that changes the inner word, types the function name with opening paren, pastes the original word from the register, and closes the paren.
qa*Ncgn<C-r>=newName\n<Esc>q
Record a macro using * to search for the word under cursor, cgn to change the next match, type the new name.
[q / ]q
The vim-unimpaired plugin by Tim Pope provides bracket-pair mappings for navigating quickfix and location list entries: [q moves to the previous entry and ]q mo
:let @q='commands'
Macros in Vim are stored in registers as plain text.
:keeppatterns normal! @q<CR>
When you replay macros from Ex commands, Vim can overwrite @/ (the last search pattern) depending on what the macro does.
:'<,'>normal @q
The :'normal @q command runs macro q on every line of the visual selection.
:let @q = 'keystrokes'
You can assign a string directly to any register using :let, turning it into a macro instantly.
Q
In Neovim, the Q key is mapped to replay the last executed macro — the same as @@ in both Vim and Neovim.
:%normal @q
To apply a macro to every line in the file, use :%normal @q.
:@q
Most macro workflows focus on @q, which replays register q as normal-mode keystrokes.
:let @q .= 'j'
Re-recording a long macro just to add one extra keystroke is wasteful and error-prone.
:'<,'>norm @q
When you visually select lines and then type a : command, Vim automatically inserts ' (the visual range marks) into the command line.
qQ...q
When you record a macro into register q with qq.
:let @q .= "keys"
The string concatenation assignment :let @q .
:let @q = "dwelp"
Recording macros with q works well for simple sequences, but complex macros with special keys can be hard to get right in one take.
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
macros #macros #batch-editing #multi-file #ex-commands #workflow