Vim Tips Wiki

Editing

Have focus on left tab after tabclose

1
  • The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit. If you are undoing an edit that is …
Latest revision Your text
Line 3: Line 3:
 
|previous=1332
 
|previous=1332
 
|next=1334
 
|next=1334
|created=2006
+
|created=September 19, 2006
 
|complexity=basic
 
|complexity=basic
 
|author=mz
 
|author=mz
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
By default when a tab is closed, if another tab is open to the right of the tab that was just closed, it will become the "in focus" or current tab. However, when editing quickly this does not provide symmetry with the <code>:tabopen</code> command, because the <code>:tabopen</code> command opens a new tab to the right, and the <code>:tabclose</code> does restore focus to the original tab upon closing. With the following command in the .vimrc file, when editing a file, if the user needs to do something quickly in a new tab, they can use a mapping to close it and return to the original tab.
+
By default when a tab is closed, if another tab is open to the right of the tab that was just closed, it will become the "in focus" or current tab. However, when editing quickly this does not provide symmetry with the <tt>:tabopen</tt> command, because the <tt>:tabopen</tt> command opens a new tab to the right, and the <tt>:tabclose</tt> does restore focus to the original tab upon closing. With the following command in the .vimrc file, when editing a file, if the user needs to do something quickly in a new tab, they can use a mapping to close it and return to the original tab.
   
 
<pre>
 
<pre>
Line 18: Line 18:
   
 
==Comments==
 
==Comments==
The following accomplishes the same as above, but if a tab is not being closed, will just call the <code>:q</code> command.
+
The following accomplishes the same as above, but if a tab is not being closed, will just call the <tt>:q</tt> command.
   
 
<pre>
 
<pre>
  Loading editor
Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above.

View this template