How do I create a fold from a visual selection?
zf (in visual mode)
In visual mode, pressing zf creates a manual fold from the selected lines.
Search Vim Tricks
Searching...zf (in visual mode)
In visual mode, pressing zf creates a manual fold from the selected lines.
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
s{char}{char} (vim-sneak)
vim-sneak provides a motion that lets you jump to any location specified by two characters.
vim-startify plugin
vim-startify provides a configurable start screen when you open Vim without a file.
vim-which-key plugin
vim-which-key displays a popup showing available key bindings as you type a prefix key.
:UndotreeToggle
The undotree plugin provides a visual tree representation of Vim's undo history.
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.