# set default editor

if [ $(uname -s) = "Darwin" ] ; then
  export EDITOR='mvim'
else
  export EDITOR='vim'
fi

# set default editor

# editor preference:
#   1. MacVim/mvim
#   2. vim

# set editor based on what's found on the system
if type mvim >/dev/null 2>/dev/null ; then
  export EDITOR='mvim'
elif type vim >/dev/null 2>/dev/null ; then
  export EDITOR='vim'
fi

Set EDITOR based on system options.
Set EDITOR based on system options.

The revision allows checking of which editors on installed on a aystem
and sets the EDITOR based on the results (e.g. if mvim exists, then set
editor as mvim).
