A shell utility allowing users to navigate to aliased directories supporting auto-completion 🐾
User registers directory aliases, for example:
goto -r dev /home/iridakos/development
and then cd
s to that directory with:
goto dev
goto
comes with a nice auto-completion script so that whenever you press the tab
key after the goto
command, bash or zsh prompts with suggestions of the available aliases:
$ goto <tab>
bc /etc/bash_completion.d
dev /home/iridakos/development
rubies /home/iridakos/.rvm/rubies
Clone the repository and run the install script as super user or root:
git clone https://github.com/iridakos/goto.git
cd goto
sudo ./install
Copy the file goto.sh
somewhere in your filesystem and add a line in your .zshrc
or .bashrc
to source it.
For example, if you placed the file in your home folder, all you have to do is add the following line to your .zshrc
or .bashrc
file:
source ~/goto.sh
A formula named goto
is available for the bash shell in macOS.
brew install goto
echo -e "\$include /etc/inputrc\nset colored-completion-prefix on" >> ~/.inputrc
Note:
- you need to restart your shell after installation
- you need to have the bash completion feature enabled for bash in macOS (see this issue):
- you can install it with
brew install bash-completion
in case you don't have it already
- you can install it with
- Change to an aliased directory
- Register an alias
- Unregister an alias
- List aliases
- Expand an alias
- Cleanup
- Help
- Version
- Extras
- Troubleshooting
To change to an aliased directory, type:
goto <alias>
goto dev