blob: 8936167b3e2ed796b996dd4079485de61e53eabc (
plain)
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
|