in Vimscript (vimL) how do I augment a library's function?
I have an autoload vim script library th开发者_开发问答at I've gotten form vim.org. I don't want to change it directly but want to put something in my vimrc that augments one of the functions in that library so that whenever that function is called in that library, my function also gets called. How do I do that?
I'm afraid you will have to patch that function.
You may also automate the process this way:
- move
{rtp}/autoload/path/to/script.vim
to{rtp}/autoload/path/to/script0.vim
- apply
:%s/fu\%[nction]!\= *path#path#script#&0#g
in the script moved - generate your own
{rtp}/autoload/path/to/script.vim
that forwards all calls to the original script.
精彩评论