diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2016-05-02 10:49:45 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2016-05-02 10:49:45 +0200 |
commit | c200e7a0c587f70611b8dd702d0c3b378676a39a (patch) | |
tree | 960c7c88f634854cf3488d6d18ce42344875f8ef /autoload/vital.vim | |
parent | 5529a5e8e21e4577e4cd3551f2cbad59b5b406e8 (diff) | |
download | vim-polyglot-c200e7a0c587f70611b8dd702d0c3b378676a39a.tar.gz vim-polyglot-c200e7a0c587f70611b8dd702d0c3b378676a39a.zip |
Add crystal syntax, closes #118
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 |