aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-23 11:02:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-23 11:02:57 +1200
commit73521c268fed201b1d7db5a0d4495b8d2130c7f6 (patch)
tree07b8f36b5d8cc0d0afdb1c63023168f59786f059
parentCorrect variable name (diff)
downloaddotfiles-73521c268fed201b1d7db5a0d4495b8d2130c7f6.tar.gz
dotfiles-73521c268fed201b1d7db5a0d4495b8d2130c7f6.zip
Add more Vim aliases; still tinkering with BSDs
-rw-r--r--bash/bashrc.d/vim.bash16
1 files changed, 15 insertions, 1 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash
index cd8f3896..bcdcd86d 100644
--- a/bash/bashrc.d/vim.bash
+++ b/bash/bashrc.d/vim.bash
@@ -1,4 +1,11 @@
-# If Vim exists on the system, use it instead of vi
+# If Vim exists on the system, use it instead of ex, vi, and view
+ex() {
+ if hash vim 2>/dev/null; then
+ command vim -e "$@"
+ else
+ command ex "$@"
+ fi
+}
vi() {
if hash vim 2>/dev/null; then
command vim "$@"
@@ -6,4 +13,11 @@ vi() {
command vi "$@"
fi
}
+view() {
+ if hash vim 2>/dev/null; then
+ command vim -R "$@"
+ else
+ command view "$@"
+ fi
+}