DEV Community

Cover image for goto - navigate to aliased directories
Lazarus Lazaridis
Lazarus Lazaridis

Posted on • Edited on

2 2

goto - navigate to aliased directories

I created a bash utility named goto that allows users to navigate to aliased directories.

goto

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
Enter fullscreen mode Exit fullscreen mode

Example

The following command will register an alias for a long path:

goto --register workdir /mnt/development/projects/go/workspace
Enter fullscreen mode Exit fullscreen mode

Afterwards, user can navigate to that folder with just:

goto workdir
Enter fullscreen mode Exit fullscreen mode

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)

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (3)

Collapse
 
ycmjason profile image
YCM Jason

Seems interesting.

Just wondering why not just setting an environment variable with .basrc?

Collapse
 
iridakos profile image
Lazarus Lazaridis

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.

Collapse
 
ycmjason profile image
YCM Jason

This make sense! Quite cool quite cool.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay