Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 38e486b2fb
Fetching contributors…

Cannot retrieve contributors at this time

82 lines (69 sloc) 2.819 kb
<h3 id="navigating-tabs">Navigating Tabs</h3>
<p>You want to group your windows into multiple, logical groups.</p>
<p>When you have a lot of open windows/buffers it can be tricky to navigate
between them. Often it makes more sense to group them into logical
<i>tabs</i>, so you can switch between them easier, and operate on them as a
<p>For example, if you were using Vim to edit a website, you may have your CSS
files open in one tab, the HTML files in another, and a HTML reference guide
in the third. </p>
<p>Use <i>tabs</i>.</p>
<td><tt>:tabedit <var>[file]</var></tt></td>
<td>Open a new tab. If the optional file is supplied, that file is opened
in the new tab.</td>
<td>Close the current tab.</td>
<td><tt>:tabnext <var>n</var></tt></td>
<td rowspan="2">Go to next tab, or the <var>n</var><sup>th</sup></td>
<td>Show a list of the open tabs.</td>
<td><tt>:tabprevious <var>n</var></tt></td>
<td rowspan="2">Go to previous tab, or the <var>n<sup>th</sup></var></td>
<td><tt>:tabdo <var>cmd</var></tt></td>
<td>Executes <var>cmd</var> in each open tab, aborting on the first
<p>You can use Vim's tabs like those in Firefox&#x00AE; and Opera&#x00AE;, by
opening one file in each tab, then switching between them. Vim enables you to
extend this concept, however, by allowing multiple files to be opened in the
same tab.</p>
<p>When you open a tab, a <i>tabline</i> appears along the top of the screen,
which lists the open tabs. In GVim you can switch to another tab, close
existing tabs, and open new tabs, by clicking the tabline with the mouse.</p>
<p>You can either cycle through open tabs using <kbd>gt</kbd>, or go directly
to a specific tab by prefixing <kbd>gt</kbd> with its number. Tabs are
numbered starting with 1, so to switch to the 3<sup>rd</sup> tab on the
tabline, say, you'd use <kbd>3gt</kbd>. If you have a lot of tabs, their
numbers may not be obvious. In this case, use <tt>:tabs</tt> to find them.</p>
<p>The power of tabs comes from executing commands on the windows they contain
as a logical group. Continuing the above example, this would let you perform a
<a href="#searching-and-replacing">search and replace</a> all HTML files. For
example, if you were in the HTML tab, you could say <tt>:tabdo
s/&lt;foo&gt;/&lt;bar&gt;/g</tt>, and all of your HTML files would have
their &lt;foo&gt;s replaced with &lt;bar&gt;s.</p>
Jump to Line
Something went wrong with that request. Please try again.