Mercurial > hg
annotate mcabber/contrib/vim/mcabber_log-syntax.vim @ 2280:f1eebfdd6db7
Improve efficiency with high number of MUC resources
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 24 Sep 2016 12:31:13 +0200 |
parents | 32bceb73895c |
children | ca442ece1f70 |
rev | line source |
---|---|
1851 | 1 " Vim syntax file |
2 " Language: MCabber log file | |
3 " Maintainer: Mikael BERTHE <mikael.berthe@lilotux.net> | |
4 " URL: Included in mcabber source package <http://mcabber.com> | |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
5 " Last Change: 2010-04-02 |
1851 | 6 |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
7 " Save this file as ~/.vim/syntax/mcabber_log.vim |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
8 " (and copy the ftdetect file as well) |
1851 | 9 " |
10 " Logfile format: | |
11 " TT YYYYmmddTHH:MM:SSZ nnn Text (this line and the nnn following lines) | |
12 " TT is the data type | |
13 " 'YYYYmmddTHH:MM:SSZ' is a timestamp | |
14 " | |
15 " XXX Please help me to improve this syntax script! | |
16 | |
17 if exists("b:current_syntax") | |
18 finish | |
19 endif | |
20 | |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
21 " All lines (except text continuation lines) contain the date and nnn |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
22 syn cluster mcabberlogEntry contains=mcabberlogDate,mcabberlognlines |
1851 | 23 |
24 syn region mcabberlogStatusLine | |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
25 \ start="^S[OFDNAI_] \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
26 \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
27 \ contains=mcabberlogStatus,@mcabberlogEntry |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
28 |
1851 | 29 syn region mcabberlogMessageLineInfo |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
30 \ start="^MI \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
31 \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
32 \ contains=mcabberlogMsgInfo,@mcabberlogEntry |
1851 | 33 syn region mcabberlogMessageLineIn |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
34 \ start="^MR \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
35 \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
36 \ contains=mcabberlogMsgIn,@mcabberlogEntry |
1851 | 37 syn region mcabberlogMessageLineOut |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
38 \ start="^MS \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
39 \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
40 \ contains=mcabberlogMsgOut,@mcabberlogEntry |
1851 | 41 |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
42 syn match mcabberlogDate "\d\{8\}T\d\d:\d\d:\d\dZ" contained |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
43 \ contains=mcabberlogDateChar nextgroup=mcabberlognlines |
1851 | 44 syn match mcabberlogDateChar /[TZ]/ contained |
45 | |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
46 syn match mcabberlogStatus "^S[OFDNAI_]" |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
47 \ contained skipwhite nextgroup=@mcabberlogStatusLine |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
48 syn match mcabberlogMsgIn "^MR" contained skipwhite |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
49 \ nextgroup=@mcabberlogMessageLine |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
50 syn match mcabberlogMsgOut "^MS" contained skipwhite |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
51 \ nextgroup=@mcabberlogMessageLine |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
52 syn match mcabberlogMsgInfo "^MI" contained skipwhite |
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
53 \ nextgroup=@mcabberlogMessageLine |
1851 | 54 |
1853
32bceb73895c
Update Vim syntax script, add a ftdetect script
Mikael Berthe <mikael@lilotux.net>
parents:
1851
diff
changeset
|
55 syn match mcabberlognlines "\<\d\{3\}\>" contained |
1851 | 56 |
57 | |
58 command -nargs=+ HiLink hi def link <args> | |
59 | |
60 HiLink mcabberlogStatus PreProc | |
61 | |
62 HiLink mcabberlogMessageLineIn Keyword | |
63 HiLink mcabberlogMsgIn Keyword | |
64 | |
65 HiLink mcabberlogMessageLineOut Function | |
66 HiLink mcabberlogMsgOut Function | |
67 | |
68 HiLink mcabberlogMsgInfo String | |
69 HiLink mcabberlogMessageLineInfo String | |
70 | |
71 HiLink mcabberlogDate SpecialChar | |
72 HiLink mcabberlogDateChar Normal | |
73 | |
74 HiLink mcabberlognlines Normal | |
75 | |
76 HiLink mcabberlogStatusLine Comment | |
77 | |
78 delcommand HiLink | |
79 | |
80 let b:current_syntax = "mcabber_log" |