Is there a way to open vim in a new shell window or tab? I'm used to doing $ mate file
, which opens the file in a new window.
I prefer having one 'central shell' where I issue commands and edit files in other windows or tabs, as necessary. How do people normally open vim files locally?
To do this, click on the Buffers menu at the top and click the dotted line with the scissors. Otherwise you can just open a new tab from your terminal session and launch vi from there.
To split the vim screen horizontally, or open a new workspace at the bottom of the active selection, press Ctrl + w , followed by the letter 's' . In the example below, the left section has been split into two workspaces.
Switch between files Here, N is capital (Type SHIFT+n). Start editing the files as the way you do with Vim editor. Press 'i' to switch to interactive mode and modify the contents as per your liking. Once done, press ESC to go back to normal mode.
from inside vim, use one of the following
open a new window below the current one:
:new filename.ext
open a new window beside the current one:
:vert new filename.ext
You can do so from within vim, using its own windows or tabs.
One way to go is to utilize the built-in file explorer; activate it via :Explore
, or :Texplore
for a tabbed interface (which I find most comfortable).
:Texplore
(and :Sexplore
) will also guard you from accidentally exiting the current buffer (editor) on :q
once you're inside the explorer.
To toggle between open tabs, use gt
or gT
(next tab and previous tab, respectively).
See also Using tab pages on the vim wiki.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With