Reputation: 3455
I want to move one word forward in insert mode.
Why this doesn't work:
inoremap ,w <esc>w
But this works(back one word):
inoremap ,b <esc>b
Upvotes: 0
Views: 236
Reputation: 172510
That's because when the cursor is at the beginning of a word, the <Esc>
will move the cursor one character left (this is a bit unintuitive, but default vi behavior), and the w
will only move to the original position.
This should work:
inoremap ,w <esc>ww
I don't particularly like your mappings:
,
adds a delay whenever you type a comma<Esc>b
achieves the same and also is two keystrokes (many users remap the <Esc>
key to be in a less cumbersome position)<C-Left>
/ <C-Right>
.Upvotes: 3