From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 12 Sep 2005 20:40:40 +0400 From: Alexey I.Froloff To: "ALT Linux Sisyphus discussion list" Message-ID: <20050912164040.GG19469@hell.immo.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bygAmIonOAIqBxQB" Content-Disposition: inline User-Agent: Mutt/1.5.10i Subject: [sisyphus] Fwd: [mikmach@: XHTML completion file] X-BeenThere: sisyphus@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Linux Sisyphus discussion list List-Id: ALT Linux Sisyphus discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2005 16:40:42 -0000 Archived-At: List-Archive: --bygAmIonOAIqBxQB Content-Type: multipart/mixed; boundary="5UGlQXeG3ziZS81+" Content-Disposition: inline --5UGlQXeG3ziZS81+ Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =F7 =C1=D4=D4=C1=DE=C5 - =D0=C9=D3=D8=CD=CF =C9=DA vim-dev@. vim7 required= , :help compl-occult P.S. =E6=C1=CA=CC =D3=CB=CC=C1=C4=D9=D7=C1=D4=D8 =D7 ~/.vim/ftplugin/ --=20 Regards, Sir Raorn. --5UGlQXeG3ziZS81+ Content-Type: message/rfc822 Content-Disposition: inline Return-Path: Received: from purgatory.immo.ru [195.14.59.206] by localhost with POP3 (fetchmail-6.2.5) for raorn@localhost (single-drop); Mon, 12 Sep 2005 20:16:15 +0400 (MSD) Received: from purgatory.immo.ru ([unix socket]) by immo.ru (Cyrus v2.2.12) with LMTPA; Mon, 12 Sep 2005 20:09:17 +0400 X-Sieve: CMU Sieve 2.2 Received: by purgatory.immo.ru (Postfix, from userid 99) id DEF9C152FA2; Mon, 12 Sep 2005 20:09:17 +0400 (MSD) Received: from localhost (localhost.localdomain [127.0.0.1]) by purgatory.immo.ru (Postfix) with ESMTP id 69400152F84 for ; Mon, 12 Sep 2005 20:09:17 +0400 (MSD) Received: from purgatory.immo.ru ([127.0.0.1]) by localhost (mail.immo.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00533-08 for ; Mon, 12 Sep 2005 20:09:13 +0400 (MSD) Received: from foobar.math.fu-berlin.de (foobar.math.fu-berlin.de [160.45.45.151]) by purgatory.immo.ru (Postfix) with SMTP for ; Mon, 12 Sep 2005 20:09:13 +0400 (MSD) Received: (qmail 24741 invoked by uid 200); 12 Sep 2005 15:11:01 -0000 Mailing-List: contact vim-dev-help@vim.org; run by ezmlm Precedence: bulk Delivered-To: mailing list vim-dev@vim.org Received: (qmail 24733 invoked from network); 12 Sep 2005 15:11:00 -0000 Received: from ns1.wilbury.sk (HELO mrspock.ltc.sk) (217.73.17.21) by foobar.math.fu-berlin.de with SMTP; 12 Sep 2005 15:11:00 -0000 Received: from kumar.ltc.sk (kumar.ltc.sk [217.73.17.16]) by mrspock.ltc.sk (Postfix) with ESMTP id D113A9D6AE6 for ; Mon, 12 Sep 2005 18:08:55 +0200 (CEST) Received: from mrspock.ltc.sk ([217.73.17.21]) by kumar.ltc.sk (kumar.ltc.sk [217.73.17.16]) (amavisd-new, port 12424) with ESMTP id 14180-12 for ; Mon, 12 Sep 2005 18:08:44 +0200 (CEST) Received: from smtp.wp.pl (mx.wp.pl [212.77.101.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.wp.pl", Issuer "Thawte Server CA" (not verified)) by mrspock.ltc.sk (Postfix) with ESMTP id CE23F9D6AE2 for ; Mon, 12 Sep 2005 18:08:44 +0200 (CEST) Received: (wp-smtpd smtp.wp.pl 5176 invoked from network); 12 Sep 2005 18:08:36 +0200 Received: from pi47.warszawa.cvx.ppp.tpnet.pl (mikmach@[213.76.104.47]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with SMTP for ; 12 Sep 2005 18:08:36 +0200 From: Mikolaj Machowski To: vim-dev@vim.org Subject: XHTML completion file Date: Mon, 12 Sep 2005 18:07:30 +0200 User-Agent: KMail/1.8.91 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_CfaJDGDuAyk31nu" Message-Id: <200509121807.30118.mikmach@wp.pl> X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO AS1=NO(Body=1 Fuz1=1 Fuz2=1) AS2=YES(1.000000) AS3=NO AS4=NO X-Virus-Scanned-kumar: amavisd-new at ltc.sk X-Virus-Scanned: by amavisd-new at immo.ru X-Spam: no; 0.00; Vim:01 hope:04 style:92 width:88 support:16 Hello:17 testing:17 follows:18 example:18 file:23 should:30 inclusion:32 U5:33 everyone:63 HTML:60 X-Attachments: type="text/vim" name="html-complete.vim" name="html-complete.vim" --Boundary-00=_CfaJDGDuAyk31nu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, For everyone to testing (and for inclusion in Vim distro I hope). HTML completion file. It completes tag and attribute names. Attributes are conscious what tag is it. For example you will never get width=" for . It follows XHTML 1.0 Strict specification. Vim should support good HTML style ;) m. --Boundary-00=_CfaJDGDuAyk31nu Content-Type: text/vim; charset="us-ascii"; name="html-complete.vim" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="html-complete.vim" " Vim completion script " Language: XHTML 1.0 Strict " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Last Change: 2005 Sep 12 " Groups of attributes let g:coreattrs = ["id", "class", "style", "title"] let g:i18n = ["lang", "xml:lang", "dir"] let g:events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove", \ "onmouseout", "onkeypress", "onkeydown", "onkeyup"] let g:focus = ["accesskey", "tabindex", "onfocus", "onblur"] let g:coregroup = g:coreattrs let g:coregroup = extend(g:coregroup, g:i18n) let g:coregroup = extend(g:coregroup, g:events) fun! CompleteTags(findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col('.') - 1 while start >= 0 && line[start - 1] !~ '<' let start -= 1 endwhile let g:st = start return start else " find tags matching with "a:base" let res = [] let g:ba = a:base if a:base =~ '>' return [] endif " If it contains Space it is attribute, we have to get first word to offer " proper attributes. if a:base =~ ' ' let tag = split(a:base)[0] " Get last word, it should be attr name let attr = matchstr(a:base, '.*\s\zs.*') " Shorten a:base to not include last word let sbase = matchstr(a:base, '.*\ze\s.*') if tag == 'a' let tagspec = ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"] let attrs = extend(tagspec, g:coregroup) let attrs = extend(attrs, g:focus) endif if tag =~ '^\(abbr\|acronym\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$' let attrs = g:coregroup endif if tag == 'area' let attrs = g:coregroup endif if tag == 'base' let attrs = ["href", "id"] endif if tag == 'blockquote' let attrs = g:coregroup let attrs = extend(attrs, ["cite"]) endif if tag == 'body' let attrs = g:coregroup let attrs = extend(attrs, ["onload", "onunload"]) endif if tag == 'br' let attrs = g:coreattrs endif if tag == 'button' let attrs = g:coreattrs let attrs = extend(attrs, g:focus) let attrs = extend(attrs, ["name", "value", "type"]) endif if tag == '^\(col\|colgroup\)$' let attrs = g:coreattrs let attrs = extend(attrs, ["span", "width", "align", "char", "charoff", "valign"]) endif if tag =~ '^\(del\|ins\)$' let attrs = g:coreattrs let attrs = extend(attrs, ["cite", "datetime"]) endif if tag == 'form' let attrs = g:coreattrs let attrs = extend(attrs, ["action", "method", "enctype", "onsubmit", "onreset", "accept", "accept-charset"]) endif if tag == 'head' let attrs = g:i18n let attrs = extend(attrs, ["id", "profile"]) endif if tag == 'html' let attrs = g:i18n let attrs = extend(attrs, ["id", "xmlns"]) endif if tag == 'img' let attrs = g:coreattrs let attrs = extend(attrs, ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"]) endif if tag == 'input' let attrs = g:coreattrs let attrs = extend(attrs, g:focus) let attrs = extend(attrs, ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"]) endif if tag == 'label' let attrs = g:coreattrs let attrs = extend(attrs, ["for", "accesskey", "onfocus", "onblur"]) endif if tag == 'legend' let attrs = g:coreattrs let attrs = extend(attrs, ["accesskey"]) endif if tag == 'link' let attrs = g:coreattrs let attrs = extend(attrs, ["charset", "href", "hreflang", "type", "rel", "rev", "media"]) endif if tag == 'map' let attrs = g:i18n let attrs = extend(attrs, g:events) let attrs = extend(attrs, ["id", "class", "style", "title", "name"]) endif if tag == 'meta' let attrs = g:i18n let attrs = extend(attrs, ["id", "http-equiv", "content", "scheme", "name"]) endif if tag == 'title' let attrs = g:i18n let attrs = extend(attrs, ["id"]) endif if tag == 'object' let attrs = g:coreattrs let attrs = extend(attrs, ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"]) endif if tag == 'optgroup' let attrs = g:coreattrs let attrs = extend(attrs, ["disbled", "label"]) endif if tag == 'option' let attrs = g:coreattrs let attrs = extend(attrs, ["disbled", "selected", "value", "label"]) endif if tag == 'param' let attrs = ["id", "name", "value", "valuetype", "type"] endif if tag == 'pre' let attrs = g:coreattrs let attrs = extend(attrs, ["xml:space"]) endif if tag == 'q' let attrs = g:coreattrs let attrs = extend(attrs, ["cite"]) endif if tag == 'script' let attrs = ["id", "charset", "type", "src", "defer", "xml:space"] endif if tag == 'select' let attrs = g:coreattrs let attrs = extend(attrs, ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]) endif if tag == 'style' let attrs = g:coreattrs let attrs = extend(attrs, ["id", "type", "media", "title", "xml:space"]) endif if tag == 'table' let attrs = g:coreattrs let attrs = extend(attrs, ["summary", "width", "border", "frame", "rules" "cellspacing", "cellpadding"]) endif if tag =~ '^\(thead\|tfoot\|tbody\|tr\)$' let attrs = g:coreattrs let attrs = extend(attrs, ["align", "char", "charoff", "valign"]) endif if tag == 'textarea' let attrs = g:coreattrs let attrs = extend(attrs, g:focus) let attrs = extend(attrs, ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"]) endif if tag =~ '^\(th\|td\)$' let attrs = g:coreattrs let attrs = extend(attrs, ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"]) endif for m in sort(attrs) if m =~ '^' . attr call add(res, sbase.' '.m.'="') endif endfor return res endif for m in split("a abbr acronym address area b base bdo big blockquote body br button caption cite code col colgroup dd del dfn div dl dt em fieldset form head h1 h2 h3 h4 h5 h6 hr html i img input ins kbd label legend li link map meta noscript object ol optgroup option p param pre q samp script select small span strong style sub sup table tbody td textarea tfoot th thead title tr tt ul var") if m =~ '^' . a:base call add(res, m) endif endfor return res endif endfun set occultfunc=CompleteTags --Boundary-00=_CfaJDGDuAyk31nu-- --5UGlQXeG3ziZS81+-- --bygAmIonOAIqBxQB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDJa+IVqT7+fkT8woRAjZAAJ4tfxdvNGToY00CI8N7ln0QgAmO5wCeL9LJ cyYpX/UqOWkXhqG5n/rKz9I= =JMP+ -----END PGP SIGNATURE----- --bygAmIonOAIqBxQB--