digraphs: .vim option to give ex commands of shiar proposals
[sheet.git] / digraphs.vim.plp
diff --git a/digraphs.vim.plp b/digraphs.vim.plp
new file mode 100644 (file)
index 0000000..d21a5f6
--- /dev/null
@@ -0,0 +1,28 @@
+<:
+use strict;
+use warnings;
+use open IO => ':utf8';
+
+our $VERSION = '1.0';
+
+$header{content_type} = 'text/plain; charset=us-ascii';
+print '" vim digraph proposals <http://vi.shiar.net/digraphs>', "\n";
+PLP_END { print "\n" };
+
+open my $include, '<', 'shiar.inc.txt' or do {
+       print qq{\n" $_} for '>>> SERVER ERROR <<<', "($!; try again later)";
+       warn $!;  # log it as well
+       exit;
+};
+
+my $init = 1;
+for (readline $include) {
+       m{^([!"%'-Z_a-z]{2}) (.)} or next;
+       print "\n:digr" if $init;
+       printf ' %s %d', $1, ord $2;
+}
+continue {
+       # repeat header for next entry if line was empty
+       $init = !m{\S} unless m{^#};
+}
+