You can not 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

  1. function! vital#of(name) abort
  2. let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital', 1)
  3. let file = split(files, "\n")
  4. if empty(file)
  5. throw 'vital: version file not found: ' . a:name
  6. endif
  7. let ver = readfile(file[0], 'b')
  8. if empty(ver)
  9. throw 'vital: invalid version file: ' . a:name
  10. endif
  11. return vital#_{substitute(ver[0], '\W', '', 'g')}#new()
  12. endfunction