Hacker News new | ask | show | jobs
by jachee 1949 days ago
Oh-my-zsh with the fzf plugin has a lot of navigation-friction removal.

    cd ~/r/pr/e/de<tab>
Becomes

    cd ~/repos/projectlongname/environments/development
It also has built in push/pop, with minus always returning to the previous path, various numbers of dots, up to six I believe, navigating up the tree, and cd - <tab x2> showing interactive breadcrumbs of recent paths for easy as click-and-click navigation.
1 comments

I think most of this is out of the box OMZ (without the fzf plugin).
Built-in zsh behaviour in fact, oh-my-zsh just enables some extremely useful non-default options.

With a compinit call the directory substring expansion will work. And, with auto_pushd enabled cd fiddles with the directory stack.

The ....... behaviour is interesting because it uses a global alias(alias -g) which is an awesome feature for text expansion anywhere in a line, unlike standard aliases which only expand where commands should be given. It means, for example, you can do `readlink -f ......` and it would perform `readlink ../../../../../..`. Aliases on zsh are very powerful indeed.

I'm writing this text in the hope it drives at least one person to burn an afternoon on the amazing(but huge) zsh documentation, because the entire thing is full of gems.

I'll add that to my Read-Only Friday. I got tossed directly into the zsh/omz/fzf pool head-first from bash, so the borders of what's what are murky. Definitely some powerful stuff, so far.
In which case, I've won!

Seriously though, I think you were probably lucky to have experienced zsh that way. The out of the box experience is incredibly bare. Said as a fellow oh-my-zsh user going back the full twelve years, according to the history of oh-my-zsh's jnrowe theme ;)

I do believe there is a lot of useful knowledge to be gained from working back towards zsh first principles though, especially if -- like me -- you spend hours a day alongside the prompt.