1" Vim filetype plugin file 2" Language: Zsh shell script 3" Maintainer: Christian Brabandt <[email protected]> 4" Previous Maintainer: Nikolai Weibull <[email protected]> 5" Latest Revision: 2020-01-10 6" License: Vim (see :h license) 7" Repository: https://github.com/chrisbra/vim-zsh 8 9if exists("b:did_ftplugin") 10 finish 11endif 12let b:did_ftplugin = 1 13 14let s:cpo_save = &cpo 15set cpo&vim 16 17setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql 18 19let b:undo_ftplugin = "setl com< cms< fo< " 20 21if executable('zsh') 22 if !has('gui_running') && executable('less') 23 command! -buffer -nargs=1 RunHelp silent exe '!zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw! 24 elseif has('terminal') 25 command! -buffer -nargs=1 RunHelp silent exe ':term zsh -ic "autoload -Uz run-help; run-help <args>"' 26 else 27 command! -buffer -nargs=1 RunHelp echo system('zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null"') 28 endif 29 setlocal keywordprg=:RunHelp 30 setlocal makeprg=zsh\ -n\ --\ %:S 31 setlocal errorformat=%f:\ line\ %l:\ %m 32 let b:undo_ftplugin .= 'keywordprg< errorformat< makeprg<' 33endif 34 35let b:match_words = ',\<if\>:\<elif\>:\<else\>:\<fi\>' 36 \ . ',\<case\>:^\s*([^)]*):\<esac\>' 37 \ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>' 38let b:match_skip = 's:comment\|string\|heredoc\|subst' 39 40let &cpo = s:cpo_save 41unlet s:cpo_save 42