Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save n1snt/454b879b8f0b7995740ae04c5fb5b7df to your computer and use it in GitHub Desktop.

Select an option

Save n1snt/454b879b8f0b7995740ae04c5fb5b7df to your computer and use it in GitHub Desktop.
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Note

I’ve written a newer optimized 2026 version of this guide with a faster setup using Zinit + Starship and improved plugin loading.

This version avoids slow shell startups and works better with modern Zsh setups.

Updated guide: https://gist.github.com/n1snt/2cccc8aa5f7b645a7628d3512c70deb6

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install plugins.

  • autosuggesions plugin

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

  • zsh-syntax-highlighting plugin

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

  • zsh-fast-syntax-highlighting plugin

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

  • zsh-autocomplete plugin

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

Enable plugins by adding them to .zshrc.

  • Open .zshrc

    nvim ~/.zshrc

  • Find the line which says plugins=(git).

  • Replace that line with plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)

References

@GiaKhangLuu
Copy link
Copy Markdown

Words cannot describe my gratitude!!!

@Tjkent88
Copy link
Copy Markdown

great write up and plugin combination, thanks!

@evsar3
Copy link
Copy Markdown

evsar3 commented Jun 19, 2025

🔥

@yaozzzhao
Copy link
Copy Markdown

I asked AI to write a script for me to do the tricks above. :) It works well in my environment.

#!/bin/bash

# install ZSH and related packages
echo "Installing ZSH and related packages..."
sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh -y

# Install Oh My ZSH
echo "Installing Oh My ZSH..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

# Install plugins
echo "Installing ZSH plugins..."

# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

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

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

# autocomplete
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autocomplete

# Change .zshrc file
echo "Configuring .zshrc..."
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)/' ~/.zshrc

# switch to zsh as default shell
echo "Changing default shell to ZSH..."
chsh -s $(which zsh)

echo "Installation completed! Please restart your terminal or run 'source ~/.zshrc' to apply changes."

@marlonrichert
Copy link
Copy Markdown

@jacob-fm

is there an easy way to disable that?

Not at the moment, but feel free to submit a pull request. It's not hard to implement. You'll need to change only a small part of the code

@sPalmiro
Copy link
Copy Markdown

I should have listened to "Do we want to mix all of those? Aren't some of them competing?"... zsh-autocomplete won't play ball with fast-syntax-highlighting. Many thanks for the gist.

@vanduc2708
Copy link
Copy Markdown

Thanks for your help!

@AhmedEzzat12
Copy link
Copy Markdown

Have you found solution for that semicolo issue? @jacob-fm @PhilipLutley

@chojuninengu
Copy link
Copy Markdown

@yaozzzhao that your script is great, thanks for the simplification, it's same thing i had in mind

@gkonuralp
Copy link
Copy Markdown

Thank you!

@LucasSaDito
Copy link
Copy Markdown

Thank you!

@martiam
Copy link
Copy Markdown

martiam commented Aug 14, 2025

I should have listened to "Do we want to mix all of those? Aren't some of them competing?"... zsh-autocomplete won't play ball with fast-syntax-highlighting. Many thanks for the gist.

But what about zsh-syntax-highlighting and zsh-fast-syntax-highlighting? Do those two compete?

@mheryerznkanyan
Copy link
Copy Markdown

Works for me thank you

@adiprnm
Copy link
Copy Markdown

adiprnm commented Sep 4, 2025

Thank you so much!

@afonso-rodrigues-azos
Copy link
Copy Markdown

Tks

@chojuninengu
Copy link
Copy Markdown

Great right

@cheack
Copy link
Copy Markdown

cheack commented Nov 16, 2025

Awesome! Thanks!

@pratap-coder-dev
Copy link
Copy Markdown

Great ! Bookmarking it !

@chojuninengu
Copy link
Copy Markdown

Nice

@baslia
Copy link
Copy Markdown

baslia commented Dec 18, 2025

This is awesome, thank you!

@z44d
Copy link
Copy Markdown

z44d commented Dec 23, 2025

i have used this configurations on my all devices and every time i get new device or install new linux distro i gets back to here, thanks!

@Navelogic
Copy link
Copy Markdown

Nice!

@FortanPireva
Copy link
Copy Markdown

Awesome configurations, thanks!

@appausa
Copy link
Copy Markdown

appausa commented Jan 15, 2026

Esta muy buena pero yo lo voy a intalar en Linux From Scratch

@blu14x
Copy link
Copy Markdown

blu14x commented Jan 22, 2026

But what about zsh-syntax-highlighting and zsh-fast-syntax-highlighting? Do those two compete?

makes no sense to use both. i use fast-syntax-highlighting

@Kenengmathias
Copy link
Copy Markdown

Thanks man

@Nemo4110
Copy link
Copy Markdown

Thanks broooooo

@iamsurajdev
Copy link
Copy Markdown

This is GOAT

@iwansal64
Copy link
Copy Markdown

I asked AI to write a script for me to do the tricks above. :) It works well in my environment.

#!/bin/bash

# install ZSH and related packages
echo "Installing ZSH and related packages..."
sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh -y

# Install Oh My ZSH
echo "Installing Oh My ZSH..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

# Install plugins
echo "Installing ZSH plugins..."

# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

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

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

# autocomplete
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autocomplete

# Change .zshrc file
echo "Configuring .zshrc..."
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)/' ~/.zshrc

# switch to zsh as default shell
echo "Changing default shell to ZSH..."
chsh -s $(which zsh)

echo "Installation completed! Please restart your terminal or run 'source ~/.zshrc' to apply changes."

Yoo, thanks a lot dude! It makes it even faster XD

Copy link
Copy Markdown

ghost commented Mar 1, 2026

I asked AI to write a script for me to do the tricks above. :) It works well in my environment.

#!/bin/bash

# install ZSH and related packages
echo "Installing ZSH and related packages..."
sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh -y

# Install Oh My ZSH
echo "Installing Oh My ZSH..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

# Install plugins
echo "Installing ZSH plugins..."

# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

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

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

# autocomplete
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autocomplete

# Change .zshrc file
echo "Configuring .zshrc..."
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)/' ~/.zshrc

# switch to zsh as default shell
echo "Changing default shell to ZSH..."
chsh -s $(which zsh)

echo "Installation completed! Please restart your terminal or run 'source ~/.zshrc' to apply changes."

cURL is not installed by default on Ubuntu. You may want to add it on the installation process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment