Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if a key is bound to something in vim

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.

like image 612
K. Norbert Avatar asked Mar 20 '10 16:03

K. Norbert


People also ask

How do you check if a key is mapped in vim?

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).

What is key bindings in vim?

Understanding the structure of Key binding So that means you can have the same key mapped to different commands depending on the mode. That is really flexible and powerful. Vim allows you to basically map in almost every mode such as normal, insert, visual, command, and any other existing modes.

Does vim allow for custom key bindings?

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.


1 Answers

If you check out the suggested answer by Randy Morris you will find that

:help index  

will give you the list you want.

like image 61
skeept Avatar answered Sep 19 '22 16:09

skeept