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
17062c8
        alias vim="read -rep $'No vim found, using vi, press ENTER to continue\n' -n1 -t 20 -s && vi"
17062c8
        ;;
17062c8
  esac
82a60bf
fi