Advent of Supercomputing: Day 13

Ritoban Roy-Chowdhury

Zoxide

Tired of manually having to type out paths to cd to a directory? Or worse yet, clicking through them in a GUI file manager? Does cd Docu<tab>/col<tab>/fa<tab>_22/<tab><tab> feel like a familiar painful feeling?

zoxide to the rescue!

Zoxide is an excellent program that creates an alias z in your shell, that locally keeps a database of all the directories you visit, and then lets you automatically jump to the most common directory that matches closest to its argument. For example, to jump to the folder Documents/college/fall_2023/cse_101, I might just type z 101, and it’ll take me straight there!

Here’s an example of how quickly it’s possible to move around using it:

To get started, head over to the Zoxide Github page and run the script corresponding to your shell (all major, and quite a few minor shells are supported). In particular, on bash, first

curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash

and then add

eval "$(zoxide init bash)"

to the end of your ~/.bashrc.

Other similar projects

  • Autojump is a very similar idea, written in python
  • FZF supports somewhat similar functionality as a mapping, but with fuzzy finding for relevant directories