commit:     e5a55b7fa046e3b23b7f7e5e2224fa9dc74c1052
Author:     Anna “CyberTailor” <cyber <AT> sysrq <DOT> in>
AuthorDate: Sat Feb 19 07:40:04 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Feb 21 18:15:00 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=e5a55b7f

ftdetect/gentoo.vim: set multiple file types

So basically Syntastic shell checks (most importantly "sh" and
"checkbashisms") works for init.d, conf.d and env.d files now. Yay!

Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in>
Closes: https://github.com/gentoo/gentoo-syntax/pull/44
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ftdetect/gentoo.vim | 8 ++++----
 plugin/newinitd.vim | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ftdetect/gentoo.vim b/ftdetect/gentoo.vim
index b8c14ac..b89f058 100644
--- a/ftdetect/gentoo.vim
+++ b/ftdetect/gentoo.vim
@@ -31,20 +31,20 @@ au BufNewFile,BufRead ChangeLog*
 
 " /etc/init.d/ scripts
 au BufNewFile,BufRead /etc/init.d/*
-    \     set filetype=gentoo-init-d |
+    \     set filetype=gentoo-init-d.sh |
 
 au BufNewFile,BufRead *
     \ if (getline(1) =~? "#!/sbin/\\(runscript\\|openrc-run\\)") |
-    \     set filetype=gentoo-init-d |
+    \     set filetype=gentoo-init-d.sh |
     \ endif
 
 " /etc/conf.d/ scripts
 au BufNewFile,BufRead /etc/conf.d/*
-    \     set filetype=gentoo-conf-d
+    \     set filetype=gentoo-conf-d.sh
 
 " /etc/env.d/ scripts
 au BufNewFile,BufRead /etc/env.d/*
-    \     set filetype=gentoo-env-d
+    \     set filetype=gentoo-env-d.sh
 
 " /etc/cron.d/ scripts
 au BufNewFile,BufRead /etc/cron.d/*

diff --git a/plugin/newinitd.vim b/plugin/newinitd.vim
index f11dd0f..dcc2e1a 100644
--- a/plugin/newinitd.vim
+++ b/plugin/newinitd.vim
@@ -37,12 +37,12 @@ fun! <SID>MakeNewInitd()
     0
 endfun
 
-com! -nargs=0 NewInitd call <SID>MakeNewInitd() | set filetype=gentoo-init-d
+com! -nargs=0 NewInitd call <SID>MakeNewInitd() | set filetype=gentoo-init-d.sh
 
 augroup NewInitd
     au!
     autocmd BufNewFile {/*/files/*.{rc*,init*},/etc/init.d/*}
-        \ call <SID>MakeNewInitd() | set filetype=gentoo-init-d
+        \ call <SID>MakeNewInitd() | set filetype=gentoo-init-d.sh
 augroup END
 
 " vim: set et foldmethod=marker : "

Reply via email to