As developers, we spend a lot of time working in the command line, and we change directories frequently. Procedures that we do frequently are worth optimizing, in this post I'll introduce a tool I wrote that might help you save more time changing directories.
Suppose that in your daily development routine, you often need to switch between the following directories:
cd ~/go/src/github.com/pingcap/tidb cd ~/go/src/github.com/pingcap/tidb-binlog cd ~/projects/redis cd /tmp cd /usr/local/Cellar
Without any tool, the best you could do to save some typing is to use
.. or shell history. But we can do better.
I rewrote autojump in Go and created the tool shonenjump. With this tools, once you have entered the previous directories once, they would be saved in a data file, and then we can access them quickly:
j tidb # Jump to ~/go/src/github.com/pingcap/tidb j go git tidb # Jump to ~/go/src/github.com/pingcap/tidb j tm # Jump to /tmp j Cell # Jump to /usr/local/Cellar
If you are interested to improve your productivity, please give it a try, it can be easily installed and uninstalled with
Homebrew on macOS.