aboutsummaryrefslogtreecommitdiff
path: root/profile.dot.link
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-08-31 12:42:33 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-08-31 12:42:33 -0300
commitecfa87f82f2a9fbc40f84d64cb8fda4038eced48 (patch)
tree6f19429e7b7bf5248eef0719f4df29f630fa7854 /profile.dot.link
parent66e883dd20b7076b5472708e829183b465ac8ffd (diff)
downloadprofile-ecfa87f82f2a9fbc40f84d64cb8fda4038eced48.tar.gz
profile-ecfa87f82f2a9fbc40f84d64cb8fda4038eced48.tar.bz2
Move cd function into .profile
Diffstat (limited to 'profile.dot.link')
-rw-r--r--profile.dot.link13
1 files changed, 13 insertions, 0 deletions
diff --git a/profile.dot.link b/profile.dot.link
index ef4c187..4beea3c 100644
--- a/profile.dot.link
+++ b/profile.dot.link
@@ -31,6 +31,19 @@ export PATH=$PATH
# See http://www.caliban.org/bash/#bashtips
export CDPATH=".:~:~/code:~/data:~/file:~/apps:/var/www/data"
+# See http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd
+if [ ! -z "$BASH" ]; then
+ function cd {
+ if [ -z "$*" ]; then
+ destination=~
+ else
+ destination=$*
+ fi
+
+ builtin cd "${destination}" > /dev/null
+ }
+fi
+
# Editor variables, avoiding "Avoiding protocol specified" error
export EDITOR="vim -X"