submode : Create your own submodes
| script karma
Downloaded by 639
Comments, bugs, improvements
script versions (upload new version)
|*submode* is a Vim plugin to provide the way to define "submodes" to the
built-in |vim-modes|. For example, whenever you type |g-| and/or |g+| to
undo/redo many times, don't you want to type "g++--++..." instead
"g+g+g-g-g+g+..."? With this plugin, you can define such interface with the
call submode#enter_with('undo/redo', 'n', '', 'g-', 'g-')
call submode#enter_with('undo/redo', 'n', '', 'g+', 'g+')
call submode#leave_with('undo/redo', 'n', '', '<Esc>')
call submode#map('undo/redo', 'n', '', '-', 'g-')
call submode#map('undo/redo', 'n', '', '+', 'g+')
The above settings mean:
- Define a new submode named "undo/redo".
- Define "g-" and "g+" as key sequences to enter the submode "undo/redo" from
Normal mode. Aditionally, they does undo/redo before entering the submode
- In the submode "undo/redo", "-" and "+" do undo/redo.
- In the submode "undo/redo", "<Esc>" leaves the submode.
By default, <Esc> is automatically defined as a key to leave any submode.
So you don't have to explicitly define like the above example.
There are also 2 ways to leave submodes:
- Type any key sequence which is not mapped in the submode.
- Don't type any key for a long time. See |submode-variables| to configure
the details of this time out.
- Vim 7.2 or later
Document in HTML format:
Click on the package to download.
ip used for rating: 184.108.40.206