[ACCEPTED]-is it possible to mapping Alt-hjkl in Insert mode?-vi
Accepted answer
It's easier to map what your key combination 3 does. Alt+something
generally results in a character, differently 2 from Ctrl+something
.
For example, on my Mac Alt
plus hjkl
generates 1 ˙∆˚¬
. So:
imap ˙ <Left>
imap ∆ <Down>
imap ˚ <Up>
imap ¬ <Right>
would do it.
For arrow keys:
Start by viewing the key code your terminal 6 is sending to vim:
$ sed -n l
^[[1;9D
In the above example, i 5 ran the sed command and pressed Alt + Left.
The ^[[1;9D
is 4 the escaped sequence being sent to vim, so 3 we can user that for our mapping.
Add this 2 to your .vimrc
map <Esc>[1;9D :tabn<CR>
Now we can cycle through vim 1 tabs by using Alt + Left
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.