proto_80211_mac_hdr.c: complete tclas element
[netsniff-ng.git] / scripts / bpf.vim
blob14712b87d4787bf7b49bb032f3239398b66df2fa
1 " Vim syntax file
2 " Language: Berkeley Packet Filter
3 " Maintainer: Daniel Borkmann
4 " Latest Revision: 08/16/2011
6 " In order to make syntax highlighting for BPFs work in vim, copy this file
7 " to ~/.vim/syntax/ and activate it in vim by entering:
9 "    :set syntax=bpf
11 " If you want to automatically load the BPF syntax highlighting for *.bpf 
12 " files create the ~/.vim/filetype.vim with the following content:
14 "    my filetype file
15 "    if exists("did_load_filetypes")
16 "      finish
17 "    endif
19 "    augroup filetypedetect
20 "      au! BufRead,BufNewFile *.bpf  setfiletype bpf
21 "    augroup END
24 if exists("b:current_syntax")
25   finish
26 endif
28 syn keyword bpfTodo contained TODO FIXME XXX NOTE FUBAR
29 syn keyword bpfKeywords ldb ldh ld ldx ldxb st stx jmp ja jeq jgt jge skipwhite
30 syn keyword bpfKeywords jset add sub mul div and or lsh rsh ret tax txa skipwhite
32 syn match bpfLabel /[a-zA-Z0-9_]\+/
33 syn match bpfSpChar /[:,#\[\]\(\)+*&]\?/ contains=bpfNumber,bpfLabel
34 syn match bpfNumber /\(0[xX]\x\+\|\d\+\)/
35 syn match bpfComment ";.*$" contains=bpfTodo
37 hi def link bpfTodo Todo
38 hi def link bpfComment Comment
39 hi def link bpfKeywords Keyword
40 hi def link bpfLabel Type
41 hi def link bpfNumber Number
42 hi def link bpfSpChar Special
44 let b:current_syntax = "bpf"