Zsh Tricks to Blow Your Mind

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • OPS - Build and Run Open Source Unikernels
  • GitHub repo starship

    ☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!

    Happy fish+starship user here. Recently all modules where refactored to load lazily: https://github.com/starship/starship/issues/2111

  • GitHub repo libqalculate

    Qalculate! library and CLI

    A lot of these can be done in Bash, too!

    1. `mkcdir () { mkdir -- "$1" && cd -- "$1"; }`

    2. `bind '"\e[A":history-search-backward'; bind '"\e[B":history-search-forward'`. Ctrl+R also has the same behavior.

    3. `shopt -s autocd`

    5. `qalc` from libqalculate: https://github.com/Qalculate/libqalculate

    8. Default behavior for Bash.

    9. Default behavior for Bash.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • GitHub repo fzf

    :cherry_blossom: A command-line fuzzy finder

    Fuzzy find makes searching history much more powerful than what is listed in the article. I only use it together with ctr-r, but you can set it up for even more goodness.

        # Fuzzy find - see https://github.com/junegunn/fzf

  • GitHub repo jog

    Simple script to print the last 10 commands you ran in the current directory


    I'm not sure why this isn't a part of zsh already, but if you want to see the last few commands you ran in the current directory, that little utility will do that for you. Great for reminding yourself what you did last time you were in a directory.

  • GitHub repo zsh4humans

    A turnkey configuration for Zsh

    zsh4humans is the most recent zsh “trick” I’ve discovered. zsh is a bit like emacs when first installed: it can do a lot of things but it’s not nearly as useful without a lot of manual configuration. I’m honestly surprised it doesn’t have more stars on GitHub.


  • GitHub repo powerlevel10k

    A Zsh theme

    Last time I checked it was allowed than https://github.com/romkatv/powerlevel10k, because it doesn't decouple the rendering of the prompt from the background processes collecting status information. Ergo no instant prompt. Also, some other cool tricks w.r.t. prompt vs. backscroll.

    Has that changed?

  • GitHub repo zsh-z

    Jump quickly to directories that you have visited "frecently." A native Zsh port of z.sh.

    My company is fond of putting source code under very deep directory structures, so I quite like Z: https://github.com/agkozak/zsh-z

    Not ZSH specific, but it's also handy to load project-specific environment variables automatically on entering directories: https://direnv.net/.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • GitHub repo zsh-autocomplete

    🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.

    Here's a nice tool for sporadic terminal users like myself: https://github.com/marlonrichert/zsh-autocomplete

    It has some minor issues but it has slowly been replacing most individual scripts and tools I was sporadically using before.

  • GitHub repo pure

    Pretty, minimal and fast ZSH prompt (by sindresorhus)

    A lot of the tips from TFA can be done in BASH as well and I'm sure the following of my own zsh tips also have a bash equivelant, but I'd like to share anyway:

    Pure theme - My absolute favorite shell theme. Has almost all the bells and whistles of the powerlevel9k shown in the article, but looks, much cleaner and less in-your-face.

    After downloading the theme, I've added this to my `.zshrc` file:

        # PURE theme - see https://github.com/sindresorhus/pure

  • GitHub repo zsh-syntax-highlighting

    Fish shell like syntax highlighting for Zsh.

    Lastly I've added a syntax highlighter, which is really neat.

          # ZSH Syntax Highlighter - see https://github.com/zsh-users/zsh-syntax-highlighting

  • GitHub repo zsh-autosuggestions

    Fish-like autosuggestions for zsh

    +1 for the `zsh-autosuggestions`: https://github.com/zsh-users/zsh-autosuggestions

    Bonus: `zsh-syntax-highlighting` is excellent: https://github.com/zsh-users/zsh-syntax-highlighting

  • GitHub repo ohmyzsh

    🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

    Is this similar to Oh My Zsh [1]? I personally have been using Oh My Zsh for years and I've always been a fan of it. I can quickly add themes and plugins and have my shell ready to go how I like it quite quickly on new systems.

    [1]: https://ohmyz.sh/

  • GitHub repo asdf-exec

    Native command to run asdf shims

    Yeah, it is tricky. Perhaps if the prompt was generated async?

    Turns out my main issue was due to having a slow node --version command due to using asdf!

    This project was a huge help: https://github.com/danhper/asdf-exec

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts