Autoloading is an important concept in writing vim plugins.
Autoload let you delay loading code until it's actually needed.
When running a command like below:
cal somefile#func()
If the function is already been loaded, vim just call it directly. Otherwise, vim will look for the file autoload/somefile.vim in ~/.vim/ directory and any bundle directories.
In the file, the function is defined like this:
function somefile#func()
...
endfunction
Multiple # can be used to represent subdirectories.
Autoloading is an important concept in writing vim plugins.
Autoload let you delay loading code until it's actually needed.
When running a command like below:
If the function is already been loaded, vim just call it directly. Otherwise, vim will look for the file
autoload/somefile.vim
in~/.vim/
directory and any bundle directories.In the file, the function is defined like this:
Multiple
#
can be used to represent subdirectories.References