blob: 6da75d630c57260f7fc6fbe53d62853594784140 [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
22
23" Define the default highlighting.
24" For version 5.7 and earlier: only when not done already
25" For version 5.8 and later: only when an item doesn't have highlighting yet
26if version >= 508 || !exists("did_po_syn_inits")
27 if version < 508
28 let did_po_syn_inits = 1
29 command -nargs=+ HiLink hi link <args>
30 else
31 command -nargs=+ HiLink hi def link <args>
32 endif
33
34 HiLink poComment Comment
35 HiLink poSources PreProc
36 HiLink poStatement Statement
37 HiLink poSpecial Special
38 HiLink poFormat poSpecial
39 HiLink poString String
40
41 delcommand HiLink
42endif
43
44let b:current_syntax = "po"
45
46" vim:set ts=8 sts=2 sw=2 noet: