Skip to content

Instantly share code, notes, and snippets.

@abhishekmishragithub
Created September 11, 2025 10:52
Show Gist options
  • Select an option

  • Save abhishekmishragithub/95f4ab0a033303e71531e7dd6a45c5a8 to your computer and use it in GitHub Desktop.

Select an option

Save abhishekmishragithub/95f4ab0a033303e71531e7dd6a45c5a8 to your computer and use it in GitHub Desktop.
zsh plugin

βœ… Step 1: Install the plugins (if not already installed)

πŸ”Ή A. zsh-autosuggestions

If you haven’t already:

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

πŸ”Ή B. zsh-syntax-highlighting (highly recommended with autosuggestions)

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

(Optional) πŸ”Ή C. zsh-completions

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions

βœ… Step 2: Update your .zshrc to include the plugins

Edit this line in your .zshrc:

plugins=(git)

Change it to:

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
  zsh-completions
)

⚠️ Make sure these plugin names exactly match the folder names inside ~/.oh-my-zsh/custom/plugins.


βœ… Step 3: Load the plugin properly β€” add these AFTER source $ZSH/oh-my-zsh.sh

At the end of your .zshrc, add these lines:

# Enable autosuggestions
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

# Enable syntax highlighting (must be last)
source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

🧠 zsh-syntax-highlighting must always be sourced last, or it may break.

If you installed zsh-completions, you can add this too:

fpath+=$ZSH_CUSTOM/plugins/zsh-completions/src
autoload -Uz compinit && compinit

βœ… Step 4: Restart your shell or reload .zshrc

source ~/.zshrc

Or close and reopen the terminal.


πŸ§ͺ Step 5: Test the plugins

  • Autosuggestions: Start typing a previously used command. If it appears in light grey, it's working.
  • Syntax highlighting: Try mistyping a command (e.g., gti instead of git) β€” it should highlight errors in red.
  • Completions: Type a partial command or path and press Tab.

βœ… Bonus: Set a Theme

Right now, your theme is blank:

ZSH_THEME=""

You can try something simple like:

ZSH_THEME="agnoster"

Or install a custom one like Powerlevel10k later.

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