Move vim option select to execute logic at alias def time
Using the function would cause problems when trying to perform a `sudo vim`. The sudo command would run in a root shell which does not have my shells functions (but does have it's aliases) so then any attempt to sudo vim would fail with "vim_option_select: command not found"
This commit is contained in:
parent
0ce1d88173
commit
6935843cee
@ -5,6 +5,14 @@
|
||||
# Allow alias expansion for commands executed with sudo
|
||||
alias sudo="sudo "
|
||||
|
||||
#{- VIM OPTION SELECT -}#
|
||||
if which nvim &> /dev/null; then
|
||||
export PREFERRED_VIM=nvim
|
||||
else
|
||||
export PREFERRED_VIM=vim
|
||||
fi
|
||||
alias vim="$PREFERRED_VIM "
|
||||
|
||||
#{- GNU COREUTILS -}#
|
||||
|
||||
# Sort directories first and colorize output
|
||||
|
||||
@ -21,13 +21,3 @@ cat_with_newline()
|
||||
cat "$@" && echo
|
||||
}
|
||||
alias cat="cat_with_newline"
|
||||
|
||||
vim_option_select()
|
||||
{
|
||||
if which nvim &> /dev/null; then
|
||||
nvim "$@"
|
||||
else
|
||||
vim "$@"
|
||||
fi
|
||||
}
|
||||
alias vim="vim_option_select "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user