<-- home

Vim tabs

Tab support is great asset of Vim. Being able to keep many projects opened concurrently, each one with its files and settings - without performance loss - is certainly a good incentive for one to want to keep they computer uptime high. Was thinking on that which I was impelled to wrote this post reviewing the key aspects of tabs.

Syntax

  • :tabs list all tabs;
  • :tabm n move the current tab to the n position;
  • :tabm move the current tab to the last position;
  • :tabn go to the next tab;
  • :tabp go to the previous window;
  • :tabclose n close a tab;
  • :tabclose close the current tab;
  • :tabonly close all other tabs;
  • :tab drop {file} open {file} in a new tab, or jump to a window/tab containing the file if there is one;
  • :tab split copy the current window to a new tab of its own;
  • 2 gt go to the second tab;
  • gT go to the previous tab;

Open files in tabs

vim -p file1 file2

Usage examples

Tabs are great places to work on small tasks that fall outside your normal work flow.

If you are working in a buffer with most folds open, you can keep a second tab page showing the buffer with all folds closed for an “at a glance summary”.

View Help Pages

:tab help foo

References

  1. http://vim.wikia.com/wiki/Quick_tips_for_using_tab_pages
  2. http://vim.wikia.com/wiki/Using_tab_pages

Comments are appreciated.