diff --git a/rc b/rc index 9044ffa..76d9f73 100644 --- a/rc +++ b/rc @@ -11,7 +11,6 @@ alias h='history' alias df='df -h' alias du='du -h' alias v='vim' -alias vi='vim' alias e='emacs' binary_exists ledger && alias l='ledger' @@ -45,6 +44,17 @@ function g return $? } +function vi +{ + if which nvim 1>/dev/null 2>&1; then + command nvim $@ + elif which vim 1>/dev/null 2>&1; then + command vim $@ + elif which vi 1>/dev/null 2>&1; then + command vi $@ + fi +} + alias gp='g p origin $gitbranch' alias gpf='g p -f origin $gitbranch'