aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-22 15:59:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-22 15:59:06 +1200
commit82ba20d055c65233996dac6b2dd88430159cf11e (patch)
treeecb925cdece2d7c3e671ad8f1b18a051e61a3ebd /bash
parentVim/vi aliasing behavior (diff)
downloaddotfiles-82ba20d055c65233996dac6b2dd88430159cf11e.tar.gz
dotfiles-82ba20d055c65233996dac6b2dd88430159cf11e.zip
Use function instead of alias for vi
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/vim.bash12
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
+}