diff options
Diffstat (limited to 'autoload/vital.vim')
-rw-r--r-- | autoload/vital.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/autoload/vital.vim b/autoload/vital.vim new file mode 100644 index 00000000..98fe948f --- /dev/null +++ b/autoload/vital.vim @@ -0,0 +1,16 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 + +function! vital#of(name) abort + let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital') + let file = split(files, "\n") + if empty(file) + throw 'vital: version file not found: ' . a:name + endif + let ver = readfile(file[0], 'b') + if empty(ver) + throw 'vital: invalid version file: ' . a:name + endif + return vital#_{substitute(ver[0], '\W', '', 'g')}#new() +endfunction + +endif |