How do I open any split command's result in a new tab instead of a split window?
:tab {cmd}
Most commands that open a new window (:help, :split, :new, :terminal) open a horizontal split by default.
870 results for "it at"
:tab {cmd}
Most commands that open a new window (:help, :split, :new, :terminal) open a horizontal split by default.
<C-w>g<C-]>
Pressing g jumps to the definition of the tag under the cursor — just like — but opens the destination in a new horizontal split window.
:set formatoptions-=cro
By default, Vim continues the current comment leader when you press in insert mode or open a new line with o/O.
<C-u> (command line)
When you are typing a long Ex command on the : prompt and realise you've made a mistake, pressing erases everything from the cursor back to the beginning of the
command-line #command-line #ex-commands #editing #insert-mode
dp
In Vim's diff mode, dp (diff put) and do (diff obtain) are single-keystroke shorthands for :diffput and :diffget.
buffers-windows #diff #buffers-windows #editing #normal-mode
:g/pattern/.-1,.+1d
The :g (global) command normally operates on lines that match a pattern.
dv{motion}
In operator-pending mode — after typing an operator like d, y, or c but before the motion — you can press v, V, or to override the motion type to characterw
<C-o>{command}
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
:w !diff % -
The command :w !diff % - pipes the current buffer's contents to an external diff command that compares it against the saved file on disk.
buffers-windows #buffers-windows #ex-commands #editing #navigation
:spellrepall
After correcting a misspelled word with z= (or 1z= for the first suggestion), run :spellrepall to apply that same correction to every other occurrence of the id
zfap
Combining the fold-creation operator zf with the ap (around paragraph) text object gives you a quick way to collapse any paragraph into a single fold line.
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
vim.lsp.foldexpr()
Neovim 0.
:checkhealth {module}
:checkhealth {module} runs the health check only for the specified module, making it much faster than the full :checkhealth which interrogates every registered
command-line #neovim #diagnostics #debugging #plugins #health
:put =strftime('%Y-%m-%d')
The :put = command inserts the result of a Vimscript expression directly into the buffer as a new line.
:set wildoptions=pum
Setting wildoptions=pum tells Neovim to use its popup menu for command-line tab completion instead of the traditional horizontal wildmenu bar.
:set wildcharm=<Tab>
The wildcharm option designates a key that, when it appears inside a mapping, triggers wildmenu completion on the command line — just as if you had pressed in
:set grepprg=rg\ --vimgrep\ --smart-case
By default, Vim's :grep command calls the system grep.
:set wildmode=longest:full,full
The wildmode option controls what happens when you press in the command line.
<C-k>
Vim has a built-in digraph system that lets you type special characters using short two-character codes.