26113Re: script bloat
- Nov 2, 2001
>From: Zdenek Sekera <zs@...>Sorry for the formatting above. Hotmail's compose window is really small.
>Ron Aaron wrote:
>> au FuncUndefined * :silent! exe 'source
>>Put the files named after the functions, in $VIMGLOBAL/auto as before...
>Yep, that's it! :-)
Anyway, to make the command a little more consistent with 6.0 features, I
changed the part
exe 'source '.$VIMGLOBAL.'/auto/'.expand("<afile>").'.vim'
exe 'runtime! auto/'.expand("<afile>").'.vim'
to make it look in the runtime directories for files. It uses Vim's builtin
path searching mechanism and saves having to define an environment variable.
Of course, it makes it 6.0 specific, if that matters...
I called a function without an auto directory created, and just got an
"unknown funtion" error. Then I created a vimfiles\auto directory and put
the function in it, and it ran the function when I called it.
The autoloading works very well! I missed this idea the first time around.
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
- << Previous post in topic Next post in topic >>