How do I map my Windows key (which is defined as the Meta_L key in Ubuntu) so that it also works as the Ctrl+L key in Vim? This is a more comfortable mapping for me in some circumstances.
You have to remap all the sequences which use <C->
to use <M->
and put them in the separate .vimrc.
To receive the full list of current mappings use
:redir > ~/mappings | map | redir END
:e ~/mappings
:g!/<C-/d
After that you will have all the mappings that use key. Add same mappings to your .vimrc substituting
:help map
It is not a one minute job but it is how it can be done.
Looks like Ctrl and Alt are hard-coded into in the Vim source. You can map your Windows key to Ctrl globally if you don't mind affecting all other programs too. Some window managers will support doing this, or else you can use xmodmap. The Vim wiki has some info about mapping the Windows key to another Esc , which is similar.
You can also go to System settings > Keyboard > and Alt/Win key behavior > Control is mapped to Alt keys, Alt is mapped to Win keys. This is much better to use control with thumb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With