summaryrefslogtreecommitdiffstats
path: root/kate/data/modelines.xml
blob: a7566f33055ab4134bb060de764c5f8c8661b10c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
    <!ENTITY space " ">
    <!ENTITY end "&#59;">
]>
<!--
  Copyright (c) 2012-2014 by Alex Turbov (i.zaufi@gmail.com)
  -->
<language name="Modelines"
          version="1.2-1"
          kateversion="2.4"
          section="Other"
          extensions=""
          mimetype=""
          author="Alex Turbov (i.zaufi@gmail.com)"
          license="LGPL"
          hidden="true"
          priority="5">
<!--
  The main purpose of this file is to be included into other syntax files.

  NOTE Default colors are set to 'Comment', so if u don't want to highight it,
  just leave colors as is...

  TODO Support for other modelines? emacs/vim??
-->
<highlighting>
  <list name="ModelineStartKeyword">
    <item> kate: </item>
  </list>

  <list name="Booleans">
    <!-- NOTE Deprecated -->
    <!-- <item> auto-brackets </item> -->
    <item> auto-insert-doxygen </item>
    <item> automatic-spell-checking </item>                 <!-- NOTE Since KDE 4.?? -->
    <item> backspace-indents </item>
    <item> block-selection </item>
    <item> bookmark-sorting </item>
    <item> bom </item>
    <item> byte-order-marker </item>
    <item> dynamic-word-wrap </item>
    <item> folding-markers </item>
    <item> icon-border </item>
    <item> indent-pasted-text </item>                       <!-- Since KDE 4.11 -->
    <item> keep-extra-spaces </item>
    <item> line-numbers </item>
    <item> newline-at-eof </item>                           <!-- Since KDE 4.9 -->
    <item> overwrite-mode </item>
    <item> persistent-selection </item>
    <!-- NOTE Deprecated -->
    <!-- <item> remove-trailing-space </item> -->
    <item> replace-tabs-save </item>
    <item> replace-tabs </item>
    <item> replace-trailing-space-save </item>
    <item> smart-home </item>
    <item> space-indent </item>
    <item> show-tabs </item>
    <item> show-trailing-spaces </item>                     <!-- NOTE Since KDE 4.?? -->
    <item> tab-indents </item>
    <item> word-wrap </item>
    <item> wrap-cursor </item>
  </list>

  <list name="True">
    <item> on </item>
    <item> true </item>
    <item> 1 </item>
  </list>

  <list name="False">
    <item> off </item>
    <item> false </item>
    <item> 0 </item>
  </list>

  <list name="Integrals">
    <item> auto-center-lines </item>
    <item> font-size </item>
    <item> indent-mode </item>
    <item> indent-width </item>
    <item> tab-width </item>
    <item> undo-steps </item>
    <item> word-wrap-column </item>
  </list>

  <list name="Strings">
    <item> background-color </item>
    <item> bracket-highlight-color </item>
    <item> current-line-color </item>
    <item> default-dictionary </item>
    <item> encoding </item>                                 <!-- NOTE Since KDE 4.?? -->
    <item> eol </item>                                      <!-- Valid settings are unix, mac and dos -->
    <item> end-of-line </item>                              <!-- Valid settings are unix, mac and dos -->
    <item> font </item>
    <item> hl </item>
    <item> icon-bar-color </item>
    <item> mode </item>                                     <!-- NOTE Since KDE 4.?? -->
    <item> scheme </item>
    <item> selection-color </item>
    <item> syntax </item>
    <item> word-wrap-marker-color </item>
  </list>

  <list name="RemoveSpaces">
    <item> remove-trailing-spaces </item>
  </list>

  <list name="RemoveSpacesOptions">
    <item> 0 </item>
    <item> - </item>
    <item> none </item>

    <item> modified </item>
    <item> mod </item>
    <item> + </item>
    <item> 1 </item>

    <item> all </item>
    <item> * </item>
    <item> 2 </item>
  </list>

  <contexts>
    <context name="Normal" attribute="Comment" lineEndContext="#pop">
      <DetectSpaces />
      <keyword String="ModelineStartKeyword" context="Modeline" attribute="Keyword" />
      <RegExpr String="kate-(mimetype|wildcard)\(.*\):" context="Modeline" attribute="Keyword" />
      <LineContinue context="#pop" />
    </context>

    <context name="Modeline" attribute="Comment" lineEndContext="#pop">
      <DetectSpaces />
      <keyword String="Booleans" context="Booleans" attribute="Variable" />
      <keyword String="Integrals" context="Integrals" attribute="Variable" />
      <keyword String="Strings" context="Strings" attribute="Variable" />
      <keyword String="RemoveSpaces" context="RemoveSpaces" attribute="Variable" />
      <LineContinue context="#pop" />
    </context>

    <context name="Booleans" attribute="Comment" lineEndContext="#pop">
      <DetectSpaces />
      <keyword String="True" attribute="Option ON" context="#stay" />
      <keyword String="False" attribute="Option OFF" context="#stay" />
      <DetectChar char="&end;" context="#pop" attribute="Variable" />
      <LineContinue context="#pop" />
    </context>

    <context name="Integrals" attribute="Comment" lineEndContext="#pop">
      <DetectSpaces />
      <Int attribute="Number" context="#stay" />
      <DetectChar char="&end;" context="#pop" attribute="Variable" />
      <LineContinue context="#pop" />
    </context>

    <context name="Strings" attribute="String" lineEndContext="#pop">
      <DetectSpaces />
      <RegExpr String="[^&end;&space;]" context="#stay" />
      <DetectChar char="&end;" context="#pop" attribute="Variable" />
      <LineContinue context="#pop" />
    </context>

    <context name="RemoveSpaces" attribute="Comment" lineEndContext="#pop">
      <DetectSpaces />
      <keyword String="RemoveSpacesOptions" attribute="Value" context="#pop" />
      <DetectChar char="&end;" context="#pop" attribute="Variable" />
      <LineContinue context="#pop" />
    </context>

  </contexts>

  <itemDatas>
    <itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
    <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" />
    <itemData name="Variable" defStyleNum="dsFunction" spellChecking="false" />
    <itemData name="Number" defStyleNum="dsDecVal" spellChecking="false" />
    <itemData name="String" defStyleNum="dsString" spellChecking="false" />
    <itemData name="Value" defStyleNum="dsOthers" spellChecking="false" />
    <itemData name="Option ON" defStyleNum="dsOthers" spellChecking="false" />
    <itemData name="Option OFF" defStyleNum="dsOthers" spellChecking="false" />
  </itemDatas>

</highlighting>

<general>
  <keywords casesensitive="1" weakDeliminator=":-" />
</general>

</language>
<!-- kate: indent-width 2; -->