summaryrefslogtreecommitdiffstats
path: root/ftdetect
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 08:41:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 08:41:01 +0000
commit50693c367f8d3371e5c7eb85b0233fb56ae92a98 (patch)
treec693d63cf381d063796e5ef80160719eff05a213 /ftdetect
parentInitial commit. (diff)
downloadvim-nftables-50693c367f8d3371e5c7eb85b0233fb56ae92a98.tar.xz
vim-nftables-50693c367f8d3371e5c7eb85b0233fb56ae92a98.zip
Adding upstream version 0.20200629.upstream/0.20200629upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ftdetect')
-rw-r--r--ftdetect/nftables.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/ftdetect/nftables.vim b/ftdetect/nftables.vim
new file mode 100644
index 0000000..8936167
--- /dev/null
+++ b/ftdetect/nftables.vim
@@ -0,0 +1,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