How do I suspend Vim to the background shell and return to it later?
<C-z> / :stop
Pressing in Vim sends it to the background of your shell session — just like suspending any Unix process.
Search Vim Tricks
Searching...<C-z> / :stop
Pressing in Vim sends it to the background of your shell session — just like suspending any Unix process.
z. / z-
Vim has scroll-positioning commands that come in two flavors: those that leave the cursor in the current column (zz, zt, zb) and those that also move the cursor
:center / :right / :left
Vim has built-in Ex commands to align text: :center, :right, and :left.
set winbar=%f
Neovim 0.
cs"(
The cs operator in vim-surround (change surrounding) swaps one pair of delimiters for another without touching the content inside.
set complete+=kspell
Adding kspell to the complete option makes and draw from the active spell word list — every word Vim considers correctly spelled.
set wildmode=longest:list,full
Setting wildmode=longest:list,full gives Vim a completion behavior similar to shells like bash and zsh.
:[range]normal @a
The :[range]normal @a command runs a recorded macro against every line in a given range.
macros #macros #registers #ex-commands #normal-mode #advanced
:set grepprg=rg\ --vimgrep\ --smart-case
By default, Vim's :grep command calls the system grep.
:set {option}^=value
Vim's :set option^=value operator prepends a value to the front of a list-style option, giving it the highest priority.
<C-g>U{motion}
By default, moving the cursor with arrow keys while in insert mode creates an undo break — meaning a subsequent u will undo only back to when you last moved,
:%s/\(prefix\)\@<=target/replacement/g
Vim's \@<= is a zero-width look-behind assertion.
:'<,'>right {width}
The :right Ex command right-aligns lines within a given column width by padding them with spaces on the left.
visual-mode #visual-mode #formatting #ex-commands #alignment
zug
When spell checking is active, pressing zg over a word adds it to your personal word list so Vim stops flagging it.
:set title
Enabling title tells Vim to update the terminal window's title bar with information about the current file.
:set cmdheight=2
The cmdheight option controls how many lines Vim reserves for the command-line area at the bottom of the screen.
:set infercase
The infercase option makes Vim's keyword completion smart about capitalization: it adapts each match to reflect the casing of the characters you've already type
:norm!
The :normal! command (abbreviated :norm!) executes a sequence of Normal mode keystrokes while completely ignoring user-defined mappings and abbreviations.
getreg()
The getreg({name}) function returns the content of any register as a string.
:silent!
The :silent! modifier runs an Ex command without displaying any output or error messages.