Created
October 20, 2013 06:06
-
-
Save rbtnn/7065519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:vim_version() " {{{ | |
redir => lines | |
silent! version | |
redir END | |
let m1 = [] | |
let m2 = [] | |
let regex1 = '^VIM - Vi IMproved \(\d\+.\i\+\) ' | |
let regex2 = '^Included patches: \(\d\+\)-\(\d\+\)' | |
for line in split(lines,"\n") | |
if line =~# regex1 | |
let m1 = matchlist(line,regex1) | |
endif | |
if line =~# regex2 | |
let m2 = matchlist(line,regex2) | |
endif | |
endfor | |
return printf('%s.%04s', m1[1], m2[2]) | |
endfunction " }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment