" Vim syntax file " Language: lxcms " Maintainer: J.W. Janssen " Last Change: 2004 Apr 26 " To use this syntax file: " 1. mkdir ~/.vim/syntax " 2. mv ~/lxcms.vim ~/.vim/syntax/lxcms.vim " 3. :set syntax=lxcms " " Quit if syntax file is already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif if version < 508 command! -nargs=+ LXhigh hi link else command! -nargs=+ LXhigh hi def link endif " Special cases syn match lxLine "^----$" syn match lxSubstitutes "\(\~\|---\|--\|(R)\|(C)\|(TM)\|<<\|>>\)" syn match lxNormal "\(\\\~\|\\\)" syn match lxLineBreak "\\\\" " Acronyms syn match lxFullAcro "[A-Z]\+[A-Z0-9._'-]*\n\?([^)]\+)" contains=lxAcronym,lxAcroText syn match lxAcronym "[A-Z]\+[A-Z0-9._'-]*" contained syn region lxAcroText start="("ms=s+1 end=")"me=e-1 contained " Markup syn region lxBold start=+\*\w+ms=s+1 end=+\p\*+me=e-1 oneline syn region lxItalic start=+/\w+ms=s+1 end=+\p/+me=e-1 oneline syn region lxUnderline start=+_\w+ms=s+1 end=+\p_+me=e-1 oneline syn region lxCode start=+|+ms=s+1 end=+|+me=e-1 oneline syn region lxQuote start=+``+ms=s+2 end=+''+me=e-2 oneline " Variables syn match lxVariable "\$[a-zA-Z0-9_]\+" " Lists syn region lxList start="^[ ]*\([-*.o]\|\d\+\.\) " end="\n\n" contains=lxSubstitutes,lxNormal,lxLineBreak,lxFullAcro,lxBold,lxItalic,lxUnderline,lxCode,lxQuote,lxVariable,lxAnyLink,lxListType syn match lxListType "^[ ]*\([-*.o]\|\d\+\.\) " contained " Code blocks syn region lxPre start="^[ ]\{2,}" end="\n\n" " Headings syn region lxHead start="^=head[1234] " end="$" contains=lxVariable,lxHeading oneline syn region lxHeading start=" "ms=s+1 end="$" contained " Links syn region lxAnyLink start="\[" end="\]" contains=lxAltText,lxResource,lxVariable oneline syn match lxResource "[0-9a-zA-Z._:/-]" contained syn region lxAltText start=" " skip=" " end="\]"me=e-1 contained oneline " The default highlighting. if version >= 508 || !exists("did_lxcms_syn_inits") if version < 508 let did_lxcms_syn_inits = 1 endif hi def lxBold term=bold cterm=bold gui=bold hi def lxItalic term=italic cterm=italic gui=italic hi def lxUnderline term=underline cterm=underline gui=underline LXhigh lxCode PreProc LXhigh lxLine PreProc LXhigh lxOperator SpecialChar LXhigh lxQuote String LXhigh lxLineBreak Statement LXhigh lxPre Comment LXhigh lxList Normal LXhigh lxListType Type LXhigh lxSubstitutes SpecialChar LXhigh lxHead Identifier LXhigh lxHeading Comment LXhigh lxVariable Identifier LXhigh lxAcronym Identifier LXhigh lxAcroText Comment LXhigh lxResource Character LXhigh lxAltText Comment endif delcommand LXhigh let b:current_syntax = "lxcms" "EOF vim: tw=78:ft=vim:ts=8