hog.vim 1.4 KB

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