2 " Language: Fvwm{1,2} configuration file
3 " Maintainer: Haakon Riiser <haakon@riiser.net>
4 " Last Change: 2001 Apr 25
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " Fvwm configuration files are case insensitive
18 setlocal iskeyword=_,-,+,.,a-z,A-Z,48-57
20 set iskeyword=_,-,+,.,a-z,A-Z,48-57
23 " Read system colors from the color database (rgb.txt)
25 " We don't want any hit-return prompts, so we make sure that
26 " &shortmess is set to `O'
27 let __fvwm_oldshm = &shortmess
30 " And we set &report to a huge number, so that no hit-return prompts
32 let __fvwm_oldreport = &report
35 " Append the color database to the fvwm configuration, and read the
36 " colors from this buffer
37 let __fvwm_i = line("$") + 1
39 let __fvwm_lastline = line("$")
40 while __fvwm_i <= __fvwm_lastline
41 let __fvwm_s = matchstr(getline(__fvwm_i), '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\h.*$')
43 exe "syn keyword fvwmColors ".substitute(__fvwm_s, '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\h.*\)$', '\1', "")
45 let __fvwm_i = __fvwm_i + 1
48 " Remove the appended data
51 " Goto first line again
54 " and restore the old values of the variables
55 let &shortmess = __fvwm_oldshm
56 let &report = __fvwm_oldreport
57 unlet __fvwm_i __fvwm_s __fvwm_lastline __fvwm_oldshm __fvwm_oldreport
61 syn match fvwmWhitespace "\s\+" contained
62 syn match fvwmEnvVar "\$\w\+"
63 syn match fvwmModConf "^\s*\*\a\+" contains=fvwmWhitespace
64 syn match fvwmString '".\{-}"'
65 syn match fvwmRGBValue "#\x\{3}"
66 syn match fvwmRGBValue "#\x\{6}"
67 syn match fvwmRGBValue "#\x\{9}"
68 syn match fvwmRGBValue "#\x\{12}"
69 syn match fvwmRGBValue "rgb:\x\{1,4}/\x\{1,4}/\x\{1,4}"
70 syn match fvwmPath "\<IconPath\s.*$"lc=8 contains=fvwmEnvVar
71 syn match fvwmPath "\<ModulePath\s.*$"lc=10 contains=fvwmEnvVar
72 syn match fvwmPath "\<PixmapPath\s.*$"lc=10 contains=fvwmEnvVar
73 syn match fvwmModule "\<Module\s\+\w\+"he=s+6
74 syn match fvwmKey "\<Key\s\+\w\+"he=s+3
75 syn keyword fvwmExec Exec
76 syn match fvwmComment "^#.*$"
78 if (exists("b:fvwm_version") && b:fvwm_version == 1) || (exists("use_fvwm_1") && use_fvwm_1)
79 syn match fvwmEnvVar "\$(\w\+)"
80 syn region fvwmStyle matchgroup=fvwmFunction start="^\s*Style\>"hs=e-5 end="$" oneline keepend contains=fvwmString,fvwmKeyword,fvwmWhiteSpace
82 syn keyword fvwmFunction AppsBackingStore AutoRaise BackingStore
83 syn keyword fvwmFunction Beep BoundaryWidth ButtonStyle
84 syn keyword fvwmFunction CenterOnCirculate CirculateDown
85 syn keyword fvwmFunction CirculateHit CirculateSkip
86 syn keyword fvwmFunction CirculateSkipIcons CirculateUp
87 syn keyword fvwmFunction ClickTime ClickToFocus Close Cursor
88 syn keyword fvwmFunction CursorMove DecorateTransients Delete
89 syn keyword fvwmFunction Desk DeskTopScale DeskTopSize Destroy
90 syn keyword fvwmFunction DontMoveOff EdgeResistance EdgeScroll
91 syn keyword fvwmFunction EndFunction EndMenu EndPopup Focus
92 syn keyword fvwmFunction Font Function GotoPage HiBackColor
93 syn keyword fvwmFunction HiForeColor Icon IconBox IconFont
94 syn keyword fvwmFunction Iconify IconPath Key Lenience Lower
95 syn keyword fvwmFunction Maximize MenuBackColor MenuForeColor
96 syn keyword fvwmFunction MenuStippleColor Module ModulePath Mouse
97 syn keyword fvwmFunction Move MWMBorders MWMButtons MWMDecorHints
98 syn keyword fvwmFunction MWMFunctionHints MWMHintOverride MWMMenus
99 syn keyword fvwmFunction NoBorder NoBoundaryWidth Nop NoPPosition
100 syn keyword fvwmFunction NoTitle OpaqueMove OpaqueResize Pager
101 syn keyword fvwmFunction PagerBackColor PagerFont PagerForeColor
102 syn keyword fvwmFunction PagingDefault PixmapPath Popup Quit Raise
103 syn keyword fvwmFunction RaiseLower RandomPlacement Refresh Resize
104 syn keyword fvwmFunction Restart SaveUnders Scroll SloppyFocus
105 syn keyword fvwmFunction SmartPlacement StartsOnDesk StaysOnTop
106 syn keyword fvwmFunction StdBackColor StdForeColor Stick Sticky
107 syn keyword fvwmFunction StickyBackColor StickyForeColor
108 syn keyword fvwmFunction StickyIcons StubbornIconPlacement
109 syn keyword fvwmFunction StubbornIcons StubbornPlacement
110 syn keyword fvwmFunction SuppressIcons Title TogglePage Wait Warp
111 syn keyword fvwmFunction WindowFont WindowList WindowListSkip
112 syn keyword fvwmFunction WindowsDesk WindowShade XORvalue
114 " These keywords are only used after the "Style" command. To avoid
115 " name collision with several commands, they are contained.
116 syn keyword fvwmKeyword BackColor BorderWidth BoundaryWidth contained
117 syn keyword fvwmKeyword Button CirculateHit CirculateSkip Color contained
118 syn keyword fvwmKeyword DoubleClick ForeColor Handles HandleWidth contained
119 syn keyword fvwmKeyword Icon IconTitle NoBorder NoBoundaryWidth contained
120 syn keyword fvwmKeyword NoButton NoHandles NoIcon NoIconTitle contained
121 syn keyword fvwmKeyword NoTitle Slippery StartIconic StartNormal contained
122 syn keyword fvwmKeyword StartsAnyWhere StartsOnDesk StaysOnTop contained
123 syn keyword fvwmKeyword StaysPut Sticky Title WindowListHit contained
124 syn keyword fvwmKeyword WindowListSkip contained
125 elseif (exists("b:fvwm_version") && b:fvwm_version == 2) || (exists("use_fvwm_2") && use_fvwm_2)
126 syn match fvwmEnvVar "\${\w\+}"
127 syn match fvwmDef '^\s*+\s*".\{-}"' contains=fvwmMenuString,fvwmWhitespace
128 syn match fvwmIcon '%.\{-}%' contained
129 syn match fvwmIcon '\*.\{-}\*' contained
130 syn match fvwmMenuString '".\{-}"' contains=fvwmIcon,fvwmShortcutKey contained
131 syn match fvwmShortcutKey "&." contained
132 syn match fvwmModule "\<KillModule\s\+\w\+"he=s+10
133 syn match fvwmModule "\<SendToModule\s\+\w\+"he=s+12
134 syn match fvwmModule "\<DestroyModuleConfig\s\+\w\+"he=s+19
136 syn keyword fvwmFunction AddButtonStyle AddTitleStyle AddToDecor
137 syn keyword fvwmFunction AddToFunc AddToMenu AnimatedMove Beep
138 syn keyword fvwmFunction BorderStyle ButtonStyle ChangeDecor
139 syn keyword fvwmFunction ChangeMenuStyle ClickTime Close
140 syn keyword fvwmFunction ColorLimit ColormapFocus Current
141 syn keyword fvwmFunction CursorMove CursorStyle DefaultColors
142 syn keyword fvwmFunction DefaultFont Delete Desk DeskTopSize
143 syn keyword fvwmFunction Destroy DestroyDecor DestroyFunc
144 syn keyword fvwmFunction DestroyMenu DestroyMenuStyle Direction
145 syn keyword fvwmFunction Echo EdgeResistance EdgeScroll
146 syn keyword fvwmFunction EdgeThickness Emulate ExecUseShell
147 syn keyword fvwmFunction ExitFunction FlipFocus Focus Function
148 syn keyword fvwmFunction GlobalOpts GotoPage HilightColor IconFont
149 syn keyword fvwmFunction Iconify IconPath Lower Maximize Menu
150 syn keyword fvwmFunction MenuStyle ModulePath Mouse Move MoveToDesk
151 syn keyword fvwmFunction MoveToPage Next None Nop OpaqueMoveSize
152 syn keyword fvwmFunction PipeRead PixmapPath Popup Prev Quit
153 syn keyword fvwmFunction QuitScreen Raise RaiseLower Read Recapture
154 syn keyword fvwmFunction Refresh RefreshWindow Resize Restart
155 syn keyword fvwmFunction Scroll SetAnimation SetEnv SetMenuDelay
156 syn keyword fvwmFunction SetMenuStyle SnapAttraction SnapGrid
157 syn keyword fvwmFunction Stick Style Title TitleStyle UpdateDecor
158 syn keyword fvwmFunction Wait WarpToWindow WindowFont WindowId
159 syn keyword fvwmFunction WindowList WindowsDesk WindowShade
160 syn keyword fvwmFunction XORvalue
162 syn keyword fvwmKeyword Active ActiveDown ActiveFore
163 syn keyword fvwmKeyword ActiveForeOff ActivePlacement
164 syn keyword fvwmKeyword ActivePlacementHonorsStartsOnPage
165 syn keyword fvwmKeyword ActivePlacementIgnoresStartsOnPage
166 syn keyword fvwmKeyword ActiveUp All Alphabetic Animation
167 syn keyword fvwmKeyword AnimationOff BackColor Background
168 syn keyword fvwmKeyword BGradient BorderWidth Bottom
169 syn keyword fvwmKeyword Button CaptureHonorsStartsOnPage
170 syn keyword fvwmKeyword CaptureIgnoresStartsOnPage Centered
171 syn keyword fvwmKeyword CirculateHit CirculateHitIcon
172 syn keyword fvwmKeyword CirculateSkip CirculateSkipIcon Clear
173 syn keyword fvwmKeyword ClickToFocus ClickToFocusDoesntPassClick
174 syn keyword fvwmKeyword ClickToFocusDoesntRaise
175 syn keyword fvwmKeyword ClickToFocusPassesClick ClickToFocusRaises
176 syn keyword fvwmKeyword Color CurrentDesk CurrentPage
177 syn keyword fvwmKeyword CurrentPageAnyDesk DecorateTransient
178 syn keyword fvwmKeyword Default DGradient DoubleClickTime Down
179 syn keyword fvwmKeyword DumbPlacement East Flat FocusFollowsMouse
180 syn keyword fvwmKeyword FollowsFocus FollowsMouse Font ForeColor
181 syn keyword fvwmKeyword Foreground FVWM FvwmBorder FvwmButtons
182 syn keyword fvwmKeyword Greyed Handles HandleWidth Height
183 syn keyword fvwmKeyword HGradient HiddenHandles Hilight3DOff
184 syn keyword fvwmKeyword Hilight3DThick Hilight3DThin HilightBack
185 syn keyword fvwmKeyword HilightBackOff HintOverride Icon IconBox
186 syn keyword fvwmKeyword IconFill IconGrid Iconic Icons IconTitle
187 syn keyword fvwmKeyword Inactive Interior Item Left LeftJustified
188 syn keyword fvwmKeyword Lenience Maximized MenuFace MiniIcon
189 syn keyword fvwmKeyword MouseFocus MouseFocusClickDoesntRaise
190 syn keyword fvwmKeyword MouseFocusClickRaises MWM MWMBorder
191 syn keyword fvwmKeyword MWMButtons MWMDecor MWMDecorMax
192 syn keyword fvwmKeyword MWMDecorMenu MWMDecorMin MWMFunctions
193 syn keyword fvwmKeyword NakedTransient NoButton NoDecorHint
194 syn keyword fvwmKeyword NoDeskSort NoFuncHint NoGeometry
195 syn keyword fvwmKeyword NoHandles NoIcon NoIcons NoIconTitle
196 syn keyword fvwmKeyword NoInset NoLenience NoNormal NoOLDecor
197 syn keyword fvwmKeyword NoOnTop NoOverride NoPPosition
198 syn keyword fvwmKeyword Normal North Northeast Northwest
199 syn keyword fvwmKeyword NoSticky NoStipledTitles NotAlphabetic
200 syn keyword fvwmKeyword NoTitle NoWarp OLDecor Once OnlyIcons
201 syn keyword fvwmKeyword OnlyNormal OnlyOnTop OnlySticky
202 syn keyword fvwmKeyword OnTop Pixmap PopupDelay PopupDelayed
203 syn keyword fvwmKeyword PopupImmediately PopupOffset Quiet
204 syn keyword fvwmKeyword Raised RecaptureHonorsStartsOnPage
205 syn keyword fvwmKeyword RecaptureIgnoresStartsOnPage Rectangle
206 syn keyword fvwmKeyword Reset Right RightJustified Root
207 syn keyword fvwmKeyword SameType SelectInPlace SelectWarp
208 syn keyword fvwmKeyword SeparatorsLong SeparatorsShort ShowMapping
209 syn keyword fvwmKeyword SideColor SidePic Simple SkipMapping
210 syn keyword fvwmKeyword Slippery SlipperyIcon SloppyFocus
211 syn keyword fvwmKeyword SmartPlacement SmartPlacementIsNormal
212 syn keyword fvwmKeyword SmartPlacementIsReallySmart Solid
213 syn keyword fvwmKeyword South Southeast Southwest StartIconic
214 syn keyword fvwmKeyword StartNormal StartsAnyWhere StartsOnDesk
215 syn keyword fvwmKeyword StartsOnPage StaysOnTop StaysPut
216 syn keyword fvwmKeyword Sticky StickyIcon StipledTitles Sunk
217 syn keyword fvwmKeyword TiledPixmap Title TitleUnderlines0
218 syn keyword fvwmKeyword TitleUnderlines1 TitleUnderlines2
219 syn keyword fvwmKeyword TitleWarp TitleWarpOff Top Transient
220 syn keyword fvwmKeyword TrianglesRelief TrianglesSolid Up
221 syn keyword fvwmKeyword UseBorderStyle UseDecor UseIconName
222 syn keyword fvwmKeyword UsePPosition UseStyle UseTitleStyle
223 syn keyword fvwmKeyword Vector VGradient Warp WarpTitle West
224 syn keyword fvwmKeyword WIN WindowListHit WindowListSkip Windows
227 if version >= 508 || !exists("did_fvwm_syntax_inits")
229 let did_fvwm_syntax_inits = 1
230 command -nargs=+ HiLink hi link <args>
232 command -nargs=+ HiLink hi def link <args>
235 HiLink fvwmComment Comment
236 HiLink fvwmEnvVar Macro
237 HiLink fvwmExec Function
238 HiLink fvwmFunction Function
239 HiLink fvwmIcon Comment
240 HiLink fvwmKey Function
241 HiLink fvwmKeyword Keyword
242 HiLink fvwmMenuString String
243 HiLink fvwmModConf Macro
244 HiLink fvwmModule Function
245 HiLink fvwmRGBValue Type
246 HiLink fvwmShortcutKey SpecialChar
247 HiLink fvwmString String
249 if exists("rgb_file")
250 HiLink fvwmColors Type
256 let b:current_syntax = "fvwm"
257 " vim: sts=4 sw=4 ts=8