summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2012-10-04 10:57:11 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2012-10-04 10:57:11 -0400
commit222f82fa0ce89acbe47cc5b0f57ec470dfc9faaf (patch)
tree53230be8311987d447b0f4bf7742445f1414abe7
parentdb7cf81a503f637eb85e2dfe63e515252d22a2ba (diff)
Add VIM LITMUS^RT log syntax highlighting.
-rw-r--r--slog.vim37
1 files changed, 37 insertions, 0 deletions
diff --git a/slog.vim b/slog.vim
new file mode 100644
index 0000000..557e115
--- /dev/null
+++ b/slog.vim
@@ -0,0 +1,37 @@
1" .vim/syntax/slog.vim
2
3" Also add this line to your .vimrc
4" autocmd BufRead,BufNewFile *.slog set filetype=slog
5
6" Match on the sequence number at the start of the line.
7" Sequence number is always in the log.
8:syn match logSeqNo /^\d\+/ nextgroup=logProcessorNo skipwhite
9
10" Match on the processor number.
11" This is always in the log, but what comes next varies.
12:syn match logProcessorNo /P\d\+/ nextgroup=logFunctInfo,logProcessInfo skipwhite
13
14" Match on the function info, e.g. [reclaim_pages@litmus/color.c:203]:
15" It contains function, file, and line.
16:syn match logFunctInfo "\[[^\]]*\]" contains=logFunction,logFile,logLineNo nextgroup=logProcessInfo skipwhite
17" Don't highlight the bracket or @ sign
18:syn match logFunction "\[\w\+@"hs=s+1,he=e-1 contained nextgroup=logFile
19:syn match logFile "[A-Za-z0-9_./]\+:"he=e-1 contained nextgroup=logLineNo
20:syn match logLineNo "\d\+]"he=e-1 contained
21
22:syn match logProcessInfo "([^)]*)" contains=logProcess,logPid,logJob skipwhite
23:syn match logProcess "([^/]*/"hs=s+1,he=e-1 contained nextgroup=logPid
24:syn match logPid "\d\+:"he=e-1 contained nextgroup=logJob
25:syn match logJob "\d\+)"he=e-1 contained
26
27" Now make them appear:
28hi def link logSeqNo Constant
29hi def link logProcessorNo Todo
30hi def link logFunction String
31hi def link logFile Comment
32hi def link logLineNo Number
33hi def link logProcess Comment
34hi def link logPid Constant
35hi def link logJob Number
36
37let b:current_syntax = "slog"