Customizing a Terminal With Zsh
Table of Contents
1. Zsh
Zsh is an alternative to Bash. Many of the useful features of Bash were incorporated into Zsh, but also many original features were added.
2. Oh My Zsh
Oh My Zsh is a framework for managing your Zsh configuration.
Plugins
To use plugins with Oh My Zsh, you'll need to clone and enable them in your ~/.zshrc
file.
-
zdharma/fast-syntax-highlighting: It adds syntax highlighting while you type commands, allowing you to quickly check if they are correct.
-
zsh-users/zsh-autosuggestions: It suggests commands using your history while you type (like a fuzzy finder).
plugins=(
git
zsh-autosuggestions
fast-syntax-highlighting
)
3. Change theme or use Spaceship (optional)
You can choose between themes from Oh My Zsh by replacing ZSH_THEME="robbyrussell"
in ~/.zshrc
or set up your own using Spaceship.
Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt.
Setup
In ~/.zshrc
, replace ZSH_THEME="robbyrussell"
with ZSH_THEME="spaceship"
.
Below this line, place this example of customization:
SPACESHIP_PROMPT_ORDER=(
user # Username section
dir # Current directory section
git # Git section (git_branch + git_status)
exec_time # Execution time
char # Prompt character
)
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_SEPARATE_LINE=false