aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-05-31 00:44:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-05-31 00:44:42 +1200
commitdeb74ddaf48652fd6352942ee56a0f40f05df81d (patch)
treec3a412f81815aae098ae1d21aeda934030d3264d
parentUse temp var for $* tests (diff)
downloaddotfiles-deb74ddaf48652fd6352942ee56a0f40f05df81d.tar.gz
dotfiles-deb74ddaf48652fd6352942ee56a0f40f05df81d.zip
Translate remaining aliases to functions
-rw-r--r--bash/bashrc.d/aliases.bash15
-rw-r--r--bash/bashrc.d/bc.bash5
-rw-r--r--bash/bashrc.d/bell.bash5
-rw-r--r--bash/bashrc.d/diff.bash5
-rw-r--r--bash/bashrc.d/gdb.bash5
-rw-r--r--bash/bashrc.d/rcsdiff.bash5
-rw-r--r--bash/bashrc.d/vim.bash12
7 files changed, 34 insertions, 18 deletions
diff --git a/bash/bashrc.d/aliases.bash b/bash/bashrc.d/aliases.bash
deleted file mode 100644
index 256c4934..00000000
--- a/bash/bashrc.d/aliases.bash
+++ /dev/null
@@ -1,15 +0,0 @@
-# Don't print the bc(1) welcome message
-alias bc='bc -q'
-
-# Print a terminal bell
-alias bell='printf \\a'
-
-# Use a unified format for diff(1) by default
-alias diff='diff -u'
-
-# Don't print the GDB copyright message on every invocation
-alias gdb='gdb -q'
-
-# Use a unified format for rcsdiff(1) by default
-alias rcsdiff='rcsdiff -u'
-
diff --git a/bash/bashrc.d/bc.bash b/bash/bashrc.d/bc.bash
new file mode 100644
index 00000000..7cad9a52
--- /dev/null
+++ b/bash/bashrc.d/bc.bash
@@ -0,0 +1,5 @@
+# Don't print the bc(1) welcome message
+bc() {
+ command bc -q "$@"
+}
+
diff --git a/bash/bashrc.d/bell.bash b/bash/bashrc.d/bell.bash
new file mode 100644
index 00000000..1107b804
--- /dev/null
+++ b/bash/bashrc.d/bell.bash
@@ -0,0 +1,5 @@
+# Print a terminal bell
+bell() {
+ printf '\a'
+}
+
diff --git a/bash/bashrc.d/diff.bash b/bash/bashrc.d/diff.bash
new file mode 100644
index 00000000..d1567d17
--- /dev/null
+++ b/bash/bashrc.d/diff.bash
@@ -0,0 +1,5 @@
+# Use a unified format for diff(1) by default
+diff() {
+ command diff -u "$@"
+}
+
diff --git a/bash/bashrc.d/gdb.bash b/bash/bashrc.d/gdb.bash
new file mode 100644
index 00000000..3c9ed4a6
--- /dev/null
+++ b/bash/bashrc.d/gdb.bash
@@ -0,0 +1,5 @@
+# Don't print the GDB copyright message on every invocation
+gdb() {
+ command gdb -q "$@"
+}
+
diff --git a/bash/bashrc.d/rcsdiff.bash b/bash/bashrc.d/rcsdiff.bash
new file mode 100644
index 00000000..93966cc6
--- /dev/null
+++ b/bash/bashrc.d/rcsdiff.bash
@@ -0,0 +1,5 @@
+# Use a unified format for rcsdiff(1) by default
+rcsdiff() {
+ command rcsdiff -u "$@"
+}
+
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash
index b312591e..9b598192 100644
--- a/bash/bashrc.d/vim.bash
+++ b/bash/bashrc.d/vim.bash
@@ -1,7 +1,13 @@
# If Vim exists on the system, use it instead of ex, vi, and view
if hash vim 2>/dev/null ; then
- alias ex='vim -e'
- alias vi='vim'
- alias view='vim -R'
+ ex() {
+ command vim -e "$@"
+ }
+ vi() {
+ command vim "$@"
+ }
+ view() {
+ command vim -R "$@"
+ }
fi