Wikia

Vim Tips Wiki

Changes: Automatically wrap left and right

Edit

Back to page

(formatting and some rewording)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 16: Line 16:
 
</pre>
 
</pre>
   
This causes the left and right arrow keys, as well as <tt>h</tt> and <tt>l</tt>, to wrap when used at beginning or end of lines. ( <tt>< ></tt> are the cursor keys used in normal and visual mode, and <tt>[ ]</tt> are the cursor keys in insert mode).
+
This causes the left and right arrow keys, as well as <code>h</code> and <code>l</code>, to wrap when used at beginning or end of lines. ( <code>< ></code> are the cursor keys used in normal and visual mode, and <code>[ ]</code> are the cursor keys in insert mode).
   
 
==References==
 
==References==

Latest revision as of 05:16, July 13, 2012

Tip 137 Printable Monobook Previous Next

created 2001 · complexity basic · author Brian Medley · version 6.0


By default, when pressing left/right cursor keys, Vim will not move to the previous/next line after reaching first/last character in the line. This can be quite annoying for new users. Fortunately this behaviour can be easily changed by putting this in your vimrc file:

set whichwrap+=<,>,h,l,[,]

This causes the left and right arrow keys, as well as h and l, to wrap when used at beginning or end of lines. ( < > are the cursor keys used in normal and visual mode, and [ ] are the cursor keys in insert mode).

ReferencesEdit

CommentsEdit

Around Wikia's network

Random Wiki