sponsor Vim development Vim logo Vim Book Ad

advice : alter the behavior of a command in modular way

 script karma  Rating 4/1, Downloaded by 997  Comments, bugs, improvements  Vim wiki

created by
Kana Natsuno
script type
*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:
http://www.gnu.org/software/emacs/elisp/html_node/Advising-Functions.html .
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

Latest version:
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-advice-0.0.0.zip 0.0.0 2008-10-13 7.0 Kana Natsuno Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github