DEV Community

Cover image for A beginner's guide for setting up autocomplete on OhMyZsh & Hyper with plugins & themes!
Kumar Abhirup
Kumar Abhirup

Posted on

Zsh Autosuggestions A beginner's guide for setting up autocomplete on OhMyZsh & Hyper with plugins & themes!

Your normal bash might have functions you normally need, but if you are a regular terminal user, zsh will be changing the way you type commands.

Features that zsh, ohmyzsh and hyper together provide will simply blow your mind.

Did you know you can control Spotify from your terminal? Yes, Hyper Plugins allow you to do that.

Setting up this stuff can be overwhelming for a beginner, so here's a very simple guide to get started! 🀩

πŸ”₯ Introduction

If you are using a regular terminal like what you see below, you are missing a lot of features that OhMyZsh provides.

Flaviocope's MacOS Terminal

Today, you'll be doing a terminal makeover to make it look like this...

My Hyper Terminal

Not just the looks, but OhMyZsh comes with ample of features to lighten up your programming journey.

At the end of the tutorial, this is what you would be able to do in your terminal...

  • NPM, Git autocomplete
  • Auto Suggestions while you type in the terminal
  • Syntax Highlighting that tells if a command is defined
  • Use the cursor to edit the terminal command
  • See git branch and git status of the current directory
  • Open new tabs with the same directory as the current tab
  • Use OhMyZsh features like navigating without using cd, usage of ll, easier tab-click based navigation, and much more!

❀️ Get Started

First, you have to install zsh. In some cases (depends on the OS you are running), it would already be installed. Therefore, check if it's installed by running zsh --version in your terminal.

The installation process for zsh is different in different Operating Systems. Checkout the Zsh Installation Guide to install zsh.

After you install Zsh, make sure you make it your default shell. Run the following in your terminal to do so.

$ sudo chsh -s $(which zsh)
Enter fullscreen mode Exit fullscreen mode

Log out and Log in back to your default shell. Run echo $SHELL and the output /bin/zsh or similar is expected.

πŸ”° Installing OhMyZsh

Note that zsh and OhMyZsh are different.

Install OhMyZsh by running the following command in terminal.

$ sudo sh -c "$(curl -fsSL"
Enter fullscreen mode Exit fullscreen mode

When you install OhMyZsh, many plugins come with it for your rescue!

To add useful plugins, Open ~/.zshrc in TextEdit/Notepad/Vim/VSCode.

In the list of plugins that you see in the file, just add a plugin named npm, like this πŸ‘‡

  npm # you added this
Enter fullscreen mode Exit fullscreen mode

Voila! You are done with OhMyZsh! To see the changes, run source ~/.zshrc in the terminal, and now you have the features of an OhMyZsh shell.

πŸ”° Installing HyperTerm by Zeit

Zeit (the creator of and Next.js) has created an awesome terminal app for us that is built in Electron.

Download Hyper from here.

βš›οΈ Configure Hyper with OhMyZsh

Open Hyper Terminal. You won't see OhMyZsh running there. So, go to Hyper Settings. On OSX, it's Hyper > Preferences.

That would open a .hyper.js file in your favorite editor. This file contains all the settings of your terminal that are super easy to control!

To enable OhMyZsh as a default shell in Hyper, make this change in .hyper.js πŸ‘‡

- shell: '/bin/bash'
+ shell: '/bin/zsh'
Enter fullscreen mode Exit fullscreen mode

And that would make OhMyZsh your default Hyper Terminal shell!

🀩 Autocomplete while you type a command

Git Clone the zsh-autocomplete plugin in the OhMyZsh plugin folder.

$ sudo git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode

Once that is done, add the plugin in the ~/.zshrc file's plugin list.

Enter fullscreen mode Exit fullscreen mode

πŸŽ‰ Zsh sytax highlighting

Git Clone the zsh-syntax-highlighting plugin in the OhMyZsh plugin folder.

$ sudo git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Enter fullscreen mode Exit fullscreen mode

And once again add it in the plugins list of the .zshrc file.

Enter fullscreen mode Exit fullscreen mode

Note: To reflect every change you make, do source ~/.zshrc in the terminal.

πŸ“― Enabling Hyper related features and themes

Open .hyper.js by toggling Settings of Hyper Terminal.

Check out the plugins: [...] section and paste these plugin names there.

plugins: [
Enter fullscreen mode Exit fullscreen mode

Save the file and Hyper would automatically install those plugins and themes for you. To reflect the changes, just close and start Hyper Terminal again.

Hooray! You now have all the features in your terminal which were listed in the start of this article.

BONUS: Setting up the same terminal configuration for Integrated Terminal in VSCode

In the VSCode Settings, add the following JSON key-value pairs and you'll be good to go!

  "": "/bin/zsh",
  "terminal.integrated.fontSize": 16
Enter fullscreen mode Exit fullscreen mode

And that is it folks!

πŸ”₯ Resources

πŸ† About me

I am Kumar Abhirup, a 16-year-old JavaScript React developer from India who keeps learning a new thing every single day.

Connect with me on Twitter 🐦
My personal website and portfolio πŸ–₯️

Comment below your better ways, and suggestions to improve this article.Β :)

Top comments (10)

ryannerd profile image
Ryan Jentzsch

No need to use sudo with git commands. In fact it's not a good idea

netpenguins profile image
Chad Wilson

Yea great article but please edit to remove the sudo. This is just a bad idea on many levels as these commands don't need it under any normal circumstance.

chuxmykel profile image
Chukwudi Ngwobia

I agree. It's an amazing article still. πŸ”₯
I ran the commands without sudo and they work just fine.

gbouras profile image

well done.

ahmadhidayatullah profile image
Ahmad Hidayatullah

sudo git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

command above will be reflected when you're using/enable ZSH_CUSTOM in .zshrc but if you are not enable ZSH_CUSTOM you can use this command:

sudo git clone ${ZSH:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

thanks for your sharing bro, helpfully!

melezhik profile image
Alexey Melezhik

good overview of ohmyzsh. other might also be interested in (alternative?) tool named Tomtit/Sparrow - see my post -

dannysofftie profile image
Danny Sofftie

This is a great write up Kumar

ewoks profile image

Could you share few words about hyper advantage over native (non electron based) terminals? Brief description about recommended hyper plugins would be appreciated as well. Thanks

sabbir2609 profile image

Thanks BTW 😊

josep11 profile image

At the moment with VS Code zsh is configured as so:
Add this to settings:
"terminal.integrated.defaultProfile.osx": "zsh"