1
0
Fork 0
vim-nftables/ftdetect/nftables.vim
Daniel Baumann ab07386d8b
Adding upstream version 0.20200629.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 22:20:31 +02:00

11 lines
330 B
VimL

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