-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathversiondump.vim
More file actions
32 lines (28 loc) · 853 Bytes
/
versiondump.vim
File metadata and controls
32 lines (28 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let major = v:version / 100
let minor = v:version % 100
let patch = get(filter(range(10000), 'has("patch".v:val)'), -1, 0)
let revision = 0
redir => buf
silent version
redir END
let m = matchlist(buf, '\vVIM - Vi IMproved \d+\.\d+(.) BETA')
let beta = empty(m) ? '' : m[1]
let full = printf('%d.%d.%d.%d', major, minor, patch, revision)
let short = printf('%d.%d', major, minor)
let arch = has('win64') ? 'win64' : 'win32'
if beta == ""
if patch == 0
let name = printf('%d.%d-%s', major, minor, arch)
else
let name = printf('%d.%d.%03d-%s', major, minor, patch, arch)
endif
else
" FIXME
let name = printf('%d.%d%s-r%d-%s', major, minor, beta, revision, arch)
endif
$put ='SET VER_FULL='.full
$put ='SET VER_SHORT='.short
$put ='SET VER_NAME='.name
$put ='SET VER_ARCH='.arch
write! version.bat
quit