Hi, this patch does what it says on the tin. If a .sh file starts with #!/bin/zsh it will set the filetype to zsh
Regards, -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
>From 99d06e4da8f84082f176d4c88bf5eb5cfbec8cfd Mon Sep 17 00:00:00 2001 From: Richard Brown <[email protected]> Date: Thu, 6 Sep 2012 09:21:26 +0100 Subject: [PATCH] Set filetype to zsh for sh files with #!/bin/zsh --- runtime/filetype.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 45cf630..bbcfe2e 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1772,6 +1772,10 @@ func! SetFileTypeSH(name) " Some .sh scripts contain #!/bin/tcsh. call SetFileTypeShell("tcsh") return + elseif a:name =~ '\<zsh\>' + " Some .sh scripts contain #!/bin/zsh. + call SetFileTypeShell("zsh") + return elseif a:name =~ '\<ksh\>' let b:is_kornshell = 1 if exists("b:is_bash") -- 1.7.12
