I am trying to map Ctrl+H,J,K,L to arrow keys Left,Down,Up,Right, respectively, on Ubuntu OS (globally, not inside Vim).
I've attempted the solution posted here, but the modifier commands are not working. Here is what I am trying:
xmodmap -e "keycode 45 Control_L = k Up"
xmodmap -e "keycode 45 control = k Up"
(keycode 45 maps to "k")
Neither commands work. (They give no errors, but ctrl + k is not remapped to up arrow)
Is there a way to do this xmodmap, and if not, is there a cleaner workaround?
Thanks!
Edit: I have found my answer here – thanks to swift
Best Answer
It is surely very strange idea to turn Ubuntu into the codename "VimOS". I think much more adequate to map Vim's keys to some free and equable more cluster of the keyboard. Or definitely NOT due to it is also might be useful.
However I do not deletes my first suggest about Vim mappings and should to say that answer to your question exist here:
System wide vim-style (hjkl) navigation
Partially I agree this view (thanks to shell hell):
And also I found near answer here:
Superuser: Mapping Super+hjkl to arrow keys under X
Vim uses a switching modes to mapping keys. So xmodmap for Vim it is some pluggable globals what breaks classic Vim experience. Even so to claim it sounds pathetic
;)
Mapping keys in Vim - Tutorial (Part 1)
Mapping keys in Vim - Tutorial (Part 2)
Mapping keys in Vim - Tutorial (Part 3)