Vim: How to Open Current Opened File in New Tab
In vim, you can open the current file in a new tab by utilizing :tabnew %.
Ally Piechowski · · 1 min read
In vim, one of the largest challenges is learning how to create, open, and manage buffers.
In vim, how do you open the currently opened file in a new tab?
The Command
In order to open the current file in a new tab, utilize tabnew like so:
:tabnew %
This utilizes the command :tabnew, in which opens a new tab with the argument
%, which expands to the currently selected buffer’s file.
The Keybind
You can move the window, rather than opening the file, with the following keybind:
ctrl-w T
It should be noted that rather than opening another pane of the file, it moves the open file to a new tab.
More Reading
Enter the following commands in vim to read more:
:help tabnew
:help registers