LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mapping Esc to windows key in Vim (http://www.linuxquestions.org/questions/linux-newbie-8/mapping-esc-to-windows-key-in-vim-242353/)

frankie_DJ 10-13-2004 08:28 PM

Mapping Esc to windows key in Vim
 
Is it possible to map a windows key in Vim?
I am trying to use the windows key as Esc to change modes in Vim (Esc is to far up) .
I know I should use
Code:

:map <oldkey> <newkey>
but I don't know what is a key code for <windows> key.
When I type
Code:

Ctrl-V <windows>
to see the key code for windows key I don't get anything. But then, I don't get anything for <Ctrl> or <Alt> either so I am confused. Thanks for help.

CroMagnon 10-14-2004 12:13 AM

I think the key codes are 115 and 116 for the left and right keys respectively, but could be different on some keyboards. You should be able to check with the xev program.
(Whether or not this will work in vim is something I don't know)

synaptical 10-14-2004 03:56 PM

if you can't get it, you might consider making the caps lock an escape key. just put this in your ~/.xinitrc:
Code:

# -----------start------------
# Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
# ------------end-------------

just make sure caps lock isn't turned off in your xorg.conf. the downside is it only works in X, but for me it's still been useful. :cool:


All times are GMT -5. The time now is 10:40 PM.