aboutsummaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorMiquel Sabaté <mikisabate@gmail.com>2013-03-01 18:20:48 +0100
committerMiquel Sabaté <mikisabate@gmail.com>2013-03-01 18:20:48 +0100
commit57a57660832b1d5a6bea49b04a947e2aa245fe6b (patch)
tree69cd15038af6dad15db9a1e3a0c2c2dc11239c54 /bashrc
parent0ffa202ac86836eb86de1bfb44c28c2b89ecc706 (diff)
downloaddotfiles-57a57660832b1d5a6bea49b04a947e2aa245fe6b.tar.gz
dotfiles-57a57660832b1d5a6bea49b04a947e2aa245fe6b.zip
Putting the "g" function back to the bashrc file.
I tried to do fancy stuff with the CDPATH and a directory with symlinks inside, but it didn't work the way I wanted. So the "g" function is back. I've also removed some shortcuts that are not needed.
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc23
1 files changed, 21 insertions, 2 deletions
diff --git a/bashrc b/bashrc
index 2b2d43e..4cbab8e 100644
--- a/bashrc
+++ b/bashrc
@@ -50,5 +50,24 @@ export GOROOT=$HOME/Projects/go
export GOPATH=$HOME/.go
export PATH=$HOME/.go/bin:$HOME/Projects/go/bin:$PATH
-# Exporting our own CDPATH
-export CDPATH=$CDPATH:$HOME/.cd
+# Including shortcuts, idea from https://github.com/fxn/dotfiles
+GO_SHORTCUTS=(
+ ruby
+ $RUBY
+
+ build
+ $KDEV/build/kdev-ruby
+)
+
+function g {
+ local target=$1
+ local len=${#GO_SHORTCUTS[@]}
+ for (( i=0; i<$len; i+=2 )); do
+ if [[ "$1" = "${GO_SHORTCUTS[$i]}" ]]; then
+ cd "${GO_SHORTCUTS[$i+1]}"
+ return
+ fi
+ done
+ echo "unknown shortcut"
+}
+