I wonder if there's a way to make the Alt
(or another key) work like Ctrl-o
, but for as long as the key is pressed. For example, if you're in insert mode and want to move 10 lines down and 2 words forward, you could hold Alt
, press 10jww
and then release the Alt
key. It is much faster than pressing Ctrl-o
before each movement or leaving insert mode and having to enter it back again.
I did some remappings to use the main movement keys from insert mode while holding Alt
:
inoremap <A-h> <C-o>h
inoremap <A-j> <C-o>j
inoremap <A-k> <C-o>k
inoremap <A-l> <C-o>l
inoremap <A-w> <C-o>w
inoremap <A-e> <C-o>e
inoremap <A-b> <C-o>b
But that is limited, if I wanted to use numbers to move multiple steps for example, I would need to map a new key binding for each movement and for each number.
If it was possible to do something like enter normal mode on Alt
(keydown) and go back to insert on Alt
(keyup), then all normal mode key bindings should be available only by holding one key.
Alt
whilew
,e
,1
,2
,3
,4
and5
are easily reachable by my other fingers on the left hand and my right hand is free to pressh
,j
,k
,l
,b
, and the other numbers. Those would be the only important keys and I know that this mode wouldn't be worth to use with much longer key bindings. – PsychopathyAlt
, that's the main feature I'm looking for in them. I've just discovered how to make mappings that use count on this article, but looks likeAlt
adds an extra3
to the count, so if try to make it count 2 or 7 times, it ends up counting 23 or 73 times. – Psychopathy