diff options
| author | Miquel Sabaté <mikisabate@gmail.com> | 2013-03-01 18:20:48 +0100 |
|---|---|---|
| committer | Miquel Sabaté <mikisabate@gmail.com> | 2013-03-01 18:20:48 +0100 |
| commit | 57a57660832b1d5a6bea49b04a947e2aa245fe6b (patch) | |
| tree | 69cd15038af6dad15db9a1e3a0c2c2dc11239c54 | |
| parent | 0ffa202ac86836eb86de1bfb44c28c2b89ecc706 (diff) | |
| download | dotfiles-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.
| -rw-r--r-- | bashrc | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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" +} + |
