sudo apt update
sudo apt install zsh curl gitSet Zsh as default shell:
chsh -s $(which zsh)Restart your terminal.
Zinit is used as a fast and lightweight plugin manager that loads Zsh plugins asynchronously to significantly reduce shell startup time.
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"Starship is used as a fast, cross-shell prompt that provides a minimal, customizable, and performant terminal prompt.
curl -sS https://starship.rs/install.sh | shbrew install starshipOpen .zshrc.
nvim ~/.zshrcReplace contents with:
# Zinit
export ZINIT_HOME="$HOME/.local/share/zinit/zinit.git"
source $ZINIT_HOME/zinit.zsh
# Starship prompt
eval "$(starship init zsh)"
export STARSHIP_LOG=error
# Autocomplete settings
zstyle ':autocomplete:*' verbose no
# Must load first
zinit light marlonrichert/zsh-autocomplete
# Async plugins
zinit ice wait lucid
zinit light zsh-users/zsh-autosuggestions
zinit ice wait lucid
zinit light zsh-users/zsh-syntax-highlighting
# History
HISTSIZE=2000
SAVEHIST=2000
setopt HIST_IGNORE_ALL_DUPS
setopt SHARE_HISTORY
# Lazy NVM
export NVM_DIR="$HOME/.nvm"
load-nvm() {
unset -f node npm npx nvm
source "$NVM_DIR/nvm.sh"
}
for cmd in node npm npx nvm; do
eval "$cmd() { load-nvm; $cmd \"\$@\" }"
done
# Completion cache
autoload -Uz compinit
compinit -C
# Compile zshrc
if [[ ! -f ~/.zshrc.zwc || ~/.zshrc -nt ~/.zshrc.zwc ]]; then
zcompile ~/.zshrc
fiOpen starship.toml.
nvim ~/.config/starship.tomlReplace contents with:
# No blank line before prompt
add_newline = false
# Simple prompt layout
format = """
$directory\
$git_branch\
$git_status\
$character
"""
# Directory
[directory]
style = "cyan blue"
truncation_length = 3
truncate_to_repo = true
# Git status (very minimal)
[git_status]
style = "red"
format = '[$all_status$ahead_behind]($style) '
# Prompt symbol
[character]
success_symbol = "[❯](green)"
error_symbol = "[❯](red)"
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
[nodejs]
disabled = true
[aws]
disabled = true
[gcloud]
disabled = true
[battery]
disabled = true
[time]
disabled = trueReload shell:
source ~/.zshrcmacos-icon = retro
window-padding-x = 1
window-padding-y = 1
copy-on-select = clipboard
window-theme = dark
clipboard-read = allow
theme = Brogrammer
background = #131313
foreground = #d6dbe5
selection-background = #1f1f1f
selection-foreground = #d6dbe5
cursor-color = #b9b9b9
cursor-text = #101010
palette = 0=#1f1f1f
palette = 1=#f81118
palette = 2=#2dc55e
palette = 3=#ecba0f
palette = 4=#2a84d2
palette = 5=#4e5ab7
palette = 6=#1081d6
palette = 7=#d6dbe5
palette = 8=#d6dbe5
palette = 9=#de352e
palette = 10=#1dd361
palette = 11=#f3bd09
palette = 12=#1081d6
palette = 13=#5350b9
palette = 14=#0f7ddb
palette = 15=#ffffff
