From 73521c268fed201b1d7db5a0d4495b8d2130c7f6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 23 Sep 2013 11:02:57 +1200 Subject: Add more Vim aliases; still tinkering with BSDs --- bash/bashrc.d/vim.bash | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 +} -- cgit v1.2.3