Home Explore Blog CI



neovim

1st chunk of `runtime/doc/tabpage.txt`
969e25d90c648eae545fa20d3a98e8cac2a9a8f899c6d3ce0000000100000fa0
*tabpage.txt*   Nvim


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Editing with windows in multiple tab pages.		*tab-page* *tabpage*

The commands which have been added to use multiple tab pages are explained
here.  Additionally, there are explanations for commands that work differently
when used in combination with more than one tab page.

                                      Type |gO| to see the table of contents.

==============================================================================
1. Introduction						*tab-page-intro*

A tab page holds one or more windows.  You can easily switch between tab
pages, so that you have several collections of windows to work on different
things.

Usually you will see a list of labels at the top of the Vim window, one for
each tab page.  With the mouse you can click on the label to jump to that tab
page.  There are other ways to move between tab pages, see below.

Most commands work only in the current tab page.  That includes the |CTRL-W|
commands, |:windo|, |:all| and |:ball| (when not using the |:tab| modifier).
The commands that are aware of other tab pages than the current one are
mentioned below.

Tabs are also a nice way to edit a buffer temporarily without changing the
current window layout.  Open a new tab page, do whatever you want to do and
close the tab page.

							*tab-ID* *tabid* *tabpageid*
Each tab page has a unique identifier called the tab ID.  This identifier will
not change within a Vim session -- even when rearranging tabs.
|nvim_get_current_tabpage()| returns the tab ID and |nvim_list_tabpages()|
lists tab IDs in the order they're displayed.  Additionally, the tabs are
numbered from left to right starting at 1: this is the tab number returned by
|tabpagenr()|. However, the tab number may change when tabs are opened,
closed, or rearranged.  |nvim_tabpage_get_number()| converts a tab ID to a tab
number.


==============================================================================
2. Commands						*tab-page-commands*

OPENING A NEW TAB PAGE:

When starting Vim "vim -p filename ..." opens each file argument in a separate
tab page (up to 'tabpagemax').  See |-p|

A double click with the mouse in the non-GUI tab pages line opens a new, empty
tab page.  It is placed left of the position of the click.  The first click
may select another tab page first, causing an extra screen update.

This also works in a few GUI versions, esp. Win32.  But only when clicking
right of the labels.

In the GUI tab pages line you can use the right mouse button to open menu.
|tabline-menu|.

For the related autocommands see |tabnew-autocmd|.

:[count]tabe[dit]				*:tabe* *:tabedit* *:tabnew*
:[count]tabnew
		Open a new tab page with an empty window, after the current
		tab page. If [count] is given the new tab page appears after
		the tabpage [count] otherwise the new tab page will appear
		after the current one. >
		    :tabnew     " opens tabpage after the current one
		    :.tabnew    " as above
		    :+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

Title: Nvim Tab Pages: Introduction and Commands
Summary
This section of the Nvim documentation introduces tab pages, which allow you to organize windows into separate collections. It explains how to open new tab pages using commands like `:tabnew`, `:tabedit`, and `:tabfind`, as well as the `:tab` command to execute other commands in a new tab page. It also covers how tab IDs are assigned and accessed.