I've just installed the command-t plugin and what to map it to cmd-t instead of leader-t. I'm fairly new to vim and I don't know what the symbols are for the key mappings. Where can I find a reference for the symbols you use when mapping key combos in vim?
4 Answers
a vim principle is that an undocumented feature is a useless feature. So vim documentation is all you need.
:help :map
:help :map-special-keys

- 76,634
- 23
- 210
- 236
-
I've had a good look through those pages and I'm still a bit lost. I've tried pressing ctrl-v and then the key combo, cmd-t but I get a message saying No mapping found. What I'm really looking for is a reference of the keys that you can include in a :map definition. – opsb Sep 28 '10 at 09:56
-
Another attempt I made was :map
, I think this gives a good idea of what i'm trying to do( is my attempt at mapping cmd-t on a mac). -
OK, so I found an example for the mapping I want. It's map
:CommandT – opsb Sep 28 '10 at 10:04. There's no way I could have put that together myself though because I still have no idea how to describe the key combos. -
this answer does not address the request for a "reference for the symbols". my answer does. – thejoshwolfe Oct 22 '15 at 16:42
Thanks to another SO post and answer, I found the following reference page:
:help key-notation
Here's an excerpt:
<S-...> shift-key *shift* *<S-*
<C-...> control-key *control* *ctrl* *<C-*
<M-...> alt-key or meta-key *meta* *alt* *<M-*
<A-...> same as <M-...> *<A-*
<D-...> command-key (Macintosh only) *<D-*
<t_xx> key with "xx" entry in termcap

- 1
- 1

- 5,328
- 3
- 29
- 21
:help <>
will give you info on the notation used with :map
.
The authors of vim documentation don't always provide links everywhere they ought to (this may not really be practical). Often you end up having to read an entire help file, or at least the first few sections, to get the foundation for what is being explained in a particular entry.
In this case, I found a link to <>
in the very first section of the file which contains the info for :help map-special-keys
. That file is called map.txt
; you can go directly to the top of it with :help map.txt
. The documentation for <>
is located in intro.txt
, which may itself be worth a going-over.

- 23,174
- 7
- 66
- 88
D
is the character you need to represent ⌘ in your .vimrc.
For example :
nnoremap <D-t> :MyFunction<CR>
maps ⌘t to MyFunction()
.
Replace MyFunction
by the main function of your plugin and you are set.
Another way would be to look at the plugin's file and see if you can modify some hardcoded mappings.
Another thing to do — the first, I think — would be to consult the plugin's help and see if a "canonical" mapping method is indicated or if there is some variable to put in your .vimrc.

- 186,200
- 21
- 280
- 313