DEV Community

Cover image for Setting up ZSH and Oh-my-ZHS with autocomplete plugins
Roman
Roman

Posted on

Setting up ZSH and Oh-my-ZHS with autocomplete plugins

In this post I'll provide you with step-by-step tutorial on how to set up oh-my-zsh in your terminal with in my opinion, essential plugins.
First things first:
If you run Linux you can use your packet manager to install all neccesarry packages and jump straight to configuration section.
Instead of apt install use your packet manager commands.

Linux install using packet manager

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh zsh-autocomplete
Enter fullscreen mode Exit fullscreen mode

Terminal install using Git and sh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode
  • Install plugins

    git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

    git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting

    git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete

Configuration

  • Enable plugins by adding them to .zshrc.

    • Open .zshrc
    • nano ~/.zshrc
    • Find the line which says plugins=(git).
    • Replace that line with
 plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
  fast-syntax-highlighting
  zsh-autocomplete
 )
Enter fullscreen mode Exit fullscreen mode
  • Reload your environment to make changes work!
    • source ~/.zshrc

Optional

  • Enable cutom theme
    • nano ~/.zshrc
    • Find the ZSH_THEME="robbyrussell"
    • Replace with ZSH_THEME="alanpeabody"

You can find my fork of the file on Github Gists

Top comments (3)

Collapse
 
j3ffyang profile image
Jeff Yang

There's a typo in subject

Oh-my-ZHS -> Oh-my-ZSH

Collapse
 
moresol profile image
Maksym

Helped me

Collapse
 
abhay_verma_4983d52bedf13 profile image
abhay verma

Great article, works like a charm