aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-20 14:16:23 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-20 14:16:23 +1200
commit06794ed50f41598c22557e33461a1ee1225dba2d (patch)
tree0b8d70f748390f95402834f7480aa35bd28dfbe1
parentAlias cd directly rather than via alias (diff)
downloaddotfiles-06794ed50f41598c22557e33461a1ee1225dba2d.tar.gz
dotfiles-06794ed50f41598c22557e33461a1ee1225dba2d.zip
Wrapper for pushd defaults to $HOME if no args
-rw-r--r--.gitignore1
-rw-r--r--bash/bashrc.d/pushd.bash5
2 files changed, 6 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 2d46eab7..bbcf8728 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ bash/bashrc.d/*
!bash/bashrc.d/ls.bash
!bash/bashrc.d/options.bash
!bash/bashrc.d/prompt.bash
+!bash/bashrc.d/pushd.bash
!bash/bashrc.d/sprunge.bash
!bash/bashrc.d/tmux.bash
gnupg/*
diff --git a/bash/bashrc.d/pushd.bash b/bash/bashrc.d/pushd.bash
new file mode 100644
index 00000000..c3e01a5e
--- /dev/null
+++ b/bash/bashrc.d/pushd.bash
@@ -0,0 +1,5 @@
+# Make pushd default to $HOME if no arguments given, much like cd
+pushd() {
+ builtin pushd "${@:-$HOME}"
+}
+