82a60bf
if [ -n "${BASH_VERSION-}" -o -n "${KSH_VERSION-}" -o -n "${ZSH_VERSION-}" ]; then
17062c8
  # This will avoid user defined aliases and possibly stuff defined earlier in the PATH.
4e95433
  case "$(command -v vim)-$(command -v vi)" in
17062c8
    /usr/bin/vim-/usr/bin/vi)
17062c8
        # apply only when founded vim and vi are in expected dirs from distro
17062c8
        alias vi=vim
17062c8
        alias view="vim -R"
17062c8
        ;;
17062c8
    -/usr/bin/vi)
17062c8
        # apply only if founded vi is in expected dir from distro
039b1a4
        if [ -n "${ZSH_VERSION-}" ]; then
039b1a4
          alias vim="read -t 10 -s -k 1 '?No vim found, using vi, press ENTER to continue...' && echo '' && vi"
039b1a4
        else
039b1a4
          alias vim="read -rep $'No vim found, using vi, press ENTER to continue...\n' -n1 -t 10 -s && vi"
039b1a4
        fi
17062c8
        ;;
17062c8
  esac
82a60bf
fi