So here is a little experiment: with a clean config (i.e., no previous ~/.vimrc or ~/.vim/), do:
$ mkdir -p ~/.vim/plugin/ $ vim ~/.vim/plugin/foo.vim
And in that file, enter the following, save & exit:
Now open some file "a":
$ vim a
And inside vim, do:
Where b is some other file. Now if you do
:messages, it will show the "loaded." message, but only once!!
So global plugin files seem to be loaded only once. This behaviour surprised me when I stumbled upon it earlier today, but when I got to think about it, I guess it does make some sense: if it is a global plugin, it is not supposed to change on a per buffer basis, or whatever...
Nevertheless, I was unable to find more information about this, either vim's docs, or in the internet at large (i.e. google), so I thought to ask here: can anyone shed some more light onto this behaviour regarding vim's global plugins?
Thanks in advance.