7 echo "Usage: $0 >digraphs-vim.inc.pl"
8 echo 'Collect digraph data from vim, standard output as Perl hash.'
12 vim -e -c'echo version' -cdigraphs -cq | perl -CSD -nE '
14 say "# digraphs list from vim version ", s/\s*\z//r;
17 while (/\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g) {
18 my ($mnem, $chr, $cp) = ($1, $2, $3);
19 $mnem =~ s/(?=[\\}])/\\/g; # escape string delimiter
20 $chrstr = sprintf q("\x{%x}"), $cp;
21 say "q{$mnem} => $chrstr,";
25 exit warn "only $. lines of :digraphs output\n" if $. < 6;