DEV Community

Cover image for zsh / oh-my-zsh up and running
Meabed
Meabed

Posted on • Originally published at meabed.com

zsh / oh-my-zsh up and running

While bash still powers most the *nix system, zsh offer better developer experience in dealing with terminal TUI.

Recently macOS announced that is moving from bash to zsh, and as consequence so many developers will have to re-learn a bit of what they do with bash to have better experience dealing with TERMINAL commands in mac.

As I have been using ZSH for more than 6 years now, I wanted to share an easy and fast way to start with ZSH that gets you great developer experience on your mac or linux.

Download and use iTerm2

The setup below gets you:

  • zsh
  • oh-my-zsh
  • antigen package manager
  • config file with:
    • zsh-completion
    • autojump j
    • history h
    • zsh-autosuggestions
    • fast-syntax-highlighting
    • zsh-history-substring-search
    • and so many more with adding plugin as simple as editing 1 line in the config file!

To get started:

# install the dependencies with mac brew
brew install zsh antigen zsh-completions
Enter fullscreen mode Exit fullscreen mode

Then copy - modify as you need - and paste this gist file in your home as .zshrc "~/.zshrc"

Below is a screen that shows some of the great oh-my-zsh feature - history completion, syntax highlight, menu-auto-completion, jump etc...

ZSH

If you love working with terminal and you looking for great DX, you definitely use iterm2, zsh, oh-my-zsh with this plugins above.

Need help in installing / configuring zsh plugins - Feel free to reach out :)

Top comments (5)

Collapse
 
madhur profile image
Madhur Ahuja

What about performance? oh-my-zsh with all such plugins takes over 1 sec to load.

Collapse
 
meabed profile image
Meabed

I run this on Mac 16gb 2015 model
With iterm2 4x4 panels = 16 zsh
And it works pretty well less than second opening.

Do you have some benchmarks or issues u ran through already ?

Collapse
 
madhur profile image
Madhur Ahuja

Yes, I have used zmodload zsh/zprof to profile. It takes a sec. Also using 16 GB MAC.

Bulk of the time is spent in compinit and zsh-syntax-highlighting.

There are articles on optimizing compinit. Yet to do that. But I believe any article suggesting heavy use of oh-my-zsh should come with a performance optimization techniques.

Thread Thread
 
meabed profile image
Meabed

Yes correct because it compiles all history and suggestions, would you share some of this optimization articles, as it would be helpful for me and everyone reading. Thanks

Thread Thread
 
madhur profile image
Madhur Ahuja

There are tons of it.

blog.jonlu.ca/posts/speeding-up-zsh

This particular one has references to others as well.