vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

zsh.vim (1557B)


      1 " Vim filetype plugin file
      2 " Language:             Zsh shell script
      3 " Maintainer:           Christian Brabandt <cb@256bit.org>
      4 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
      5 " Latest Revision:      2026 Sep 01
      6 " License:              Vim (see :h license)
      7 " Repository:           https://github.com/chrisbra/vim-zsh
      8 
      9 if exists("b:did_ftplugin")
     10   finish
     11 endif
     12 let b:did_ftplugin = 1
     13 
     14 let s:cpo_save = &cpo
     15 set cpo&vim
     16 
     17 setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
     18 
     19 let b:undo_ftplugin = "setl com< cms< fo< "
     20 
     21 if get(g:, 'zsh_fold_enable', 0)
     22     setlocal foldmethod=syntax
     23     let b:undo_ftplugin .= "fdm< "
     24 endif
     25 
     26 if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
     27   if exists('*term_start')
     28     command! -buffer -nargs=1 ZshKeywordPrg call term_start(['zsh', '-c', 'autoload -Uz run-help; run-help "$1"', '--', <q-args>])
     29   elseif has("patch-9.2.0250")
     30     command! -buffer -nargs=1 ZshKeywordPrg echo system(['zsh', '-c', 'autoload -Uz run-help; MANPAGER= run-help "$1" 2>/dev/null', '--', <q-args>])
     31   endif
     32   setlocal keywordprg=:ZshKeywordPrg
     33   let b:undo_ftplugin .= '| setl keywordprg< | sil! delc -buffer ZshKeywordPrg'
     34 
     35   if !exists('current_compiler')
     36     compiler zsh
     37   endif
     38   let b:undo_ftplugin .= ' | compiler make'
     39 endif
     40 
     41 let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>'
     42       \ . ',\<case\>:^\s*([^)]*):\<esac\>'
     43       \ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
     44 let b:match_skip = 's:comment\|string\|heredoc\|subst'
     45 
     46 let &cpo = s:cpo_save
     47 unlet s:cpo_save