blob: 4c1aac12efdf9dde32891d001b5fabd5d160c997 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: po (gettext)
3" Maintainer: Nam SungHyun <namsh@kldp.org>
4" Last Change: 2001 Apr 26
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14syn match poComment "^#.*$"
15syn match poSources "^#:.*$"
16syn match poStatement "^\(domain\|msgid\|msgstr\)"
17syn match poSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
18syn match poFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
19syn match poFormat "%%" contained
20syn region poString start=+"+ skip=+\\\\\|\\"+ end=+"+
21 \ contains=poSpecial,poFormat
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000022syn region poFuzzy start=+^#,\sfuzzy+ end=+^$+
23syn match poUntranslated +^msgstr\s""\n\n+
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
25" Define the default highlighting.
26" For version 5.7 and earlier: only when not done already
27" For version 5.8 and later: only when an item doesn't have highlighting yet
28if version >= 508 || !exists("did_po_syn_inits")
29 if version < 508
30 let did_po_syn_inits = 1
31 command -nargs=+ HiLink hi link <args>
32 else
33 command -nargs=+ HiLink hi def link <args>
34 endif
35
36 HiLink poComment Comment
37 HiLink poSources PreProc
38 HiLink poStatement Statement
39 HiLink poSpecial Special
40 HiLink poFormat poSpecial
41 HiLink poString String
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000042 HiLink poFuzzy Todo
43 HiLink poUntranslated Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +000044
45 delcommand HiLink
46endif
47
48let b:current_syntax = "po"
49
50" vim:set ts=8 sts=2 sw=2 noet: