Friday, March 09, 2007

Using Tabs in vim 7+

With above vim 7.0, it is possible to use the tabs in vim with a single console. Here are several basic vim tabs commands. (It works for vim and gvim either).

  • With the option -p in the command line, you can open the files in tabs style.
vim -p file1.c file2.h file3.txt
  • When you are already in vim, the following command will show all tabs.
:tabs
  • If you want to open a new tab when vim already on, use tabnew command
:tabnew filenew.txt
  • In order to rearrange the tab, use the command tabm n to put the the current to nth position, keep in mind that all tabs position are start from 0 rather than 1. the following command will set the current tab to the 4th. tabm without argument will move current tab to the last.
:tabm 3

No comments: