Up to now, we have learned that buffers are in-memory representations of files, and windows provide viewports that allow one or more buffers to be viewed at a time in splits. This brings us to the final concept in this section, Tabs.
Thinking back to our discussion about windows, we started with a single window, then added a few splits to create a layout. The collection of windows in the layout fills up the screen, and the full screen could be considered "a page of windows". Neovim allows you to define and switch between multiple pages of windows by organizing them into "tabs".
Here is a list of some of the more common tab-related commands.
Command | Action |
---|---|
:tabnew | edit a file in a new tab page |
:tab | create new tab when opening new window |
:tabs | list the tab pages and what they contain |
:tabclose | close current tab page |
:tabonly | close all tab pages except the current one |
:tabprevious | go to previous tab page |
:tabnext | go to next tab page |
:tabNext | go to previous tab page |
:tabmove | move tab page to other position |
:tabfirst | go to first tab page |
:tablast | go to last tab page |
:tabfind | find file in 'path', edit it in a new tab page |