diff options
author | Camil Staps | 2016-02-09 13:33:49 +0100 |
---|---|---|
committer | Camil Staps | 2016-11-30 19:11:06 +0100 |
commit | ae4fdb755a6e07e9f86ae34551987a446092f0db (patch) | |
tree | 2b754ae5b224c3d9fe7d073228d220555fcebac1 /functions/c | |
parent | type pass (diff) |
zsh
Diffstat (limited to 'functions/c')
-rw-r--r-- | functions/c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/functions/c b/functions/c new file mode 100644 index 0000000..486a3c6 --- /dev/null +++ b/functions/c @@ -0,0 +1,24 @@ +#!/bin/zsh +# +# This lets you quickly jump into a project directory. +# +# Type: +# +# c <tab> +# +# ...to autocomplete on all of your projects in the directories specified in +# `functions/_c`. Typically I'm using it like: +# +# c holm<tab>/bo<tab> +# +# ...to quickly jump into holman/boom, for example. +# +# This also accounts for how Go structures its projects. For example, it will +# autocomplete both on $PROJECTS, and also assume you want to autocomplete on +# your Go projects in $GOPATH/src. + +if [ ! -z "$1" ] && [ -s "$GOPATH/src/github.com/$1" ]; then + cd "$GOPATH/src/github.com/$1" +else + cd "$PROJECTS/$1" +fi |