I'd like to know if there is a way to figure out if a key does something in vim. I know that I can use :map
to see user-defined mappings, but is there something for the built-in stuff?
For example, I always had CTRL-W bound to close tab, because I thought that it was unused. After half a year, I found out that there are some sequences that use it, like CTRL-W CTRL-S to split the window, and it was a nightmare to retrain myself.
Use ":map!" and ":map" for manually set keys and ":help 'char(-combination)' " to find out which keys are already mapped in vim out-of-the-box(/out of your specicific compiling options). (Slightly off-topic but still regardable (I think): Use ":scriptnames" to see which files have been sourced in which order.)
Best regards, S.
Not a complete answer, but you may want to check out
:help map-which-keys
for a list of keys that vim recommends you to use in your custom maps.That help section has a recommendation of how to tell if a specific key is mapped to an action.
You can use
mapcheck
.:-For example, I wanted to map
<CR> ,i
togg=G
to indented a file. To check if there is a mapping already for<CR> , i
...but this won't detect if the mapping is part of a sequence.
To check the default mapping:
For other mapping that is done by either users or plugin:
From http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-Tutorial(Part_1):
I skimmed through
:help index
and made a list of some of the unusednmap
keys:Please update/comment.
If you check out the suggested answer by Randy Morris you will find that
will give you the list you want.