FANDOM


(Move categories to tip template)
(Minor rewording, and added tt tags around the keystrokes to make them more obvious in the explanation.)
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
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:
+
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:
   
 
<pre>
 
<pre>
Line 18: Line 18:
 
</pre>
 
</pre>
   
This causes the cursorkeys, as well as h and l, to wrap, when used at beginning and end of lines (the &lt;&gt; and [] differ in that &lt;&gt; are the cursorkeys used in normal and visual mode, and the [] are the cursorkeys in insert mode).
+
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>&lt; &gt;</tt> are the cursor keys used in normal and visual mode, and <tt>[ ]</tt> are the cursor keys in insert mode).
   
 
==References==
 
==References==

Revision as of 11:37, June 1, 2008

Tip 137 Printable Monobook Previous Next

created October 14, 2001 · complexity basic · author Brian Medley · version 5.7


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).

References

Comments

Community content is available under CC-BY-SA unless otherwise noted.