I created a bash utility named goto that allows users to navigate to aliased directories.
It comes with a nice auto-completion script so that whenever you press the tab
key after the goto
command, bash prompts with suggestions of the available aliases:
$ goto <tab>
bc /etc/bash_completion.d
dev /home/iridakos/development
rubies /home/iridakos/.rvm/rubies
Example
The following command will register an alias for a long path:
goto --register workdir /mnt/development/projects/go/workspace
Afterwards, user can navigate to that folder with just:
goto workdir
You can find the code and the installation and usage guides on GitHub.
Update 2018-03-25
The tool can be used also in zsh and there is a brew formula available for macOS users (brew install goto
)
Top comments (3)
Seems interesting.
Just wondering why not just setting an environment variable with
.basrc
?The purpose of the tool is to allow users register aliases for their desired directories (like project directories, workspaces etc) and then with the help of bash completion navigate to them very easily using their aliases. Environment variables wouldn't make this process that easy.
This make sense! Quite cool quite cool.