How do I open the current buffer in a new tab so I can view it independently?
:tab split
:tab split opens the current buffer in a brand new tab page, giving you a second independent view of the same file.
953 results for ":normal"
:tab split
:tab split opens the current buffer in a brand new tab page, giving you a second independent view of the same file.
:Inspect
When customizing a colorscheme or debugging unexpected syntax colors, it's difficult to know which highlight group to override.
:nnoremap <expr> {key} {expression}
The argument to any map command (:nmap, :inoremap, etc.
config #config #macros #insert-mode #normal-mode #ex-commands
42G
The 42G command jumps the cursor directly to line 42 in the current file.
*
The command searches forward for the exact word under the cursor, jumping to the next occurrence.
:m {address}
How it works The :m command (short for :move) moves one or more lines to after the specified address.
mA and 'A
Vim has two tiers of marks.
<C-v>{motion}$A
In visual block mode, pressing $ makes the right edge of the selection "ragged" — it extends to the real end of each line regardless of length.
:'<,'>w !{cmd}
The :'w !{cmd} command writes the visually selected lines to the stdin of an external shell command — without modifying the buffer.
g^ and g$
When wrap is on, long lines wrap visually across multiple screen lines.
g<C-]>
When a symbol (function, class, variable) is defined in multiple places, CTRL-] blindly jumps to the first match.
<C-w>H and <C-w>K
After opening a split you can dynamically reposition windows using H, J, K, and L.
buffers-windows #windows #buffers-windows #navigation #normal-mode
vim.keymap.del()
vim.
y/{pattern}<CR>
Any operator in Vim can take a search motion as its argument.
:set opfunc and g@
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
: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.
winsaveview() and winrestview()
When writing Vimscript functions or complex mappings that move the cursor, it is essential to restore the original view afterward so the user does not notice an
"1p and .
When you paste from a numbered register with "1p, Vim's dot command (.
"1p
Vim automatically stores your deletion history in numbered registers "1 through "9.
:for i in range(1,5) | put ='item '.i | endfor
Vimscript's for loop is available directly from Vim's command line and can be used to generate repetitive or parameterized text without a macro or external scri