How do I get an enhanced status line with vim-airline?
Plug 'vim-airline/vim-airline'
vim-airline provides a beautiful, feature-rich status line that shows file info, git branch, diagnostics, and more with minimal configuration.
Plug 'vim-airline/vim-airline'
vim-airline provides a beautiful, feature-rich status line that shows file info, git branch, diagnostics, and more with minimal configuration.
<C-n> to select (vim-visual-multi)
vim-visual-multi provides VS Code-style multiple cursor support for Vim.
:vimgrep /pattern/ **/*.py
By specifying a file glob pattern with :vimgrep, you can restrict the search to specific file types.
/pattern\{-}
The \{-} quantifier in Vim regex matches as few characters as possible, unlike which matches as many as possible (greedy).
auto-pairs plugin
auto-pairs automatically inserts closing brackets, parentheses, and quotes when you type the opening one.
<C-r>{reg} in command line
While on the : command line, pressing followed by a register name inserts that register's contents.
"+yy
The "+yy command yanks the current line directly to the system clipboard register, making it available for pasting in other applications.
:set shortmess-=S
The shortmess option controls which messages are shortened.
"# register
The # register contains the name of the alternate file — the previously edited file in the current window.
:let @b = @a
The :let @b = @a command copies the contents of register a into register b.
"adiw
The "adiw command deletes the inner word under the cursor and stores it in register a.
qa f,ldt,F(p q
This macro swaps two comma-separated arguments inside parentheses by cutting the second argument and placing it before the first.
u after macro (single undo)
When a macro makes multiple changes, a single u undoes the entire macro as one unit.
qaI<li><Esc>A</li><Esc>jq
This macro wraps each line in tags by inserting the opening tag at the start and appending the closing tag at the end.
Paste with "ap and execute keys manually
To debug a macro, paste its contents into the buffer, read each keystroke, and execute them one at a time to find where the macro goes wrong.
qaI"<Esc>A": "",<Esc>jq
This macro transforms a plain word into a JSON key-value pair format, useful for converting lists of field names into JSON structure.
qaciw"<C-r>""<Esc>wq
This macro wraps the current word in double quotes by changing the word, inserting quotes around the original content, and moving to the next word.
qaA;<Esc>jq
This macro appends a semicolon to the current line and moves down, ready to repeat.
qaI// <Esc>jq
This macro adds a // comment prefix to the beginning of the current line and moves down.
qa I1. <Esc>j q
This simple macro inserts a list number prefix at the beginning of each line.