6 votes
Accepted

Autocmd event for `autoread`?

One way to create a highlighted message is this: echohl WarningMsg | echo "Buffer changed!" | echohl None The first command selects a particular highlight mode for any subsequent echo calls. When ...
user avatar
  • 18.4k
5 votes

Why does `vim-plug` add the .vim file to .vim/autoload and not .vim/plugin?

Choosing between plugin/ and autoload/ is a matter of how a plugin designer intends the plugin to be used. vim-plug is intended to be placed in autoload/ because it is initialized through functions ...
user avatar
  • 12.8k
4 votes

How an autoload/file.vim is loaded?

autoload plugins are sourced: either when we source them explicitly (like in :runtime autoload/fakeclip.vim) or when we call a function that starts in foo#bar#whatever(), it'll source autoload/foo/...
user avatar
  • 16.2k
3 votes
Accepted

VimPlug, Vim won't load plugins: E117: Unknown function : plug#begin;

Looks like you created the autoload directory (or ran the wget command to install vim-plug) under sudo. Running it under sudo will be bad because it will create files and directories that only root ...
user avatar
  • 26.2k
2 votes
Accepted

vim8 - why does my 0read not read?

Using 0read on BufNewFile actually works as expected, in fact the documentation for BufNewFile explicitly mentions using that event for loading a template or skeleton file. If we also rule out the ...
user avatar
  • 26.2k
2 votes
Accepted

Vim autoload doesn`t work

On windows you should use ~/vimfiles/ instead of ~/.vim/. I would suggest to use ~/vimfiles/vimrc instead of ~/.vimrc too.
user avatar
  • 10.4k
2 votes

Create an autoload alias for an autoload function

May I ask why do you want to address this function through another name? If you need an indirection let SomeRef = function('foo#bar#do_stuff') works correctly. You can define as many variables as you ...
user avatar
  • 16.2k
2 votes

How to list files in "autoload" directory?

I'd use globpath() instead of glob() as you seems to be interested in all autoload directories. echo globpath(&rtp, 'autoload/**/lightline/**/*.vim') Internally, Vim also uses the 'runtimepath' ...
user avatar
  • 16.2k
1 vote
Accepted

How to list files in "autoload" directory?

:h glob() And for your case it might be: :echo glob("~/.vim/**/lightline/**/*.vim")
user avatar
  • 10.4k
1 vote

Why does autoload/myplugin.vim get sourced?

Untested, but my theory is that during startup the definition of a function (particularly using function!) causes vim to check if a function by that name is defined, and this in turn causes the ...
user avatar
  • 21.4k

Only top scored, non community-wiki answers of a minimum length are eligible