I'm trying to set a key mapping in vim. I know that
Control-J. What is the text representation of the capslock key? I tried
<capslock> but that does not work.
Is there a list of these representations somewhere?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Note: This only answers the original question, which was then changed to specify the exact problem the OP had. Vim won't ever see the Caps Lock key. You can only remap the Caps Lock key to something else in OS X, and then use standard key mappings in vim.
See here for more info: Using Caps Lock as Esc in Mac OS X
Probably best like this:
That's the symbol on Mac keyboards. It's called "UPWARDS WHITE ARROW FROM BAR" and its Unicode key is
For a list of common OS X key symbol, see: The Macintosh Biblioblog: Special Key Symbols
Ctrl in OS X is actually represented by the "UP ARROWHEAD"
c- notation is only common in Emacs, the editor that probably made the Control keyboard shortcuts popular.
For more info, see:
You cannot map Caps-Lock in Vim—neither in console/terminal based Vim, nor the GUI based gVim, because Vim simply cannot "see" when that key is pressed.
If you really want to do this, you will probably have to find out how to get your OS to change the meaning of Caps-Lock to something else that Vim can see, but you will lose it for Caps-Lock.