Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-13-2004, 07:28 PM   #1
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Rep: Reputation: 32
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
:map <oldkey> <newkey>
but I don't know what is a key code for <windows> key.
When I type
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.
Old 10-13-2004, 11:13 PM   #2
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
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)
Old 10-14-2004, 02:56 PM   #3
Senior Member
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
if you can't get it, you might consider making the caps lock an escape key. just put this in your ~/.xinitrc:
# -----------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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the Meta key from Esc to Alt primo *BSD 0 08-27-2005 05:18 PM
mapping a key to compile a program in vim dvm Linux - Software 1 01-26-2005 07:56 AM
Arrow Key mapping lazlom AIX 5 06-21-2004 03:32 PM
mapping delete key sboyce57 Linux - Newbie 1 02-22-2004 11:05 PM
Damn 'Esc' key crabboy General 1 05-15-2001 10:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration