diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-22 15:59:06 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-22 15:59:06 +1200 |
commit | 82ba20d055c65233996dac6b2dd88430159cf11e (patch) | |
tree | ecb925cdece2d7c3e671ad8f1b18a051e61a3ebd /bash | |
parent | Vim/vi aliasing behavior (diff) | |
download | dotfiles-82ba20d055c65233996dac6b2dd88430159cf11e.tar.gz dotfiles-82ba20d055c65233996dac6b2dd88430159cf11e.zip |
Use function instead of alias for vi
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/vim.bash | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash index 3ebfb66e..cd8f3896 100644 --- a/bash/bashrc.d/vim.bash +++ b/bash/bashrc.d/vim.bash @@ -1,5 +1,9 @@ -# If Vim exists on the system, alias vi to it -if hash vim 2>/dev/null; then - alias vi='vim' -fi +# If Vim exists on the system, use it instead of vi +vi() { + if hash vim 2>/dev/null; then + command vim "$@" + else + command vi "$@" + fi +} |