blob: 30c87fce5147f4d3b44851425bc61c47a0ab90a0 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Lout
3" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
Bram Moolenaar84f72352012-03-11 15:57:40 +01004" Last Change: So 12 Feb 2012 15:15:03 CET
Bram Moolenaar071d4272004-06-13 20:20:40 +00005" Filenames: *.lout,*.lt
Bram Moolenaar84f72352012-03-11 15:57:40 +01006" 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 $
Bram Moolenaar071d4272004-06-13 20:20:40 +00009"
10" Lout: Basser Lout document formatting system.
11
Bram Moolenaar84f72352012-03-11 15:57:40 +010012" 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
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020019" quit when a syntax file was already loaded
20if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000021 finish
22endif
23
Bram Moolenaar84f72352012-03-11 15:57:40 +010024let s:cpo_save=&cpo
25set cpo&vim
26
Bram Moolenaar071d4272004-06-13 20:20:40 +000027" Lout is case sensitive
28syn case match
29
30" Synchronization, I know it is a huge number, but normal texts can be
31" _very_ long ;-)
32syn sync lines=1000
33
34" Characters allowed in keywords
35" I don't know if 128-255 are allowed in ANS-FORHT
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020036setlocal iskeyword=@,48-57,.,@-@,_,192-255
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
38" Some special keywords
39syn keyword loutTodo contained TODO lout Lout LOUT
40syn keyword loutDefine def macro
41
42" Some big structures
43syn keyword loutKeyword @Begin @End @Figure @Tab
44syn keyword loutKeyword @Book @Doc @Document @Report
45syn keyword loutKeyword @Introduction @Abstract @Appendix
46syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
47
48" All kind of Lout keywords
49syn match loutFunction '\<@[^ \t{}]\+\>'
50
51" Braces -- Don`t edit these lines!
52syn match loutMBraces '[{}]'
53syn match loutIBraces '[{}]'
54syn match loutBBrace '[{}]'
55syn match loutBIBraces '[{}]'
56syn match loutHeads '[{}]'
57
58" Unmatched braces.
59syn match loutBraceError '}'
60
61" End of multi-line definitions, like @Document, @Report and @Book.
62syn match loutEOmlDef '^//$'
63
64" Grouping of parameters and objects.
65syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
66
67" The NULL object has a special meaning
68syn keyword loutNULL {}
69
70" Comments
71syn region loutComment start='\#' end='$' contains=loutTodo
72
73" Double quotes
74syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
75
76" ISO-LATIN-1 characters created with @Char, or Adobe symbols
77" created with @Sym
78syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
79
80" Include files
81syn match loutInclude '@IncludeGraphic\s\+\k\+'
82syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
83
84" Tags
85syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
86syn region loutTag start='@Tag\s*{' end='}'
87
88" Equations
89syn match loutMath '@Eq\s\+\k\+'
90syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
91"
92" Fonts
93syn match loutItalic '@I\s\+\k\+'
94syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
95syn match loutBold '@B\s\+\k\+'
96syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
97syn match loutBoldItalic '@BI\s\+\k\+'
98syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
99syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
100
101" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200102" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200104" The default methods for highlighting. Can be overrriden later.
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200105hi def link loutTodo Todo
106hi def link loutDefine Define
107hi def link loutEOmlDef Define
108hi def link loutFunction Function
109hi def link loutBraceError Error
110hi def link loutNULL Special
111hi def link loutComment Comment
112hi def link loutSpecial Special
113hi def link loutSymbols Character
114hi def link loutInclude Include
115hi def link loutKeyword Keyword
116hi def link loutTag Tag
117hi def link loutMath Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200119hi def link loutMBraces loutMath
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200120hi loutItalic term=italic cterm=italic gui=italic
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200121hi def link loutIBraces loutItalic
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200122hi loutBold term=bold cterm=bold gui=bold
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200123hi def link loutBBraces loutBold
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200124hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200125hi def link loutBIBraces loutBoldItalic
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200126hi loutHeadings term=bold cterm=bold guifg=indianred
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200127hi def link loutHeads loutHeadings
Bram Moolenaar071d4272004-06-13 20:20:40 +0000128
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
130let b:current_syntax = "lout"
131
Bram Moolenaar84f72352012-03-11 15:57:40 +0100132let &cpo=s:cpo_save
133unlet s:cpo_save
134
Bram Moolenaar071d4272004-06-13 20:20:40 +0000135" vim:ts=8:sw=4:nocindent:smartindent: