Add a vim option select

This commit is contained in:
2025-04-05 16:37:09 -04:00
committed by Andrew R. M.
parent ab6350f15a
commit 3636fb6d07
3 changed files with 13 additions and 4 deletions

View File

@@ -1,7 +1,5 @@
#{- ~/.aliases -}#
alias vim="nvim "
#{- FILE OPERATIONS -}#
# Allow alias expansion for commands executed with sudo
@@ -40,6 +38,7 @@ alias df="df -h"
alias du="du -sh"
# History searches
alias phistory='cat ${PERSISTENT_HISTFILE}'
alias hgrep='history | grep --color'
alias phgrep="cat ${PERSISTENT_HISTFILE} | grep --color"

View File

@@ -21,3 +21,13 @@ 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 "