robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:7982966: runtime(bpftrace): add base syntax plugin (#37077)f93f341867

master
2.2 KiB66 linesraw
1" Vim syntax file
2" Language:		bpftrace
3" Maintainer:		Stanislaw Gruszka <stf_xl@wp.pl>
4" Last Change:		2025 Dec 22
5
6" Quit when a syntax file was already loaded
7if exists("b:current_syntax")
8  finish
9endif
10
11let s:cpo_save = &cpo
12set cpo&vim
13
14syn keyword	bpftraceConditional	if else
15syn keyword	bpftraceRepeat		while for unroll
16syn keyword	bpftraceStatement	break continue return
17syn keyword	bpftraceKeyword		let macro import config
18syn keyword	bpftraceOperator	sizeof offsetof
19
20syn keyword	bpftraceProbe		BEGIN END begin end
21syn match	bpftraceProbe		"\v<(bench|self|test)\ze:"
22syn match	bpftraceProbe		"\v<(fentry|fexit|kfunc|kretfunc|kprobe|kretprobe)\ze:"
23syn match	bpftraceProbe		"\v<(profile|interval|iterator|hardware|software|uprobe|uretprobe)\ze:"
24syn match	bpftraceProbe		"\v<(usdt|tracepoint|rawtracepoint|watchpoint|asyncwatchpoint)\ze:"
25syn match	bpftraceProbe		"\v(^|[^:])<\zs(h|i|it|f|fr|k|kr|p|rt|s|t|u|ur|U|w|aw)\ze:"
26
27syn keyword	bpftraceType		bool int8 int16 int32 int64
28syn keyword	bpftraceType		uint8 uint16 uint32 uint64
29syn keyword	bpftraceType		struct
30
31syn match	bpftraceMacro		"\<\h\w*\ze\_s*("
32
33syn match	bpftraceNumber		display	"[+-]\=\<\d\+\>"
34syn match	bpftraceNumber		display	"\<0x\x\+\>"
35
36syn keyword	bpftraceBoolean		true false
37
38syn region	bpftraceString		start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell extend
39
40syn keyword	bpftraceTodo		contained TODO FIXME XXX
41syn match	bpftraceShebang		/\%^#![^[].*/
42syn region	bpftraceCommentLine	start="//" end="$" contains=bpftraceTodo,@Spell
43syn region	bpftraceCommentBlock	matchgroup=bpftraceCommentBlock start="/\*" end="\*/" contains=bpftraceTodo,@Spell
44
45" Define the default highlighting.
46hi def link	bpftraceConditional	Conditional
47hi def link	bpftraceMacro		Macro
48hi def link	bpftraceRepeat		Repeat
49hi def link	bpftraceKeyword		Keyword
50hi def link	bpftraceNumber		Number
51hi def link	bpftraceBoolean		Boolean
52hi def link	bpftraceShebang		Comment
53hi def link	bpftraceCommentLine	Comment
54hi def link	bpftraceCommentBlock	Comment
55hi def link	bpftraceString		String
56hi def link	bpftraceType		Type
57hi def link	bpftraceProbe		Identifier
58
59syn sync minlines=100
60
61let b:current_syntax = "bpftrace"
62
63let &cpo = s:cpo_save
64unlet s:cpo_save
65
66" vim: ts=8 sw=8 noexpandtab