Closing tabpages
You can close a tabpage by:
- closing all of the windows within it, or
- using the :tabclose command
If you close all of the windows in a tabpage, the tabpage itself is closed — pretty intuitive.
You can also use the :tabclose command. :tabclose by itself will close the current tabpage, and :[count]tabclose — e.g. :2tabclose — can be used to close a tabpage by its number. One thing to keep in mind: just like :quit, :tabclose refuses to throw away a buffer with unsaved changes.
Try it! Work through the checklist below. Open a labeled tabpage and a blank one, close the blank one with :tabclose — you’ll land on the labeled tabpage beside it — then close the very first tabpage by its number, without even leaving the tabpage you’re standing on.