robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #40931 from zeertzjq/vim-9.2.0839e4137a7324

master
1.5 KiB47 linesraw
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 Jul 23
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 get(g:, 'zsh_fold_enable', 0)
22    setlocal foldmethod=syntax
23    let b:undo_ftplugin .= "fdm< "
24endif
25
26if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
27  if exists(':terminal') == 2
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'
39endif
40
41let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>'
42      \ . ',\<case\>:^\s*([^)]*):\<esac\>'
43      \ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
44let b:match_skip = 's:comment\|string\|heredoc\|subst'
45
46let &cpo = s:cpo_save
47unlet s:cpo_save