How to open a new tab in vim ?
:tabnew
:tabedit
:tabnew or :tabedit alone will open a new tab with empty buffer
:tabnew filename or tabedit filename will load the file in new tab
How to open files in separate tabs at start-up?
The following will open the 4 files in 4 separate tabs.
$ vim -p file1 file2 file3 file4
How to move between tabs ?
:tabnext (or :tabn)
:tabprevious (or :tabp)
or use gt in normal mode (Go to the next tab page. Wraps around from the last to the first one.)
:tabfirst (jump to the first tab)
:tablast (jump to the last tab)
:tabrewind
vim numbers the tabs from 0. So
:tabmove 2 (or :tabm 2)
will move to the 3rd tab.
Operation on all tabs ?
Now if you need to do a "search and replace" on all the tabbed files you have opened, tabdo will help you.
e.g. if you want to replace unit16 with unit32 in all the tabs
:tabdo %s/unit16/unit32/g
How to close tab(s)?
:tabclose (Close current tab page)
:tabonly (Close all other tab pages)
Help ?
For more on vim tab feature help
:help tab-page-intro
Also help page from vimdoc
