21

I would like to know what is the meaning of the # symbol in function names e.g.:

execute pathogen#infect()
Alex
  • 347
  • 2
  • 11

1 Answers1

27

That's part of the autoload mechanism. From Autoloading at Learn Vimscript the Hard Way and :help autoload:

Autoload lets you delay loading code until it's actually needed, so if the following function

execute pathogen#infect()

has already been loaded, Vim will simply call it normally. Otherwise Vim will look for a file called autoload/pathogen.vim in your ~/.vim directory . If this file exists, Vim will load/source the file. It will then try to call the function normally.

Every # in the function name works like a path separator. Thus when calling a function:

:call foo#bar#func()

Vim will look for the file autoload/foo/bar.vim

Jair López
  • 1,854
  • 1
  • 15
  • 24