2020-10-15 20:25:22 +00:00
|
|
|
# we need to use which twice - first for checking if
|
|
|
|
# the command doesn't fail, the use it if doesn't fail
|
2020-10-27 23:05:29 +00:00
|
|
|
set vim_cond = `command -v vim`
|
|
|
|
set vi_cond = `command -v vi`
|
2020-10-15 20:25:22 +00:00
|
|
|
|
|
|
|
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
|
2020-12-16 14:22:16 +00:00
|
|
|
alias vim vi
|
2020-10-15 20:25:22 +00:00
|
|
|
breaksw
|
|
|
|
endsw
|
|
|
|
|
|
|
|
# just in case
|
|
|
|
unset vim_cond
|
|
|
|
unset vi_cond
|