fix error when completing vi if it didnt exist (#3336)

This commit is contained in:
Cobrand 2016-08-27 15:37:18 +02:00 committed by Fabian Homborg
parent cfefaaf4ee
commit 172541c689

View File

@ -3,22 +3,23 @@
# -wn : Set the default window size to n
# +command : same as -c command
# Check if vi is really vim
if vi --version > /dev/null ^ /dev/null
complete -c vi -w vim
else
complete -c vi -s s --description 'Suppress all interactive user feedback'
complete -c vi -s C --description 'Encrypt/decrypt text'
complete -c vi -s l --description 'Set up for editing LISP programs'
complete -c vi -s L --description 'List saved file names after crash'
complete -c vi -s R --description 'Read-only mode'
complete -c vi -s S --description 'Use linear search for tags if tag file not sorted'
complete -c vi -s v --description 'Start in display editing state'
complete -c vi -s V --description 'Verbose mode'
complete -c vi -s x --description 'Encrypt/decrypt text'
complete -c vi -r -s r --description 'Recover file after crash'
complete -c vi -r -s t --description 'Edit the file containing a tag'
complete -c vi -r -c t --description 'Begin editing by executing the specified editor command'
# Check if vi exists at all ( needed for vi --version )
if type -q vi
# Check if vi is really vim
if vi --version > /dev/null ^ /dev/null
complete -c vi -w vim
else
complete -c vi -s s --description 'Suppress all interactive user feedback'
complete -c vi -s C --description 'Encrypt/decrypt text'
complete -c vi -s l --description 'Set up for editing LISP programs'
complete -c vi -s L --description 'List saved file names after crash'
complete -c vi -s R --description 'Read-only mode'
complete -c vi -s S --description 'Use linear search for tags if tag file not sorted'
complete -c vi -s v --description 'Start in display editing state'
complete -c vi -s V --description 'Verbose mode'
complete -c vi -s x --description 'Encrypt/decrypt text'
complete -c vi -r -s r --description 'Recover file after crash'
complete -c vi -r -s t --description 'Edit the file containing a tag'
complete -c vi -r -c t --description 'Begin editing by executing the specified editor command'
end
end