Reputation: 1280
I want to know what is required in .vimrc to achieve the following.
Consider the following situation:
Line 1 -> ABC DEF GHI
Line 2 -> JKL MNK OPQ
where A and J are both the beginning of each line, and I and Q are the end of those lines, respectively.
Case (1) Suppose that the cursor is in J. In order to move from J to I, I have to press a key k and a key $ in my current setting. I want to configure MacVim so that pressing a key h brings the cursor to I.
Case (2) Suppose that the cursor is in I. In order to move from I to J, I have to press a key j and a key 0 in my current setting. I want to configure MacVim so that pressing a key l ("el") brings the cursor to J.
Can anyone help?
Upvotes: 2
Views: 70
Reputation: 172520
You're looking for
:set whichwrap+=h,l
(But its help says this setting is not recommended, probably because it's against the original vi behavior and might break some macros and plugins.)
Upvotes: 3
Reputation: 195039
case(1): cursor J -> I
:
press ge
or gE
case(2): cursor I -> J
:
press w
or W
Upvotes: 4