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