How to source all vim files in directory

As mb14 has already said, if you put them in ~/.vim/plugin they will be sourced automatically. For information, however, if you want to source all of the files in your vimrc.d directory, you could do this (requires a relatively recent Vim):

for f in split(glob('~/vimfiles/vimrc.d/*.vim'), '\n')
    exe 'source' f
endfor

You may also be interested in the autoload mechanism, described in :help 41.15: if you’re defining a lot of functions, this can make start-up a bit quicker as the functions are only loaded the first time they’re used.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)