Tabs in vim

You can open several files in tabs from the command line with vim, just type:

vim -p file1 file2 file3

And each file specified on the command line will be opened in a new tab.

To open a file in a new tab inside vim use :tabe file

To close a tab do :tabc

You can quickly switch between tabs typing gt or gT in normal mode. To switch to a particular tab prepend the tab number to gt, i.e. type #gt, where #gt is the tab number.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: