Source code raw
" DocBook related stuff
" Language: DocBook XML
" Maintainer: Etienne Kneuss <colder@php.net>
" Last Change: Sam, 28 Apr 2007
syn include @xmlPhp syntax/php.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
runtime syntax/xml.vim
" PHP code inside CDATA
" highlight php examples using php
syn region xmlExamplePhpCdata
\ start=+<!\[CDATA\[+
\ end=+]]>+
\ contained
\ contains=@xmlPhp,xmlCdataStart,xmlCdataEnd,@xmlCdataHook,@Spell
\ keepend
\ extend
" programlisting tag
syn region xmlProgramListingPHP start=+<programlisting role="php">+ keepend end="</programlisting>" contains=xmlTag,xmlEndTag,xmlRegion,xmlComment,xmlEntity,xmlprocessing,xmlExamplePhpCdata
" Fold by refsect1
syn region xmlRefSect1 start='<refsect1 role=".\+">' keepend end="</refsect1>" contains=xmlTag,xmlEndTag,xmlRegion,xmlComment,xmlEntity,xmlprocessing,xmlExamplePhpCdata fold
" Enable indenting of xml
filetype plugin indent on
" doc book uses 1 space
set sw=1
" Function definition section
imap @fd <refsect1 role="description"><CR>&reftitle.description;<CR><methodsynopsis><CR><type></type><methodname><++></methodname><CR><++><CR></methodsynopsis><CR><para><CR><++><CR></para><CR></refsect1><CR><++><Esc>7k^6li
" Function definition parameter normal
imap @fpm <methodparam><type></type><parameter><++></parameter></methodparam><CR><++><Esc>k$47hi
" Function definition parameter reference
imap @frpm <methodparam><type></type><parameter role="reference"><++></parameter></methodparam><CR><++><Esc>k$64hi
" Function definition parameter optionnal
imap @fopm <methodparam choice="opt"><type></type><parameter><++></parameter></methodparam><CR><++><Esc>k$47hi
" Function definition parameter optionnal + reference
imap @forpm <methodparam choice="opt"><type></type><parameter role="reference"><++></parameter></methodparam><CR><++><Esc>k$64hi
" Parameters section
imap @pms <refsect1 role="parameters"><CR>&reftitle.parameters;<CR><para><CR><variablelist><CR></variablelist><CR></para><CR></refsect1><CR><++><Esc>4k$a<CR>
" Variable list entry
imap @vle <varlistentry><CR><term><parameter></parameter></term><CR><listitem><CR><para><CR><++><CR></para><CR></listitem><CR></varlistentry><CR><++><Esc>7k$18hi
" Return values
imap @ret <refsect1 role="returnvalues"><CR>&reftitle.returnvalues;<CR><para><CR></para><CR></refsect1><CR><++><Esc>3k$a<CR>
" Errors
imap @err <refsect1 role="errors"><CR>&reftitle.errors;<CR><para><CR></para><CR></refsect1><CR><++><Esc>3k$a<CR>
" Unicode
imap @uni <refsect1 role="unicode"><CR>&reftitle.unicode;<CR><para><CR></para><CR></refsect1><CR><++><Esc>3k$a<CR>
" Changelog
imap @chlog <refsect1 role="changelog"><CR>&reftitle.changelog;<CR><para><CR><informaltable><CR><tgroup cols="2"><CR><thead><CR><row><CR><entry>&Version;</entry><CR><entry>&Description;</entry><CR></row><CR></thead><CR><tbody><CR></tbody><CR></tgroup><CR></informaltable><CR></para><CR></refsect1><CR><++><Esc>6k$a<CR>
" Row with two cols
imap @r2 <row><CR><entry></entry><CR><entry><++></entry><CR></row><CR><++><Esc>3k$7hi
imap @r3 <row><CR><entry></entry><CR><entry><++></entry><CR><entry><++></entry><CR></row><CR><++><Esc>4k$7hi
" Examples
imap @ex <example><CR><title></title><CR><para><CR><++><CR></para><CR><programlisting role="php"><CR><++><CR></programlisting><CR>&example.outputs.similar;<cr><screen><CR><++><CR></screen><CR></example><CR><++><Esc>12k$7hi
imap @rex <refsect1 role="examples"><CR>&reftitle.examples;<CR><para><CR><example><CR><title></title><CR><para><CR><++><CR></para><CR><programlisting role="php"><CR><++><CR></programlisting><CR>&example.outputs.similar;<cr><screen><CR><++><CR></screen><CR></example><CR></para><CR></refsect1><CR><++><Esc>14k$7hi
Comments
There is currently no comment here.