DEV Community

Cover image for Setup guide for ZSH in GitHub codespaces
Krish
Krish

Posted on • Edited on

6 4

Setup guide for ZSH in GitHub codespaces

Setup ZSH

This post will guide you through to set up starship along with zsh suggestions and zsh syntax highlight for your codespaces.

Table of Contents

Setup Starship

This is an optional package if you want to beautify your terminal. Else you can also use any other ZSH themes.

Install starship

You cannot install starship in ZSH shell at the time of writing this. You can switch to bash.

curl -sS https://starship.rs/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Setup the config in the ZSH file

echo "eval \"\$(starship init zsh)\"" >> ${ZSOTDIR:-$HOME}/.zshrc
Enter fullscreen mode Exit fullscreen mode

Install ZSH Auto Suggestions

  1. Clone the repository
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode

You can change the path to anything you want. Here we use ~/.zsh/zsh-autosuggestions

  1. Add the invoke script to the ZSH config
echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ${ZSOTDIR:-$HOME}/.zshrc
Enter fullscreen mode Exit fullscreen mode

Install ZSH Syntax Highlighting

  1. Clone the repository
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
Enter fullscreen mode Exit fullscreen mode
  1. Add the invoke script to the ZSH config
echo "source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
Enter fullscreen mode Exit fullscreen mode

Note: If you see a Systemd in the terminal and want to remove it then follow the next command

mkdir -p ~/.config && printf "[container]\ndisabled = true" >> ~/.config/starship.toml
Enter fullscreen mode Exit fullscreen mode

Voila! You are ready to use ZSH with Starship and ZSH Auto Suggestions and Syntax Highlighting.

If you like it consider following me on github

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay