1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

45831: Add _vi completer

This commit is contained in:
Matthew Martin 2020-05-17 15:16:18 -05:00
parent 7c2a740d0f
commit 53052335b9
2 changed files with 51 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2020-05-17 Matthew Martin <phy1729@gmail.com>
* 45831: Completion/Unix/Command/_vi: Add _vi completer.
2020-05-16 Daniel Shahaf <d.s@daniel.shahaf.name>
* users/24843: Doc/Zsh/compsys.yo: zshcompsys(1): Point to the

View file

@ -0,0 +1,47 @@
#compdef ex vi view
local -a args
if _pick_variant vim='(N|)VIM' vi --version; then
_vim
return
fi
args=(
'-c+[execute command on the first file loaded]:command:'
'-r[recover the named files]'
'-t+[start editing at the specified tag]:tag:'
'-w+[set window size to specified number of lines]:lines:'
'*: :_files'
)
[[ $service != view ]] && args+=(
'-R[set readonly]'
)
[[ $service == ex ]] && args+=(
'-s[enter batch mode]'
'-v[start in vi mode]'
)
case $OSTYPE in
*bsd*|dragonfly*)
args+=(
"-F[don't copy the entire file on start]"
'-S[set the secure option]'
)
[[ $service != ex ]] && args+=(
'-e[start in ex mode]'
)
;|
netbsd*)
args+=(
'-G[start in gtags mode]'
)
[[ $service == vi ]] && args+=(
'-l[set the lisp and showmatch options]'
)
;;
esac
_arguments -s -S -A '-*' : $args