goto
is a lightweight, interactive, and POSIX-compatible shell tool that lets you register directory shortcuts and jump to them with ease.
💡 No aliases. No clutter. Just clean shortcut navigation for your terminal life.
- 📁 Register named shortcuts to any directory
- 💨 Instantly jump to a shortcut (
goto name
) - 🧠 Autocomplete shortcut names in Bash or Zsh
- 🛡️ No sudo, system files, or environment hacks
- 📦 Portable: Works in Bash, Zsh, and Dash
git clone https://github.com/byteoverride/goto.git
cd goto
mkdir -p ~/.local/bin
cp goto ~/.local/bin/
chmod +x ~/.local/bin/goto
###For bash (~/.bashrc)
goto() {
if [ "$1" = "-r" ] || [ "$1" = "-l" ] || [ "$1" = "-h" ] || [ "$1" = "-d" ]; then
command goto "$@"
else
local result
result=$(command goto "$1" 2>/dev/null)
if [ -d "$result" ]; then
cd "$result"
else
echo "$result"
return 1
fi
fi
}
_goto_complete() {
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $(cut -d'|' -f1 "$HOME/.config/goto/config" | grep -i "^$cur") )
}
complete -F _goto_complete goto
goto() {
if [ "$1" = "-r" ] || [ "$1" = "-l" ] || [ "$1" = "-h" ] || [ "$1" = "-d" ]; then
command goto "$@"
else
local result
result=$(command goto "$1" 2>/dev/null)
if [ -d "$result" ]; then
cd "$result"
else
echo "$result"
return 1
fi
fi
}
_goto_complete() {
local expl
local shortcuts
shortcuts=(${(f)"$(cut -d'|' -f1 ~/.config/goto/config 2>/dev/null)"})
_describe -t shortcuts 'goto shortcuts' shortcuts
}
compdef _goto_complete goto
goto -r <shortcut_name> <Directory>
goto -r Tools /home/username/Documents/tools
goto -l
goto <shortcut_name>
goto Tools