neosnippet.vim/autoload/vital.vim

13 lines
400 B
VimL
Raw Permalink Normal View History

2015-05-12 05:11:55 +00:00
function! vital#of(name) abort
2016-12-13 21:23:37 +00:00
let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital', 1)
2012-09-30 08:06:28 +00:00
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