vim/vim.fish
DistroBaker e6b2f6c0ee Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/vim.git#86943b30a6c1912a1d4a5c8ae867ee7b15d456c1
2020-12-16 14:22:16 +00:00

26 lines
674 B
Fish

# This will avoid user defined aliases and possibly stuff defined earlier in the PATH.
# Redirecting is for the case when the binary is missing.
set 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 if founded vim and vi are in the expected dir from distro
function vi
command vim $argv
end
function view
command vim -R $argv
end
case -/usr/bin/vi
# apply only when no vim is installed and founded vi is in the expected dir from distro
function vim
command vi $argv
end
end
# just in case
set -e vim_cond
set -e vi_cond