diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-06 15:00:41 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-06 15:00:41 +1200 |
commit | 7fb6107237376c63de62943619b749d35d8fc853 (patch) | |
tree | 91c5d591286e0f7838de8227369251ad6d505bc1 /vim/autoload | |
parent | Adjust a few version check comments (diff) | |
download | dotfiles-7fb6107237376c63de62943619b749d35d8fc853.tar.gz dotfiles-7fb6107237376c63de62943619b749d35d8fc853.zip |
Factor out plugin availability checks to function
Diffstat (limited to 'vim/autoload')
-rw-r--r-- | vim/autoload/vimrc.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 356861c6..de73720b 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -3,6 +3,12 @@ function! vimrc#EscapeSet(string) abort return escape(a:string, '\ ,') endfunction +" Check that we have a plugin available, and will be loading it +function! vimrc#PluginReady(filename) abort + return globpath(&runtimepath, 'plugin/'.a:filename.'.vim') !=# '' + \ && &loadplugins +endfunction + " Split a string with a split character that can be escaped with another, " e.g. &runtimepath with commas and backslashes respectively function! vimrc#SplitEscaped(str, ...) abort |