Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to jump to directories in fish using z-fish

📅 2013-Aug-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

The biggest problem with using the shell is that it is painful to jump to different directories. If only the shell could remember the directories you most frequently use and allow you to jump to them by only typing only a few characters of its name? This is what z does! However, z is written for bash. Fish users need not despair since there is z-fish.

Install and use

  1. Clone the Github repository of z-fish

  2. Add this line to your ~/.config/fish/config.fish

. /path/to/z.fish
  1. cd around to all the directories you frequently use. This helps z-fish build its database. You can see this in the file ~/.z

  2. Now, to jump to any directory just provide a substring of its name to z. For example: z foo

Tried with: fish 2.7.1 and Ubuntu 18.04 LTS