Skip to content

Commit 729de86

Browse files
committed
Initial commit
0 parents  commit 729de86

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 nfnty
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# vim-nftables
2+
3+
## Installation
4+
5+
Recommend [NeoBundle](https://github.com/Shougo/neobundle.vim) for installation.
6+
7+
### NeoBundle
8+
9+
Add the following to your vimrc:
10+
11+
```vim
12+
NeoBundle 'nfnty/vim-nftables'
13+
```

indent/nftables.vim

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
" Only load this indent file when no other was loaded.
2+
if exists("b:did_indent")
3+
finish
4+
endif
5+
let b:did_indent = 1
6+
7+
setlocal cindent
8+
setlocal cinoptions=L0,(0,Ws,J1,j1
9+
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
10+
" Don't think cinwords will actually do anything at all... never mind
11+
setlocal cinwords=table,chain
12+
13+
" Some preliminary settings
14+
setlocal nolisp " Make sure lisp indenting doesn't supersede us
15+
setlocal autoindent " indentexpr isn't much help otherwise
16+
" Also do indentkeys, otherwise # gets shoved to column 0 :-/
17+
setlocal indentkeys=0{,0},!^F,o,O,0[,0]

syntax/nftables.vim

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if exists("b:current_syntax")
2+
finish
3+
endif
4+
5+
syn match nftablesSet /{.*}/ contains=nftablesSetEntry
6+
syn match nftablesSetEntry /[a-zA-Z0-9]\+/ contained
7+
hi def link nftablesSet Keyword
8+
hi def link nftablesSetEntry Operator
9+
10+
syn match nftablesNumber "\<[0-9A-Fa-f./:]\+\>" contains=nftablesMask,nftablesDelimiter
11+
syn match nftablesDelimiter "[./:]" contained
12+
syn match nftablesMask "/[0-9.]\+" contained contains=nftablesDelimiter
13+
hi def link nftablesNumber Number
14+
hi def link nftablesDelimiter Operator
15+
hi def link nftablesMask Operator
16+
17+
syn region Comment start=/^\s*#/ end=/$/
18+
syn region String start=/"/ end=/"/
19+
syn keyword Function flush
20+
syn keyword Function table chain
21+
syn keyword Statement type hook
22+
syn keyword Type ip ip6 inet arp bridge
23+
syn keyword Type filter nat route
24+
syn keyword Type ether vlan arp ip ip6 tcp udp udplite sctp dccp ah esp ipcomp
25+
syn keyword Type ct
26+
syn keyword Type length protocol priority mark iif iifname iiftype oif oifname oiftype skuid skgid rtclassid
27+
syn keyword Constant prerouting input forward output postrouting
28+
29+
syn keyword Special accept drop reject queue
30+
syn keyword Keyword continue return jump goto
31+
syn keyword Keyword counter log
32+
33+
let b:current_syntax = "nftables"

0 commit comments

Comments
 (0)