blob: 798b48f72792c407f1aa596b5ba2be9765632f20 [file] [log] [blame]
Ronan Pigott1e5d6642023-12-04 20:46:15 +01001" Vim syntax file
2" Language: pacman.log
3" Maintainer: Ronan Pigott <ronan@rjp.ie>
4" Last Change: 2023 Dec 04
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +02005" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
Ronan Pigott1e5d6642023-12-04 20:46:15 +01006
7if exists("b:current_syntax")
8 finish
9endif
10
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020011let s:cpo_save = &cpo
12set cpo&vim
13
Ronan Pigott1e5d6642023-12-04 20:46:15 +010014syn sync maxlines=1
15syn region pacmanlogMsg start='\S' end='$' keepend contains=pacmanlogTransaction,pacmanlogALPMMsg
16syn region pacmanlogTag start='\['hs=s+1 end='\]'he=e-1 keepend nextgroup=pacmanlogMsg
17syn region pacmanlogTime start='^\['hs=s+1 end='\]'he=e-1 keepend nextgroup=pacmanlogTag
18
19syn match pacmanlogPackageName '\v[a-z0-9@_+.-]+' contained skipwhite nextgroup=pacmanlogPackageVersion
20syn match pacmanlogPackageVersion '(.*)' contained
21
22syn match pacmanlogTransaction 'transaction \v(started|completed)$' contained
23syn match pacmanlogInstalled '\v(re)?installed' contained nextgroup=pacmanlogPackageName
24syn match pacmanlogUpgraded 'upgraded' contained nextgroup=pacmanlogPackageName
25syn match pacmanlogDowngraded 'downgraded' contained nextgroup=pacmanlogPackageName
26syn match pacmanlogRemoved 'removed' contained nextgroup=pacmanlogPackageName
27syn match pacmanlogWarning 'warning:.*$' contained
28
29syn region pacmanlogALPMMsg start='\v(\[ALPM\] )@<=(transaction|(re)?installed|upgraded|downgraded|removed|warning)>' end='$' contained
30 \ contains=pacmanlogTransaction,pacmanlogInstalled,pacmanlogUpgraded,pacmanlogDowngraded,pacmanlogRemoved,pacmanlogWarning,pacmanlogPackageName,pacmanlogPackgeVersion
31
32hi def link pacmanlogTime String
33hi def link pacmanlogTag Type
34
35hi def link pacmanlogTransaction Special
36hi def link pacmanlogInstalled Identifier
37hi def link pacmanlogRemoved Repeat
38hi def link pacmanlogUpgraded pacmanlogInstalled
39hi def link pacmanlogDowngraded pacmanlogRemoved
40hi def link pacmanlogWarning WarningMsg
41
42hi def link pacmanlogPackageName Normal
43hi def link pacmanlogPackageVersion Comment
44
45let b:current_syntax = "pacmanlog"
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020046
47let &cpo = s:cpo_save
48unlet s:cpo_save