Open files in tab

# Open files in tabs from shell
$ vim -p file1 file2 ... fileN
# Open files in new tab
:tabedit file1 file2 ... fileN
:tabe file1 file2 ... fileN

# Open file from explore to a new tab
:Texplore
:Te

# Open a split screen to new tab
<Ctrl-W> + <Shift-T>

# Close tab
:tabclose
:tabc

# Close all other tabs except current one
:tabonly
:tabo

Navigating in tab

# List tabs
:tabs

# Go to next tab
:tabnext
:tabn
gt
<Ctrl> + <PgDn>

# Go to previous tab
:tabprevious
:tabp
gT
<Ctrl> + <PgUp>

# Go to first tab
:tabfirst
:tabfir

# Go to last tab
:tablast
:tabl

# Go to tab N (first tab is N=1)
N + gt

# Go to previous N tab from current tab
N + gT

Moving tab

# Move tab to first
:tabm 0

# Move tab to last
:tabm

# Move tab to position N+1
:tabm N

# Move tab N position forward
:tabm +N

# Move tab N position backward
:tabm -N

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *