Tabs

Tabs are used to be able to view many web pages at the same time. Each tab contains exactly one buffer—multiple buffers per tab are not supported. As a result many buffer and tab commands are interchangeable.

Listing tabs

B :tabs :ls :files :buffers :buffers filter B

Show a list of buffers (=tabs) matching filter. Without filter list all tabs.

A buffer may be marked with one of the following indicators:

%
The current buffer
#
The alternate buffer for :e # and
:keepa :keepalt :keepalt cmd

Execute a command without changing the current alternate buffer.

Opening tabs

:tab :tab cmd

Execute cmd and tell it to output in a new tab. Works only for commands that support it, currently:

  • :tab addons
  • :tab downloads
  • :tab extoptions
  • :tab help
  • :tab javascript!
  • :tab preferences!
:window :wind :window cmd

Execute cmd and tell it to output in a new window. See :tab for the list of supported commands.

:tabdu :tabduplicate :counttabduplicate

Duplicate the current tab and switch to the duplicate. If count is given, duplicate the tab count times.

See opening for other ways to open new tabs.

Changing tabs

gb countgb

Repeat last :buffer! command. This is useful to quickly jump between buffers which have a similar URL or title.

gB countgB

Repeat last :buffer! command in reverse direction. Just like gb but in the other direction.

gt countgt

Go to the next tab. Cycles to the first tab when the last is selected. + If count is specified go to the countth tab.

]]> count<C-n>

Go to the next tab. Cycles to the first tab when the last is selected. + If count is specified go to the countth next tab.

gT]]> countgT

Go to the previous tab. Cycles to the last tab when the first is selected. + If count is specified go to the countth previous tab.

:bn :bnext :tn :tnext :tabn :tabnext :counttabnext count :counttnext count :countbnext count

Switch to the next or countth tab. Cycles to the first tab when the last is selected and count is not specified.

:bN :bNext :bp :bprevious :tN :tNext :tabN :tabNext :tp :tprevious :tabp :tabprevious :counttabprevious count :counttprevious count :counttabNext count :countbprevious count :countbNext count

Switch to the previous tab or go count tabs back. Wraps around from the first tab to the last tab.

]]> count<C-^>

Select the previously selected tab. This provides a quick method of toggling between two tabs. If count is specified, go to the countth tab.

b :b :buffer :countbuffer! url|index countb

Go to the specified buffer from the buffer list. Argument can be either the buffer index or the full URL. If count is given, go to the countth buffer.

If argument is neither a full URL nor an index but uniquely identifies a buffer, it is selected. With ! the next buffer matching the argument is selected, even if it cannot be identified uniquely. Use b as a shortcut to open this prompt.

If argument is #, the alternate buffer will be selected (see ).

If no argument is given the current buffer remains current.

g^ g0 :bf :bfirst :br :brewind :tabfir :tabfirst :tabr :tabrewind :tabrewind :tabfirst :brewind :bfirst g0 g^

Switch to the first tab.

g$ :bl :blast :tabl :tablast :tablast :blast g$

Switch to the last tab.

:tabde :tabdetach :tabdetach

Detach the current tab, and open it in its own window. As each window must contain at least one tab it is not possible to detach the only tab in a window. Use :tabduplicate to copy the tab then call :tabdetach.

:taba :tabattach :tabattach window-index tab-index

Attach the current tab to another window. {window-index} is an index into the list of open windows and tab-index is the index at which to insert the tab in the other window's tab list. If this is the last tab in a window, the window will be closed.

Reordering tabs

:tabm :tabmove :tabmove N :tabmove! +N | -N

Move the current tab to a position after tab N. When N is 0, the current tab is made the first one. Without N the current tab is made the last one. N can also be prefixed with "+" or "-" to indicate a relative movement. If ! is specified the movement wraps around the start or end of the tab list.

Closing tabs

d :tabc :tabclose :bun :bunload :bw :bwipeout :bd :bdelete :countbdelete! arg countd

Delete current buffer (=tab). If count is specified then count tabs are removed. Afterwards, the tab to the right of the deleted tab(s) is selected.

When used with arg, remove all tabs which contain arg in the hostname. ! forces this command to also search for arg in the full URL and also the title of the tab. Use with care.

D countD

Like d but selects the tab to the left of the deleted tab.

:tabo :tabonly :tabonly

Close all other tabs.

u :u :undo :countundo url countu

Undo closing of a tab. If a count is given, don't undo the last but the countth last closed tab. With url restores the tab matching the URL.

:undoa :undoall :undoall

Undo closing of all closed tabs. &liberator.host; stores up to 10 closed tabs, even after a browser restart.

Looping over tabs

:tabd :tabdo :bufd :bufdo :tabdo cmd

Execute cmd in each tab. cmd is executed in each tab starting with the first and ending with the last which becomes the current tab.

cmd should not alter the tab list state by adding, removing or reordering tabs.