diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-12-02 14:42:14 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-12-02 14:42:14 +0100 |
commit | 1751b25cd184e060b335ff1ae239c69f2474df4b (patch) | |
tree | 76d0b746a179f5b1e5d065137fbd15ea7cf2cae4 /.vim/syntax/bpf.vim | |
parent | f770648b665ba3c1364f267f66ab9c4601847615 (diff) | |
parent | 21e2fa2ad06ee16537321cffb9c50145a6739509 (diff) |
Merge branch 'master' of git+ssh://git.distanz.ch/home/tklauser/scm/dotfiles/vim
Diffstat (limited to '.vim/syntax/bpf.vim')
-rw-r--r-- | .vim/syntax/bpf.vim | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/.vim/syntax/bpf.vim b/.vim/syntax/bpf.vim new file mode 100644 index 0000000..bb6322a --- /dev/null +++ b/.vim/syntax/bpf.vim @@ -0,0 +1,45 @@ +" Vim syntax file +" Language: Berkeley Packet Filter +" Maintainer: Daniel Borkmann +" Latest Revision: 08/16/2011 +" +" In order to make syntax highlighting for BPFs work in vim, copy this file +" to ~/.vim/syntax/ and activate it in vim by entering: +" +" :set syntax=bpf +" +" If you want to automatically load the BPF syntax highlighting for *.bpf +" files create the ~/.vim/filetype.vim with the following content: +" +" my filetype file +" if exists("did_load_filetypes") +" finish +" endif +" +" augroup filetypedetect +" au! BufRead,BufNewFile *.bpf setfiletype bpf +" augroup END +" + +if exists("b:current_syntax") + finish +endif + +syn keyword bpfTodo contained TODO FIXME XXX NOTE +syn keyword bpfKeywords ldb ldh ld ldi ldx ldxi ldxb st stx jmp ja jeq jneq jne skipwhite +syn keyword bpfKeywords jlt jle jgt jge jset add sub mul div mod neg and or xor skipwhite +syn keyword bpfKeywords lsh rsh ret tax txa skipwhite + +syn match bpfLabel /[a-zA-Z0-9_]\+/ +syn match bpfSpChar /[:,#\[\]\(\)+*&]\?/ contains=bpfNumber,bpfLabel +syn match bpfNumber /\(0[xX]\x\+\|\d\+\)/ +syn match bpfComment ";.*$" contains=bpfTodo + +hi def link bpfTodo Todo +hi def link bpfComment Comment +hi def link bpfKeywords Keyword +hi def link bpfLabel Type +hi def link bpfNumber Number +hi def link bpfSpChar Special + +let b:current_syntax = "bpf" |