What is the difference between the star register and the plus register?
"*p vs "+p
How it works Vim has two system clipboard registers that interact with the operating system: " -- the selection register (PRIMARY selection on Linux/X11, clipbo
"*p vs "+p
How it works Vim has two system clipboard registers that interact with the operating system: " -- the selection register (PRIMARY selection on Linux/X11, clipbo
:set backupdir=~/.vim/backup// directory=~/.vim/swap//
How it works By default, Vim creates backup files (ending in ~) and swap files (ending in .
:set autowriteall and autocmd FocusLost * silent! wa
How it works Vim can be configured to automatically save your files when you switch to another window or application.
/<C-r>0
How it works After yanking text, you can use it directly as a search pattern by inserting the yank register contents into the search prompt.
:set ignorecase smartcase
How it works By setting both ignorecase and smartcase, Vim uses an intelligent case sensitivity rule for searches: If your search pattern is all lowercase, the
:set showmatch
How it works The :set showmatch option makes Vim briefly jump the cursor to the matching opening bracket when you type a closing bracket.
:<C-r>a
How it works While typing an Ex command on the command line (after pressing :), you can insert the contents of any register by pressing Ctrl-R followed by the r
:{line}put {register}
How it works The :put Ex command pastes the contents of a register after a specified line.
/\%>5c\%<20cpattern
How it works Vim's search patterns support column position constraints using the \%c family of atoms.
:set mouse=a
How it works The :set mouse=a command enables mouse support in all Vim modes.
:%s/\<word\>/replacement/g
How it works In Vim's regular expressions, \ are word boundary anchors: \ matches the end of a word.
"add
How it works When you delete text in Vim with commands like dd, dw, or x, the deleted text goes into the unnamed register and the numbered registers (1-9).
:iabbrev {abbr} {expansion}
How it works The :iabbrev command creates abbreviations that automatically expand when you type them in insert mode.
\zs and \ze
How it works Vim's \zs (set start) and \ze (set end) atoms let you define which portion of a pattern counts as the actual match, even though the full pattern is
:m {address}
How it works The :m command (short for :move) moves one or more lines to after the specified address.
:set wrap! or :set nowrap
How it works By default, Vim wraps long lines that extend past the window width, displaying them across multiple screen lines.
:g/pattern/t$
How it works The :g (global) command combined with :t (copy) lets you duplicate all lines matching a pattern to a specific location.
[I
How it works The [I command searches the current file (and included files) for the word under the cursor and displays a list of all matching lines with their li
:t {address}
How it works The :t command (short for :copy) copies one or more lines and places them below the specified address.
"ayy "byy "cyy
How it works Vim provides 26 named registers (a through z) that you can use as independent clipboards.