Loading ...
Sorry, an error occurred while loading the content.

26113Re: script bloat

Expand Messages
  • Dan Sharp
    Nov 2, 2001
    • 0 Attachment
      >From: Zdenek Sekera <zs@...>
      >
      >Ron Aaron wrote:
      >>
      >>aug autoload_package
      >> au FuncUndefined * :silent! exe 'source
      >>'.$VIMGLOBAL.'/auto/'.expand("<afile>").'.vim'
      >>aug END
      >>
      >>Put the files named after the functions, in $VIMGLOBAL/auto as before...
      >
      >Yep, that's it! :-)

      Sorry for the formatting above. Hotmail's compose window is really small.
      Anyway, to make the command a little more consistent with 6.0 features, I
      changed the part

      exe 'source '.$VIMGLOBAL.'/auto/'.expand("<afile>").'.vim'

      to

      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.
      Thanks guys!

      Dan Sharp

      _________________________________________________________________
      Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
    • Show all 24 messages in this topic