aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-30 18:34:16 -0500
committerGitHub <noreply@github.com>2021-01-30 18:34:16 -0500
commit4e8a01a306baa44c1373318a327de5d0de8406ba (patch)
tree1536444e9108742ac609bc3cc04d7d7eff973b93 /runtime/ftplugin
parentc4d0211fea7abfc9e52262f3fe21b90318a0f0bc (diff)
parent55fed9a2b0f33b2d86d45718c5c235ce62de05fa (diff)
downloadrneovim-4e8a01a306baa44c1373318a327de5d0de8406ba.tar.gz
rneovim-4e8a01a306baa44c1373318a327de5d0de8406ba.tar.bz2
rneovim-4e8a01a306baa44c1373318a327de5d0de8406ba.zip
Merge pull request #13835 from saadparwaiz1/runtime/zsh
Update Runtime Files For Zsh
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/zsh.vim23
1 files changed, 19 insertions, 4 deletions
diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim
index fe8efc59ab..53ce1417dd 100644
--- a/runtime/ftplugin/zsh.vim
+++ b/runtime/ftplugin/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2017-11-22
+" Latest Revision: 2020-09-01
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -14,11 +14,26 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
-let b:undo_ftplugin = "setl com< cms< fo<"
-
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
-let b:match_words = ',\<if\>:\<elif\>:\<else\>:\<fi\>'
+let b:undo_ftplugin = "setl com< cms< fo< "
+
+if executable('zsh')
+ if !has('gui_running') && executable('less')
+ command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
+ elseif has('terminal')
+ command! -buffer -nargs=1 RunHelp silent exe ':term zsh -ic "autoload -Uz run-help; run-help <args>"'
+ else
+ command! -buffer -nargs=1 RunHelp echo system('zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null"')
+ endif
+ if !exists('current_compiler')
+ compiler zsh
+ endif
+ setlocal keywordprg=:RunHelp
+ let b:undo_ftplugin .= 'keywordprg<'
+endif
+
+let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>'
\ . ',\<case\>:^\s*([^)]*):\<esac\>'
\ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
let b:match_skip = 's:comment\|string\|heredoc\|subst'