2 " Language: Gtk+ theme files `gtkrc'
3 " Maintainer: David Ne\v{c}as (Yeti), <yeti@physics.muni.cz>
4 " Last Change: 2001-05-13
5 " URI: http://physics.muni.cz/~yeti/download/gtkrc.vim
7 " Notes: Highlights [some] Gnome classes too.
9 " TODO: add `display' where appropriate
12 " React to possibly already-defined syntax.
13 " For version 5.x: Clear all syntax items unconditionally
14 " For version 6.x: Quit when a syntax file was already loaded
16 if exists("b:current_syntax")
26 syn match gtkrcComment "#.*$" contains=gtkrcFixme
27 syn keyword gtkrcFixme FIXME TODO XXX NOT contained
28 syn region gtkrcACString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=gtkrcWPathSpecial,gtkrcClassName,gtkrcClassNameGnome contained
29 syn region gtkrcBString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=gtkrcKeyMod contained
30 syn region gtkrcString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gtkrcPathSpecial,gtkrcRGBColor
31 "syn region gtkrcString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline contains=gtkrcPathSpecial,gtkrcRGBColor
32 syn match gtkrcPathSpecial "<parent>" contained
33 syn match gtkrcWPathSpecial "[*?.]" contained
34 "syn match gtkrcNumber "\(^\|\W\)\@<=\(\d\+\)\=\.\=\d\+"
35 "make it work with Vim 5:
36 syn match gtkrcNumber "^\(\d\+\)\=\.\=\d\+"
37 syn match gtkrcNumber "\W\(\d\+\)\=\.\=\d\+"lc=1
38 syn match gtkrcRGBColor "#\(\x\{12}\|\x\{9}\|\x\{6}\|\x\{3}\)" contained
39 syn cluster gtkrcPRIVATE add=gtkrcFixme,gtkrcPathSpecial,gtkrcWPathSpecial,gtkrcRGBColor,gtkrcACString
42 syn keyword gtkrcInclude include
43 syn keyword gtkrcPathSet module_path pixmap_path
44 syn keyword gtkrcTop binding style
45 syn keyword gtkrcTop widget widget_class nextgroup=gtkrcACString skipwhite
46 syn keyword gtkrcTop class nextgroup=gtkrcACString skipwhite
47 syn keyword gtkrcBind bind nextgroup=gtkrcBString skipwhite
48 syn keyword gtkrcStateName = NORMAL INSENSITIVE PRELIGHT ACTIVE SELECTED
49 syn keyword gtkrcPriorityName = HIGHEST RC APPLICATION GTK LOWEST
50 syn keyword gtkrcStyleKeyword fg bg fg_pixmap bg_pixmap bg_text base font fontset text
51 syn match gtkrcKeyMod "<\(alt\|ctrl\|control\|mod[1-5]\|release\|shft\|shift\)>" contained
52 syn cluster gtkrcPRIVATE add=gtkrcKeyMod
54 " Enums and engine words {{{
55 " FIXME: many other words could appear here, does it make sense to include
57 syn keyword gtkrcKeyword engine image
58 syn keyword gtkrcImage arrow_direction border detail file gap_border gap_end_border gap_end_file gap_file gap_side gap_side gap_start_border gap_start_file orientation overlay_border overlay_file overlay_stretch recolorable shadow state stretch thickness
59 syn keyword gtkrcConstant TRUE FALSE NONE IN OUT LEFT RIGHT TOP BOTTOM UP DOWN VERTICAL HORIZONTAL ETCHED_IN ETCHED_OUT
60 syn keyword gtkrcFunction function nextgroup=gtkrcFunctionEq skipwhite
61 syn match gtkrcFunctionEq "=" nextgroup=gtkrcFunctionName contained skipwhite
62 syn keyword gtkrcFunctionName ARROW BOX BOX_GAP CHECK CROSS DIAMOND EXTENSION FLAT_BOX FOCUS HANDLE HLINE OPTION OVAL POLYGON RAMP SHADOW SHADOW_GAP SLIDER STRING TAB VLINE contained
63 syn cluster gtkrcPRIVATE add=gtkrcFunctionName,gtkrcFunctionEq
66 " (last synced with Gtk+ 1.2.10 and Gnome 1.4)
67 syn keyword gtkrcClassName GtkObject GtkWidget GtkMisc GtkLabel GtkAccelLabel GtkTipsQuery GtkArrow GtkImage GtkPixmap GtkContainer GtkBin GtkAlignment GtkFrame GtkAspectFrame GtkButton GtkToggleButton GtkCheckButton GtkRadioButton GtkOptionMenu GtkItem GtkMenuItem GtkCheckMenuItem GtkRadioMenuItem GtkTearoffMenuItem GtkListItem GtkTreeItem GtkWindow GtkColorSelectionDialog GtkDialog GtkInputDialog GtkFileSelection GtkFontSelectionDialog GtkPlug GtkEventBox GtkHandleBox GtkScrolledWindow GtkViewport GtkBox GtkButtonBox GtkHButtonBox GtkVButtonBox GtkVBox GtkColorSelection GtkGammaCurve GtkHBox GtkCombo GtkStatusbar GtkCList GtkCTree GtkFixed GtkNotebook GtkFontSelection GtkPaned GtkHPaned GtkVPaned GtkLayout GtkList GtkMenuShell GtkMenu GtkMenuBar GtkPacker GtkSocket GtkTable GtkToolbar GtkTree GtkCalendar GtkDrawingArea GtkCurve GtkEditable GtkEntry GtkSpinButton GtkText GtkRuler GtkHRuler GtkVRuler GtkRange GtkScale GtkHScale GtkVScale GtkScrollbar GtkHScrollbar GtkVScrollbar GtkSeparator GtkHSeparator GtkVSeparator GtkInvisible GtkPreview GtkProgress GtkProgressBar GtkData GtkAdjustment GtkTooltips GtkItemFactory contained
68 syn keyword gtkrcClassNameGnome GnomeAbout GnomeAnimator GnomeApp GnomeAppBar GnomeCalculator GnomeCanvas GnomeCanvasEllipse GnomeCanvasGroup GnomeCanvasImage GnomeCanvasItem GnomeCanvasLine GnomeCanvasPolygon GnomeCanvasRE GnomeCanvasRect GnomeCanvasText GnomeCanvasWidget GnomeClient GnomeColorPicker GnomeDEntryEdit GnomeDateEdit GnomeDialog GnomeDock GnomeDockBand GnomeDockItem GnomeDockLayout GnomeDruid GnomeDruidPage GnomeDruidPageFinish GnomeDruidPageStandard GnomeDruidPageStart GnomeEntry GnomeFileEntry GnomeFontPicker GnomeFontSelector GnomeHRef GnomeIconEntry GnomeIconList GnomeIconSelection GnomeIconTextItem GnomeLess GnomeMDI GnomeMDIChild GnomeMDIGenericChild GnomeMessageBox GnomeNumberEntry GnomePaperSelector GnomePixmap GnomePixmapEntry GnomeProcBar GnomePropertyBox GnomeScores GnomeSpell GnomeStock GtkClock GtkDial GtkPixmapMenuItem GtkTed contained
69 syn cluster gtkrcPRIVATE add=gtkrcClassName,gtkrcClassNameGnome
71 " Catch errors caused by wrong parenthesization {{{
73 syn region gtkrcParen start='(' end=')' transparent contains=ALLBUT,gtkrcParenError,@gtkrcPRIVATE
74 syn match gtkrcParenError ")"
75 " Idem for curly braces
76 syn region gtkrcBrace start='{' end='}' transparent contains=ALLBUT,gtkrcBraceError,@gtkrcPRIVATE
77 syn match gtkrcBraceError "}"
79 syn region gtkrcBracket start='\[' end=']' transparent contains=ALLBUT,gtkrcBracketError,@gtkrcPRIVATE
80 syn match gtkrcBracketError "]"
84 syn sync match gtkrcSyncClass groupthere NONE "^\s*class\>"
86 " Define the default highlighting {{{
87 " For version 5.7 and earlier: Only when not done already
88 " For version 5.8 and later: Only when an item doesn't have highlighting yet
89 if version >= 508 || !exists("did_gtkrc_syntax_inits")
91 let did_gtkrc_syntax_inits = 1
92 command -nargs=+ HiLink hi link <args>
94 command -nargs=+ HiLink hi def link <args>
97 HiLink gtkrcComment Comment
98 HiLink gtkrcFixme Todo
100 HiLink gtkrcInclude Preproc
102 HiLink gtkrcACString gtkrcString
103 HiLink gtkrcBString gtkrcString
104 HiLink gtkrcString String
105 HiLink gtkrcNumber Number
106 HiLink gtkrcStateName gtkrcConstant
107 HiLink gtkrcPriorityName gtkrcConstant
108 HiLink gtkrcConstant Constant
110 HiLink gtkrcPathSpecial gtkrcSpecial
111 HiLink gtkrcWPathSpecial gtkrcSpecial
112 HiLink gtkrcRGBColor gtkrcSpecial
113 HiLink gtkrcKeyMod gtkrcSpecial
114 HiLink gtkrcSpecial Special
116 HiLink gtkrcTop gtkrcKeyword
117 HiLink gtkrcPathSet gtkrcKeyword
118 HiLink gtkrcStyleKeyword gtkrcKeyword
119 HiLink gtkrcFunction gtkrcKeyword
120 HiLink gtkrcBind gtkrcKeyword
121 HiLink gtkrcKeyword Keyword
123 HiLink gtkrcClassNameGnome gtkrcGtkClass
124 HiLink gtkrcClassName gtkrcGtkClass
125 HiLink gtkrcFunctionName gtkrcGtkClass
126 HiLink gtkrcGtkClass Type
128 HiLink gtkrcImage gtkrcOtherword
129 HiLink gtkrcOtherword Function
131 HiLink gtkrcParenError gtkrcError
132 HiLink gtkrcBraceError gtkrcError
133 HiLink gtkrcBracketError gtkrcError
134 HiLink gtkrcError Error
137 let b:current_syntax = "gtkrc"