From ff415f6392ee38af55f1657c02d5a0069779b82f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 10 Oct 2008 00:54:38 +0000 Subject: [PATCH] digraphs: .vim option to give ex commands of shiar proposals Give a plain text with :digr commands to attain the unofficial digraphs at digraphs.vim.plp. --- .htaccess | 3 +++ digraphs.css | 2 +- digraphs.plp | 3 +++ digraphs.vim.plp | 28 ++++++++++++++++++++++++++++ shiar.inc.txt | 1 - 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 digraphs.vim.plp diff --git a/.htaccess b/.htaccess index f322d75..24ee14d 100644 --- a/.htaccess +++ b/.htaccess @@ -3,6 +3,9 @@ DirectoryIndex index.plp RewriteEngine on RewriteBase / +# serve vim commands when requesting /digraphs.ex as well +RewriteRule ^(digraphs)\.ex(/.*)?$ $1.vim$2 + # add .plp if a file exists with .plp appended (topdir only) RewriteCond %{REQUEST_FILENAME}.plp -f RewriteRule ^/*([^/]+)(.*) $1.plp$2 diff --git a/digraphs.css b/digraphs.css index 9e037a9..22c2d6f 100644 --- a/digraphs.css +++ b/digraphs.css @@ -79,7 +79,7 @@ td.X {background: #FFF} /* unidentified */ td.Xr {background: #EEE} /* reverse */ td.Xa {color: #0A0} /* ascii */ td.Xl {color: #070} /* latin1 */ -td.Xz {color: #D00} /* proposed */ + .Xz {color: #D00} /* proposed */ td.Lm, td.Mc, td.Me, td.Zl, td.Zp, td.Cs {background: #F00} /* unstyled */ diff --git a/digraphs.plp b/digraphs.plp index 81944b2..068961d 100644 --- a/digraphs.plp +++ b/digraphs.plp @@ -24,6 +24,9 @@ $header{content_type} = 'text/html; charset=utf-8';

i^k in Vim. Also see common digraphs.

+

Unofficial proposals +are available as ex commands.

+ <: my $di = do 'digraphs.inc.pl'; diff --git a/digraphs.vim.plp b/digraphs.vim.plp new file mode 100644 index 0000000..d21a5f6 --- /dev/null +++ b/digraphs.vim.plp @@ -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 ', "\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{^#}; +} + diff --git a/shiar.inc.txt b/shiar.inc.txt index fb4803c..258d40b 100644 --- a/shiar.inc.txt +++ b/shiar.inc.txt @@ -1,6 +1,5 @@ # vim =e € - # zsh Eu € -- 2.30.0