Skip to content

Instantly share code, notes, and snippets.

@skanev
Created July 12, 2021 09:01
Show Gist options
  • Save skanev/1550b8d2a4957ed8740a038a12442c5b to your computer and use it in GitHub Desktop.
Save skanev/1550b8d2a4957ed8740a038a12442c5b to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
typeset -gA jump_locations
jump_locations=(
zeitwerk ~/prj/zeitwerk
rails ~/prj/rails-dev-box/rails
tmp ~/tmp
)
j() {
if [[ -n $jump_locations[$1] ]]; then
cd ${~jump_locations[$1]}
else
echo "no location $1"
false
fi
}
_j() {
compadd ${(k)jump_locations}
}
compdef _j j
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment