Bram Moolenaar | d7464be | 2015-11-01 16:49:04 +0100 | [diff] [blame] | 1 | " Vim filetype plugin |
| 2 | " Language: hog (snort.conf) |
| 3 | " Maintainer: . Victor Roemer, <vroemer@badsec.org>. |
| 4 | " Last Change: Mar 1, 2013 |
| 5 | |
| 6 | if exists("b:did_ftplugin") |
| 7 | finish |
| 8 | endif |
| 9 | let b:did_ftplugin = 1 |
| 10 | |
| 11 | let s:undo_ftplugin = "setl fo< com< cms< def< inc<" |
| 12 | |
| 13 | let s:cpo_save = &cpo |
| 14 | set cpo&vim |
| 15 | |
| 16 | setlocal formatoptions=croq |
| 17 | setlocal comments=:# |
| 18 | setlocal commentstring=\c#\ %s |
| 19 | setlocal define=\c^\s\{-}var |
| 20 | setlocal include=\c^\s\{-}include |
| 21 | |
| 22 | " Move around configurations |
| 23 | let s:hog_keyword_match = '\c^\s*\<\(preprocessor\\|config\\|output\\|include\\|ipvar\\|portvar\\|var\\|dynamicpreprocessor\\|' . |
| 24 | \ 'dynamicengine\\|dynamicdetection\\|activate\\|alert\\|drop\\|block\\|dynamic\\|log\\|pass\\|reject\\|sdrop\\|sblock\)\>' |
| 25 | |
| 26 | exec "nnoremap <buffer><silent> ]] :call search('" . s:hog_keyword_match . "', 'W' )<CR>" |
| 27 | exec "nnoremap <buffer><silent> [[ :call search('" . s:hog_keyword_match . "', 'bW' )<CR>" |
| 28 | |
| 29 | if exists("loaded_matchit") |
| 30 | let b:match_words = |
| 31 | \ '^\s*\<\%(preprocessor\|config\|output\|include\|ipvar\|portvar' . |
| 32 | \ '\|var\|dynamicpreprocessor\|dynamicengine\|dynamicdetection' . |
| 33 | \ '\|activate\|alert\|drop\|block\|dynamic\|log\|pass\|reject' . |
| 34 | \ '\|sdrop\|sblock\>\):$,\::\,:;' |
| 35 | let b:match_skip = 'r:\\.\{-}$\|^\s*#.\{-}$\|^\s*$' |
| 36 | endif |
| 37 | |
| 38 | let &cpo = s:cpo_save |
| 39 | unlet s:cpo_save |