A script in
autoload is loaded when a function that is defined in your
autoload script is called.
autoload scripts have been introduced to optimize the Vim startup time. Instead of loading all the Vim scripts to make all the plugin functions available some Vim scripts loading are postponed to the moment a function that is defined in it is called.
Suppose you have a file:
~/.vim/autoload/foo.vim with the following content:
autoload/foo.vim will only be loaded when another scripts or
call command calls
More information with:
Remark: If you want your script to be sourced at startup unconditionally you can put it in the
More information with