:+tabnew " opens tabpage after the next tab page
" note: it is one further than :tabnew
:-tabnew " opens tabpage before the current
:0tabnew " opens tabpage before the first one
:$tabnew " opens tabpage after the last one
:[count]tabe[dit] [++opt] [+cmd] {file}
:[count]tabnew [++opt] [+cmd] {file}
Open a new tab page and edit {file}, like with |:edit|.
For [count] see |:tabnew| above.
:[count]tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind*
Open a new tab page and edit {file} in 'path', like with
|:find|. For [count] see |:tabnew| above.
:[count]tab {cmd} *:tab*
Execute {cmd} and when it opens a new window open a new tab
page instead. Doesn't work for |:diffsplit|, |:diffpatch|,
|:execute| and |:normal|.
If [count] is given the new tab page appears after the tab
page [count] otherwise the new tab page will appear after the
current one.
Examples: >
:tab split " opens current buffer in new tab page
:tab help gt " opens tab page with help for "gt"
:.tab help gt " as above
:+tab help " opens tab page with help after the next
" tab page
:-tab help " opens tab page with help before the
" current one
:0tab help " opens tab page with help before the
" first one
:$tab help " opens tab page with help after the last
" one
CTRL-W gf Open a new tab page and edit the file name under the cursor.
See |CTRL-W_gf|.
CTRL-W gF Open a new tab page and edit the file name under the cursor
and jump to the line number following the file name.
See |CTRL-W_gF|.
CLOSING A TAB PAGE:
Closing the last window of a tab page closes the tab page too, unless there is
only one tab page.
Using the mouse: If the tab page line is displayed you can click in the "X" at
the top right to close the current tab page. A custom |'tabline'| may show
something else.
*:tabc* *:tabclose*
:tabc[lose][!] Close current tab page.
This command fails when:
- There is only one tab page on the screen. *E784*
- When 'hidden' is not set, [!] is not used, a buffer has
changes, and there is no other window on this buffer.
Changes to the buffer are not written and won't get lost, so
this is a "safe" command. >
:tabclose " close the current tab page
:{count}tabc[lose][!]
:tabc[lose][!] {count}
Close tab page {count}. Fails in the same way as `:tabclose`
above. >
:-tabclose " close the previous tab page
:+tabclose " close the next tab page
:1tabclose " close the first tab page
:$tabclose " close the last tab page
:tabclose -2 " close the 2nd previous tab page
:tabclose + " close the next tab page
:tabclose 3 " close the third tab page
:tabclose $ " close the last tab page
:tabclose # " close the last accessed tab page
When a tab is closed the next tab page will become the current one. This
behaviour can be customized using the 'tabclose' option.
*:tabo* *:tabonly*
:tabo[nly][!] Close all other tab pages.
When the 'hidden' option is set, all buffers in closed windows
become hidden.
When 'hidden' is not set, and the 'autowrite' option is set,
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
given, then they become hidden. But modified buffers are
never abandoned, so changes cannot get lost. >
:tabonly " close all tab pages except the current one
:tabo[nly][!] {count}
Close all tab pages except {count} one. >
:.tabonly " as above
:-tabonly " close all tab pages except the previous
" one
:+tabonly " close all tab pages except the next one
:1tabonly " close all tab pages except the first one
:$tabonly " close all tab pages except the last one
:tabonly - " close all tab pages except the previous
" one