mcabber/contrib/vim/mcabber_log-syntax.vim
author Mikael Berthe <mikael@lilotux.net>
Tue, 30 May 2023 16:37:46 +0200
changeset 2366 480585fec48a
parent 2364 ca442ece1f70
permissions -rw-r--r--
Update spell checking section in the configuration file
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1851
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
" Vim syntax file
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
" Language:	MCabber log file
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
" Maintainer:	Mikael BERTHE <mikael.berthe@lilotux.net>
2364
ca442ece1f70 Switch website URLs to HTTPS
Mikael Berthe <mikael@lilotux.net>
parents: 1853
diff changeset
     4
" URL:		Included in mcabber source package <https://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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
"
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
" Logfile format:
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
" TT YYYYmmddTHH:MM:SSZ nnn Text (this line and the nnn following lines)
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
" TT is the data type
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
" 'YYYYmmddTHH:MM:SSZ' is a timestamp
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
"
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
" XXX Please help me to improve this syntax script!
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
if exists("b:current_syntax")
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
    finish
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
endif
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
syn match mcabberlogDateChar /[TZ]/ contained
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    56
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    57
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    58
command -nargs=+ HiLink hi def link <args>
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    59
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    60
HiLink mcabberlogStatus     PreProc
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    61
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    62
HiLink mcabberlogMessageLineIn      Keyword
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    63
HiLink mcabberlogMsgIn              Keyword
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    64
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    65
HiLink mcabberlogMessageLineOut     Function
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    66
HiLink mcabberlogMsgOut             Function
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    67
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    68
HiLink mcabberlogMsgInfo            String
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    69
HiLink mcabberlogMessageLineInfo    String
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    70
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    71
HiLink mcabberlogDate       SpecialChar
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    72
HiLink mcabberlogDateChar   Normal
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    73
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    74
HiLink mcabberlognlines     Normal
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    75
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    76
HiLink mcabberlogStatusLine Comment
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    77
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    78
delcommand HiLink
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
95b4373a57a4 Add Vim color syntax file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    80
let b:current_syntax = "mcabber_log"