Zsh goodies for j.d

Hello,

I changed to JD recently. Using zsh on an Arch OS I looked for a way to move between JD directories fast without remebering too many of the names. Instead I wanted to rely on tab completion, because thats my practiced way to move through the filesystem using the terminal. Furthermore, I wanted the completion candidates to be created at the moment I hit tab and not be sourced from an index which has to be updated regularly.

Because I couldn’t find a simple function which handles this as I want it, I wrote one myself. Here’s a small GIF showing how it works:

gif-usage-2024-01-07 16-59

The function itself as well as the corresponding completion function should be inserted into the .zshrc directly.

The code is still a work in progress, since I want to add some more features to move through the JD system even more comfortable.

Everybody who is interested can find it on Codeberg (together with another small JD script to rename JD-directories). Don’t be confused by the repo name conataining “bash”, but the function only works with zsh. I’m happy if someone finds it useful.

2 Likes