annotate runtime/syntax/desktop.vim @ 2058:fb1222c880fc v7.2.344

updated for version 7.2.344 Problem: Can't compile on some systems Solution: Move the #ifdef outside of the mch_open macro. (Patrick Texier)
author Bram Moolenaar <bram@zimbu.org>
date Wed, 20 Jan 2010 21:41:47 +0100
parents 3fc0f57ecb91
children b73f9ed65072
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: .desktop, .directory files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " according to freedesktop.org specification 0.9.4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " http://pdx.freedesktop.org/Standards/desktop-entry-spec/desktop-entry-spec-0.9.4.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Last Change: 2004 May 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Version Info: desktop.vim 0.9.4-1.2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " This syntax file can be used to all *nix configuration files similar to dos
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. But
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " you can also enforce strict following of freedesktop.org standard for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " .desktop and .directory files . Set (eg. in vimrc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " let enforce_freedesktop_standard = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " and nonstandard extensions not following X- notation will not be highlighted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if exists("enforce_freedesktop_standard")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 let b:enforce_freedesktop_standard = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let b:enforce_freedesktop_standard = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " case on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " General
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if b:enforce_freedesktop_standard == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match dtNotStLabel "^.\{-}=\@=" nextgroup=dtDelim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match dtGroup /^\s*\[.*\]/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match dtComment /^\s*#.*$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match dtDelim /=/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Locale
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match dtLocale /^\s*\<\(Name\|GenericName\|Comment\|SwallowTitle\|Icon\|UnmountIcon\)\>.*/ contains=dtLocaleKey,dtLocaleName,dtDelim transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword dtLocaleKey Name GenericName Comment SwallowTitle Icon UnmountIcon nextgroup=dtLocaleName containedin=dtLocale
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match dtLocaleName /\(\[.\{-}\]\s*=\@=\|\)/ nextgroup=dtDelim containedin=dtLocale contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Numeric
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match dtNumeric /^\s*\<Version\>/ contains=dtNumericKey,dtDelim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword dtNumericKey Version nextgroup=dtDelim containedin=dtNumeric contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match dtBoolean /^\s*\<\(StartupNotify\|ReadOnly\|Terminal\|Hidden\|NoDisplay\)\>.*/ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword dtBooleanKey StartupNotify ReadOnly Terminal Hidden NoDisplay nextgroup=dtDelim containedin=dtBoolean contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword dtBooleanValue true false containedin=dtBoolean contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match dtString /^\s*\<\(Encoding\|Icon\|Path\|Actions\|FSType\|MountPoint\|UnmountIcon\|URL\|Categories\|OnlyShowIn\|NotShowIn\|StartupWMClass\|FilePattern\|MimeType\)\>.*/ contains=dtStringKey,dtDelim transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword dtStringKey Type Encoding TryExec Exec Path Actions FSType MountPoint URL Categories OnlyShowIn NotShowIn StartupWMClass FilePattern MimeType nextgroup=dtDelim containedin=dtString contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Exec
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match dtExec /^\s*\<\(Exec\|TryExec\|SwallowExec\)\>.*/ contains=dtExecKey,dtDelim,dtExecParam transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword dtExecKey Exec TryExec SwallowExec nextgroup=dtDelim containedin=dtExec contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match dtExecParam /%[fFuUnNdDickv]/ containedin=dtExec contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match dtType /^\s*\<Type\>.*/ contains=dtTypeKey,dtDelim,dtTypeValue transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword dtTypeKey Type nextgroup=dtDelim containedin=dtType contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword dtTypeValue Application Link FSDevice Directory containedin=dtType contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " X-Addition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match dtXAdd /^\s*X-.*/ contains=dtXAddKey,dtDelim transparent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match dtXAddKey /^\s*X-.\{-}\s*=\@=/ nextgroup=dtDelim containedin=dtXAdd contains=dtXLocale contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " Locale for X-Addition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match dtXLocale /\[.\{-}\]\s*=\@=/ containedin=dtXAddKey contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " Locale for all
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match dtALocale /\[.\{-}\]\s*=\@=/ containedin=ALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 if version >= 508 || !exists("did_desktop_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 let did_dosini_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink dtGroup Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink dtComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink dtDelim String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink dtLocaleKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink dtLocaleName Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink dtXLocale Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink dtALocale Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink dtNumericKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink dtBooleanKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink dtBooleanValue Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink dtStringKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink dtExecKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink dtExecParam Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink dtTypeKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink dtTypeValue Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink dtNotStLabel Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink dtXAddKey Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 let b:current_syntax = "desktop"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 " vim:ts=8