You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
400 B
VimL
13 lines
400 B
VimL
function! vital#of(name) abort
|
|
let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital', 1)
|
|
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
|