How do I open all listed buffers as separate tabs at once?
:tab ball
:tab ball (short for :tab sball, "split all buffers in tabs") opens every listed buffer in its own tab page in a single command.
Search Vim Tricks
Searching...:tab ball
:tab ball (short for :tab sball, "split all buffers in tabs") opens every listed buffer in its own tab page in a single command.
:vimgrep // **/*.txt
Using // (an empty pattern) in :vimgrep tells Vim to reuse the last search pattern.
o and O
In visual-block mode (), pressing o moves the cursor to the diagonally opposite corner of the selection, and O moves it to the other end of the same row (flippi
zl
When nowrap is set and lines extend beyond the screen width, Vim provides dedicated horizontal scroll commands.
:/pattern1/,/pattern2/
Ex command ranges in Vim are not limited to line numbers and marks — you can use /pattern/ as a range boundary to select lines between any two matching patter
g~~
Vim has three case-change operators that work like any other operator — you can combine them with motions, text objects, or double them to act on the whole li
visual-mode #editing #visual-mode #normal-mode #text-objects
:argdo %s/old/new/g | w
:argdo {cmd} executes an Ex command against every file in the argument list—the set of files you opened Vim with or set explicitly with :args.
let @q = 'keystrokes'
Macros recorded with q{register} are stored in registers and lost when Vim exits.
/colour\%[s]
Vim's \%[.
<C-v>jjI
Visual block mode () lets you select a rectangular region across lines.
"1p
Vim automatically stores your deletion history in numbered registers "1 through "9.
:sbuffer {N}
:sbuffer {N} opens buffer number N in a new horizontal split, leaving your current window untouched.
buffers-windows #buffers-windows #buffers #windows #navigation
{N}@q
Prefix a macro invocation with a count to execute it up to N times in a single command.
\c
Vim lets you embed \c or \C directly inside a search pattern to control case sensitivity for that search only, regardless of your 'ignorecase' and 'smartcase' s
g'{mark}
Vim's standard mark-jump commands ('a, ` a `) always add the current position to the jumplist before leaping to the mark.
:s/pattern/\=expr/g
Vim's :s command normally replaces matches with a literal string.
command-line #search #editing #ex-commands #command-line #registers
:let @q = substitute(@q, 'old', 'new', 'g')
When a recorded macro has a typo or needs a small tweak, re-recording the entire thing is error-prone.
]q
The vim-unimpaired plugin (by Tim Pope) provides a consistent [x / ]x mnemonic for navigating any list-like structure in Vim.
:let @q = "dd"
Macros are just strings stored in named registers.
<C-w><C-^>
Press (Ctrl+W followed by Ctrl+6) to open the alternate file in a horizontal split.