1
0
Fork 0
vim-nftables/ftdetect/nftables.vim

12 lines
330 B
VimL
Raw Permalink Normal View History

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