Results 1 to 1 of 1
Hello, I have vim 7.0.235 and am trying to map the arrow keys + ctrl to skip between words. I have the following lines in my .vimrc: " map the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-06-2007 #1
- Join Date
- Jul 2007
Problem mapping arrow keys in vim
I have vim 7.0.235
and am trying to map the arrow keys + ctrl to skip between words. I have the following lines in my .vimrc:
" map the F4 and F5 keys to move between words
:map <F4> b
:map <F5> w
:imap <F4> <C-O>b
:imap <F5> <C-O>w
" map ctrl+arrow keys to move between word
:map O1;5C w
:map O1;5D b
:imap O1;5C <C-O>w
:imap O1;5D <C-O>b
" map keys to insert at beginning of line
:imap <S-Left> <ESC>I
:imap <C-a> <Esc>I
now F4 and F5 work without a problem. the Ctrl+arrows works ok, however if I am in insert mode the cursor moves between words and escapes Insert mode.
The last 2 lines are just to try something else <S-Left> does not work whilst <C-a> does.
Does anyone have any tips on how to fix this, or any cues on what I am doing wrong.