Mercurial > vim
annotate runtime/syntax/desktop.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | b73f9ed65072 |
children | 46763b01cd9a |
rev | line source |
---|---|
7 | 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 ) | |
8869
b73f9ed65072
commit https://github.com/vim/vim/commit/939a1abe935a539f2d4c90a56cb0682cbaf3bbb0
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
6 " Last Change: 2016 Apr 02 |
b73f9ed65072
commit https://github.com/vim/vim/commit/939a1abe935a539f2d4c90a56cb0682cbaf3bbb0
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
7 " (added "Keywords") |
7 | 8 " Version Info: desktop.vim 0.9.4-1.2 |
9 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
10 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 | |
15 " This syntax file can be used to all *nix configuration files similar to dos | |
16 " ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. But | |
17 " you can also enforce strict following of freedesktop.org standard for | |
18 " .desktop and .directory files . Set (eg. in vimrc) | |
19 " let enforce_freedesktop_standard = 1 | |
20 " and nonstandard extensions not following X- notation will not be highlighted. | |
21 if exists("enforce_freedesktop_standard") | |
22 let b:enforce_freedesktop_standard = 1 | |
23 else | |
24 let b:enforce_freedesktop_standard = 0 | |
25 endif | |
26 | |
27 " case on | |
28 syn case match | |
29 | |
30 " General | |
31 if b:enforce_freedesktop_standard == 0 | |
32 syn match dtNotStLabel "^.\{-}=\@=" nextgroup=dtDelim | |
33 endif | |
34 | |
35 syn match dtGroup /^\s*\[.*\]/ | |
36 syn match dtComment /^\s*#.*$/ | |
37 syn match dtDelim /=/ contained | |
38 | |
39 " Locale | |
40 syn match dtLocale /^\s*\<\(Name\|GenericName\|Comment\|SwallowTitle\|Icon\|UnmountIcon\)\>.*/ contains=dtLocaleKey,dtLocaleName,dtDelim transparent | |
41 syn keyword dtLocaleKey Name GenericName Comment SwallowTitle Icon UnmountIcon nextgroup=dtLocaleName containedin=dtLocale | |
42 syn match dtLocaleName /\(\[.\{-}\]\s*=\@=\|\)/ nextgroup=dtDelim containedin=dtLocale contained | |
43 | |
44 " Numeric | |
45 syn match dtNumeric /^\s*\<Version\>/ contains=dtNumericKey,dtDelim | |
46 syn keyword dtNumericKey Version nextgroup=dtDelim containedin=dtNumeric contained | |
47 | |
48 " Boolean | |
49 syn match dtBoolean /^\s*\<\(StartupNotify\|ReadOnly\|Terminal\|Hidden\|NoDisplay\)\>.*/ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent | |
50 syn keyword dtBooleanKey StartupNotify ReadOnly Terminal Hidden NoDisplay nextgroup=dtDelim containedin=dtBoolean contained | |
51 syn keyword dtBooleanValue true false containedin=dtBoolean contained | |
52 | |
53 " String | |
8869
b73f9ed65072
commit https://github.com/vim/vim/commit/939a1abe935a539f2d4c90a56cb0682cbaf3bbb0
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
54 syn match dtString /^\s*\<\(Encoding\|Icon\|Path\|Actions\|FSType\|MountPoint\|UnmountIcon\|URL\|Keywords\|Categories\|OnlyShowIn\|NotShowIn\|StartupWMClass\|FilePattern\|MimeType\)\>.*/ contains=dtStringKey,dtDelim transparent |
b73f9ed65072
commit https://github.com/vim/vim/commit/939a1abe935a539f2d4c90a56cb0682cbaf3bbb0
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
55 syn keyword dtStringKey Type Encoding TryExec Exec Path Actions FSType MountPoint URL Keywords Categories OnlyShowIn NotShowIn StartupWMClass FilePattern MimeType nextgroup=dtDelim containedin=dtString contained |
7 | 56 |
57 " Exec | |
58 syn match dtExec /^\s*\<\(Exec\|TryExec\|SwallowExec\)\>.*/ contains=dtExecKey,dtDelim,dtExecParam transparent | |
59 syn keyword dtExecKey Exec TryExec SwallowExec nextgroup=dtDelim containedin=dtExec contained | |
60 syn match dtExecParam /%[fFuUnNdDickv]/ containedin=dtExec contained | |
61 | |
62 " Type | |
63 syn match dtType /^\s*\<Type\>.*/ contains=dtTypeKey,dtDelim,dtTypeValue transparent | |
64 syn keyword dtTypeKey Type nextgroup=dtDelim containedin=dtType contained | |
65 syn keyword dtTypeValue Application Link FSDevice Directory containedin=dtType contained | |
66 | |
67 " X-Addition | |
68 syn match dtXAdd /^\s*X-.*/ contains=dtXAddKey,dtDelim transparent | |
69 syn match dtXAddKey /^\s*X-.\{-}\s*=\@=/ nextgroup=dtDelim containedin=dtXAdd contains=dtXLocale contained | |
70 | |
71 " Locale for X-Addition | |
72 syn match dtXLocale /\[.\{-}\]\s*=\@=/ containedin=dtXAddKey contained | |
73 | |
74 " Locale for all | |
75 syn match dtALocale /\[.\{-}\]\s*=\@=/ containedin=ALL | |
76 | |
77 | |
78 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
79 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
80 command -nargs=+ HiLink hi def link <args> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
81 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
82 HiLink dtGroup Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
83 HiLink dtComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
84 HiLink dtDelim String |
7 | 85 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
86 HiLink dtLocaleKey Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
87 HiLink dtLocaleName Identifier |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
88 HiLink dtXLocale Identifier |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
89 HiLink dtALocale Identifier |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
90 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
91 HiLink dtNumericKey Type |
7 | 92 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
93 HiLink dtBooleanKey Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
94 HiLink dtBooleanValue Constant |
7 | 95 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
96 HiLink dtStringKey Type |
7 | 97 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
98 HiLink dtExecKey Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
99 HiLink dtExecParam Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
100 HiLink dtTypeKey Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
101 HiLink dtTypeValue Constant |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
102 HiLink dtNotStLabel Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
103 HiLink dtXAddKey Type |
7 | 104 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
8869
diff
changeset
|
105 delcommand HiLink |
7 | 106 |
107 let b:current_syntax = "desktop" | |
108 | |
109 " vim:ts=8 |