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:
2025-04-05 16:37:09 -04:00
committed by Andrew R. M.
parent 0ce1d88173
commit 6935843cee
2 changed files with 8 additions and 10 deletions

View File

@@ -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 "