da4393
#!/usr/bin/sh
da4393
da4393
# run vim if:
da4393
# - 'vi' command is used and 'vim' binary is available
da4393
# - 'vim' command is used
da4393
# NOTE: Set up a local alias if you want vim -> vi functionality. We will not
da4393
# do it globally, because it messes up with available startup options (see 
da4393
# ':help starting', 'vi' is not capable of '-d'). The introducing an environment
da4393
# variable, which an user must set to get the feature, will do the same trick
da4393
# as setting an alias (needs user input, does not work with sudo), so it is left
da4393
# on user whether he decides to use an alias:
da4393
#
da4393
# alias vim=vi
da4393
#
da4393
# in bashrc file.
da4393
da4393
if test -f /usr/bin/vim
da4393
then
da4393
  exec /usr/bin/vim "$@"
da4393
fi
da4393
da4393
# run vi otherwise
da4393
exec /usr/libexec/vi "$@"