comparison runtime/syntax/desktop.vim @ 7:3fc0f57ecb91 v7.0001

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