Recent versions of Vim v7.4 prepend the expected version number by various
escapes (probably terminal-dependent), causing an unreadable result of:
\e[?1049h\e[?1h\e=\e[1;63r\e[?25h\e[?25h\e[?25l\e[63;1H704
Assume nothing is put after the wanted number, so capture only that.
vim -e -c'echo version' -cdigraphs -cq | perl -CSD -nE '
if ($. == 1) { # head
vim -e -c'echo version' -cdigraphs -cq | perl -CSD -nE '
if ($. == 1) { # head
- say "# digraphs list from vim version ", s/\s*\z//r;
+ say "# digraphs list from vim version ", m/(\d+)\s*\z/;
say "+{";
} else { # body
while (/\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g) {
say "+{";
} else { # body
while (/\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g) {