I accidentally press a shorcut key, and I know that vim has done something but I don't know what.
How can I find out what that shortcut key does?
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 specific compiling options).
You can use the <expr> attribute to a map command to invoke a Vim function and use the returned value as the key sequence to execute. For example, the following code creates a normal mode map to change to the directory of the current buffer.
<silent> tells vim to show no message when this key sequence is used. <leader> means the key sequence starts with the character assigned to variable mapleader -- a backslash, if no let mapleader = statement has executed yet at the point nmap executes.
Creating a set of key bindings that is familiar, eases the learning curve of any new editor, and the flexibility vim allows in this configuration makes it easy to not only leverage the power of vim, but also make it feel like a familiar old friend.
There are two potential sources for information. First of all, if it's a built in shortcut, it is normally in the help documentation. For instance, if you do :help CTRL-I
, it'll take you to a help entry about moving around your jump list.
It is possible, however, that you have a custom mapping from one of your .vimrc
files or an underdocumented plugin. In that case, try using :map
which will list all custom keyboard mappings that are currently active. That will give you three columns:
You can then use :help
to further investigate the command that is run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With