advice : alter the behavior of a command in modular way
| script karma
Downloaded by 600
Comments, bugs, improvements
script versions (upload new version)
|*advice* is a library for Vim scripts to provide a modular way to alter the
behavior of a command.
For example, if you want to change the default register for the command |C| to
"_ (|quote_|), you have to write a new operator then map |C| to execute the
operator, i.e., redefine the whole command. But how about if you also want to
change |C| in Visual mode to always behave as same as the default |C| in
|blockwise-visual| mode? How about if you want to disable one of the altered
behaviors afterwards? Therefore, redefining the whole command is not elegant
ADVICE provides useful API to do such customization.
The concept of ADVICE is derived from the one of Emacs. See also:
Note that there are some differences from the one of Emacs, especially: there
is no activation and ADVICE supports "usual" commands only (see
|advice-Normal-command|). Because Ex commands and functions cannot be
supported only by Vim script.
- Vim 7.2 or later
Click on the package to download.
ip used for rating: 18.104.22.168