Vim Tips Wiki
(shouldn't get rid of existing whichwrap settings)
(formatting and some rewording)
Line 6: Line 6:
 
|complexity=basic
 
|complexity=basic
 
|author=Brian Medley
 
|author=Brian Medley
|version=5.7
+
|version=6.0
 
|rating=9/5
 
|rating=9/5
 
|category1=
 
|category1=
Line 12: Line 12:
 
}}
 
}}
 
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>
 
set whichwrap+=<,>,h,l,[,]
 
set whichwrap+=<,>,h,l,[,]

Revision as of 07:15, 22 January 2011

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

References

Comments