1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# If Vim exists on the system, use it instead of ex, vi, and view if ! hash vim 2>/dev/null ; then return fi # Define functions proper ex() { command vim -e "$@" } vi() { command vim "$@" } view() { command vim -R "$@" }