|
Karsten Hopp |
82a60b |
if [ -n "${BASH_VERSION-}" -o -n "${KSH_VERSION-}" -o -n "${ZSH_VERSION-}" ]; then
|
|
Zdenek Dohnal |
17062c |
# This will avoid user defined aliases and possibly stuff defined earlier in the PATH.
|
|
Zdenek Dohnal |
4e9543 |
case "$(command -v vim)-$(command -v vi)" in
|
|
Zdenek Dohnal |
17062c |
/usr/bin/vim-/usr/bin/vi)
|
|
Zdenek Dohnal |
17062c |
# apply only when founded vim and vi are in expected dirs from distro
|
|
Zdenek Dohnal |
17062c |
alias vi=vim
|
|
Zdenek Dohnal |
17062c |
alias view="vim -R"
|
|
Zdenek Dohnal |
17062c |
;;
|
|
Zdenek Dohnal |
17062c |
-/usr/bin/vi)
|
|
Zdenek Dohnal |
17062c |
# apply only if founded vi is in expected dir from distro
|
|
Zdenek Dohnal |
17062c |
alias vim="read -rep $'No vim found, using vi, press ENTER to continue\n' -n1 -t 20 -s && vi"
|
|
Zdenek Dohnal |
17062c |
;;
|
|
Zdenek Dohnal |
17062c |
esac
|
|
Karsten Hopp |
82a60b |
fi
|