# we need to use which twice - first for checking if# the command doesn't fail, the use it if doesn't failset vim_cond = `command -v vim`set vi_cond = `command -v vi` switch ( $vim_cond-$vi_cond ) case /usr/bin/vim-/usr/bin/vi: # apply only when founded vim and vi are in expected dirs from distro alias vi vim alias view 'vim -R' breaksw case -/usr/bin/vi: # apply only if founded vi is in expected dir from distro alias vim vi breakswendsw # just in caseunset vim_condunset vi_cond