How do I open any split command's result in a new tab instead of a split window?
Answer
:tab {cmd}
Explanation
Most commands that open a new window (:help, :split, :new, :terminal) open a horizontal split by default. Prefixing any of these with :tab redirects the result into a brand-new tab page instead. This is a general modifier that works across almost any window-creating command.
How it works
:tabis a command modifier, not a standalone command.- It intercepts any window-opening operation and opens the result in a new tab page.
- The modifier works with built-in commands and most plugin commands that call
:splitor:newinternally.
Example
Open help in a new tab instead of a split:
:tab help registers
Other useful combinations:
:tab split " open current buffer in a new tab (same as <C-w>T)
:tab new " new empty buffer in a new tab
:tab split filename " open a file in a new tab
:tab Man git " open man page in a new tab (Neovim)
Tips
- You can use a count:
:0tab help topicopens the tab at the leftmost position. - Combine with
:verticalfor Neovim's:terminal::tab terminalopens a terminal in a new tab. - If you always want help in a tab, add to your config:
cnoreabbrev help tab help. :tab drop filenameopens the file in a new tab only if it is not already open in another tab.