![]() ![]() For example, if you create a map for CTRL-I, then you can invoke the map by pressing Ctrl-I or the Tab key. Both the keys produce the same key scan code. If you use one of the Ctrl-key combination in the above table in a map, the map also applies to the corresponding key. The following table shows the mapping between some of the keys on the keyboard and the equivalent Ctrl-key combination: The Ctrl-V key sequence is used to escape the following control character. For example, to map the Ctrl-K key to display the buffer list, you can use the following map command: You can enter a non-printable control character in a map command by preceding it with CTRL-V. You can enter non-printable control characters (like Ctrl-G, Alt-U, Ctrl-Shift-F2, F2, etc.) in several different ways. When defining a map command, you can enter printable characters like 'a', 'V', etc. If you use any of these keys at the beginning of your maps, then you will observe a delay when you enter a single "j" or "k" or "l" or "h". These keys are used for moving the cursor in normal mode. For example, you should not start your normal mode map key sequence with "j" or "k" or "l" or "h". ![]() You should not use a frequently used Vim key sequence at the start of your maps. You have to combine these key modifiers with other keys to create a map. Note that you cannot map the Shift or Alt or Ctrl keys alone as they are key modifiers. You can also prefix the desired key sequence with a backslash (\) or comma (,) or underscore (_), etc. Most of the key combinations should work in GUI Vim. But some of the key combinations may not work in all the terminal emulators. The function keys in combination with Control, Alt and Shift can also be used. Try to use an unused key sequence in your maps. For example, to list all the locations where maps beginning with "," are defined, use the following command: In the above command, replace with the desired key sequence. To determine the script or plugin that defines a map for a key sequence, use the following command. To display the list of keys that are currently mapped, use the following commands: Some of the key sequences may be used by the existing Vim scripts and plugins. If you don't use some Vim functionality invoked by a particular key sequence or you have an alternate key sequence to use that functionality then you can use that key sequence in your maps. To get a list of the key sequences used by Vim, read the following help topic: If you use a key sequence in your map that is already used by Vim, then you will not be able to use the functionality provided by Vim for that key sequence. Many of the key sequences that you can enter from the keyboard are used by Vim to implement the various internal commands. In your private maps you should use key sequences that are not used by Vim and by other Vim plugins. Finding unused keys Further information: Unused keys ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |