外部ファイルのインクルードruntimeruntime! mylib/*.vim # パスが通ってない場合はruntimepathに設定する set runtimepath+=$HOME/.vim/mylib runtime! *.vim runtimepathの確認echo &rtp sourceif filereadable(expand('$HOME/mylib/foo.vim')) source $HOME/mylib/foo.vim endif for f in split(glob('~/.vim/mylib/*.vim'), '\n') exe 'source' f endfor runtimeとsourceの違い
参考https://unix.stackexchange.com/questions/171132/can-vimrc-be-divided-into-multiple-files |
|