annotate runtime/ftplugin/hog.vim @ 15464:3faa7cc8207c v8.1.0740

patch 8.1.0740: Tcl test fails commit https://github.com/vim/vim/commit/8309b0559da6e9a581a7816572594c90c2d7f942 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 13 16:46:22 2019 +0100 patch 8.1.0740: Tcl test fails Problem: Tcl test fails. Solution: When the argument is empty don't give an error, instead rely on the error reporting higher up.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jan 2019 17:00:06 +0100
parents 3ba0f29ba1d1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7188
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim filetype plugin
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: hog (snort.conf)
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Maintainer: . Victor Roemer, <vroemer@badsec.org>.
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Last Change: Mar 1, 2013
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if exists("b:did_ftplugin")
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 finish
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 let b:did_ftplugin = 1
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let s:undo_ftplugin = "setl fo< com< cms< def< inc<"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s:cpo_save = &cpo
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 set cpo&vim
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 setlocal formatoptions=croq
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 setlocal comments=:#
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 setlocal commentstring=\c#\ %s
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 setlocal define=\c^\s\{-}var
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 setlocal include=\c^\s\{-}include
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " Move around configurations
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 let s:hog_keyword_match = '\c^\s*\<\(preprocessor\\|config\\|output\\|include\\|ipvar\\|portvar\\|var\\|dynamicpreprocessor\\|' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ 'dynamicengine\\|dynamicdetection\\|activate\\|alert\\|drop\\|block\\|dynamic\\|log\\|pass\\|reject\\|sdrop\\|sblock\)\>'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 exec "nnoremap <buffer><silent> ]] :call search('" . s:hog_keyword_match . "', 'W' )<CR>"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 exec "nnoremap <buffer><silent> [[ :call search('" . s:hog_keyword_match . "', 'bW' )<CR>"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 if exists("loaded_matchit")
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 let b:match_words =
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ '^\s*\<\%(preprocessor\|config\|output\|include\|ipvar\|portvar' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ '\|var\|dynamicpreprocessor\|dynamicengine\|dynamicdetection' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ '\|activate\|alert\|drop\|block\|dynamic\|log\|pass\|reject' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ '\|sdrop\|sblock\>\):$,\::\,:;'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 let b:match_skip = 'r:\\.\{-}$\|^\s*#.\{-}$\|^\s*$'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 endif
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 let &cpo = s:cpo_save
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 unlet s:cpo_save