1" Vim syntax file 2" Language: Lout 3" Maintainer: Christian V. J. Br�ssow <cvjb@cvjb.de> 4" Last Change: Son 22 Jun 2003 20:43:26 CEST 5" Filenames: *.lout,*.lt 6" URL: http://www.cvjb.de/comp/vim/lout.vim 7" $Id: lout.vim,v 1.1 2004/06/13 17:52:18 vimboss Exp $ 8" 9" Lout: Basser Lout document formatting system. 10 11" For version 5.x: Clear all syntax items 12" For version 6.x: Quit when a syntax file was already loaded 13if version < 600 14 syntax clear 15elseif exists("b:current_syntax") 16 finish 17endif 18 19" Lout is case sensitive 20syn case match 21 22" Synchronization, I know it is a huge number, but normal texts can be 23" _very_ long ;-) 24syn sync lines=1000 25 26" Characters allowed in keywords 27" I don't know if 128-255 are allowed in ANS-FORHT 28if version >= 600 29 setlocal iskeyword=@,48-57,.,@-@,_,192-255 30else 31 set iskeyword=@,48-57,.,@-@,_,192-255 32endif 33 34" Some special keywords 35syn keyword loutTodo contained TODO lout Lout LOUT 36syn keyword loutDefine def macro 37 38" Some big structures 39syn keyword loutKeyword @Begin @End @Figure @Tab 40syn keyword loutKeyword @Book @Doc @Document @Report 41syn keyword loutKeyword @Introduction @Abstract @Appendix 42syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections 43 44" All kind of Lout keywords 45syn match loutFunction '\<@[^ \t{}]\+\>' 46 47" Braces -- Don`t edit these lines! 48syn match loutMBraces '[{}]' 49syn match loutIBraces '[{}]' 50syn match loutBBrace '[{}]' 51syn match loutBIBraces '[{}]' 52syn match loutHeads '[{}]' 53 54" Unmatched braces. 55syn match loutBraceError '}' 56 57" End of multi-line definitions, like @Document, @Report and @Book. 58syn match loutEOmlDef '^//$' 59 60" Grouping of parameters and objects. 61syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError 62 63" The NULL object has a special meaning 64syn keyword loutNULL {} 65 66" Comments 67syn region loutComment start='\#' end='$' contains=loutTodo 68 69" Double quotes 70syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+ 71 72" ISO-LATIN-1 characters created with @Char, or Adobe symbols 73" created with @Sym 74syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+' 75 76" Include files 77syn match loutInclude '@IncludeGraphic\s\+\k\+' 78syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}' 79 80" Tags 81syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+' 82syn region loutTag start='@Tag\s*{' end='}' 83 84" Equations 85syn match loutMath '@Eq\s\+\k\+' 86syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError 87" 88" Fonts 89syn match loutItalic '@I\s\+\k\+' 90syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError 91syn match loutBold '@B\s\+\k\+' 92syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError 93syn match loutBoldItalic '@BI\s\+\k\+' 94syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError 95syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError 96 97" Define the default highlighting. 98" For version 5.7 and earlier: only when not done already 99" For version 5.8 and later: only when an item doesn't have highlighting yet 100if version >= 508 || !exists("did_lout_syn_inits") 101 if version < 508 102 let did_lout_syn_inits = 1 103 command -nargs=+ HiLink hi link <args> 104 else 105 command -nargs=+ HiLink hi def link <args> 106 endif 107 108 " The default methods for highlighting. Can be overrriden later. 109 HiLink loutTodo Todo 110 HiLink loutDefine Define 111 HiLink loutEOmlDef Define 112 HiLink loutFunction Function 113 HiLink loutBraceError Error 114 HiLink loutNULL Special 115 HiLink loutComment Comment 116 HiLink loutSpecial Special 117 HiLink loutSymbols Character 118 HiLink loutInclude Include 119 HiLink loutKeyword Keyword 120 HiLink loutTag Tag 121 HiLink loutMath Number 122 123 " HiLink Not really needed here, but I think it is more consistent. 124 HiLink loutMBraces loutMath 125 hi loutItalic term=italic cterm=italic gui=italic 126 HiLink loutIBraces loutItalic 127 hi loutBold term=bold cterm=bold gui=bold 128 HiLink loutBBraces loutBold 129 hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic 130 HiLink loutBIBraces loutBoldItalic 131 hi loutHeadings term=bold cterm=bold guifg=indianred 132 HiLink loutHeads loutHeadings 133 134 delcommand HiLink 135endif 136 137let b:current_syntax = "lout" 138 139" vim:ts=8:sw=4:nocindent:smartindent: 140