From c200e7a0c587f70611b8dd702d0c3b378676a39a Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 2 May 2016 10:49:45 +0200 Subject: Add crystal syntax, closes #118 --- autoload/vital.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 autoload/vital.vim (limited to 'autoload/vital.vim') 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 -- cgit v1.2.3