‹ BackHN Continuity

Thread

Small programming tricks

681 points · 294 comments · signa11

  1. disinterred · · focus · HN ↗
    The most useful shell trick I've used to date is mapping the 'cd' command to 'zoxide', which is a more powerful version of cd that remembers folders you've been to.
    1. qxxx · · focus · HN ↗
      yes! zoxide is also probably my most used tool. I did not map it to cd yet, but I use the z command to jump into directories indexed by zoxide.
    2. BeetleB · · focus · HN ↗
      I go a step further. When I press Alt + j, it sends all the directories in zoxide to fzf (in order of frequency), and I quickly choose the directory and jump to it.

      I rarely type "cd" anymore. A huge quality of life improvement!

      1. maleldil · · focus · HN ↗
        You don't need to use fzf. Zoxide has an interactive function too.
    3. 1718627440 · · focus · HN ↗
      Is it much more powerful, than pushd?
      1. SAI_Peregrinus · · focus · HN ↗
        Yes, because you don't have to pop in order. "zoxide <subpath>" is "search the history of working directories for a path ending in <subpath> and cd to that".
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.