File: nftables.vim

package info (click to toggle)
vim-nftables 0.20200629-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 72 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
function! s:DetectFiletype()
    if getline(1) =~# '^#!\s*\%\(/\S\+\)\?/\%\(s\)\?bin/\%\(env\s\+\)\?nft\>'
        setfiletype nftables
    endif
endfunction

augroup nftables
    autocmd!
    autocmd BufRead,BufNewFile * call s:DetectFiletype()
    autocmd BufRead,BufNewFile *.nft,nftables.conf setfiletype nftables
augroup END