robin/laufey

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

zeertzjqMerge pull request #36826 from zeertzjq/vim-ffc7f8c6383123326

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