ZSH Config


Apple changed the default shell to zsh from bash for quite sometime. let’s customize it.People often use OH MY ZSH, I used it for a year but it seems bloated to me. Below is my simple and effective configuration.

Changing the shell prompt to Starship

add_newline = false

success_symbol = "[➜](bold green)"

# Clear visibility for exit codes
style = "bg:red"
symbol = "💣 "
format = '[\[$symbol$status\]]($style) '
disabled = false

# These symbols will only show when battery levels are 20% or less
charging_symbol = "⚡️ "
discharging_symbol = "💀 "

[[battery.display]]  # "bold red" style when capacity is between 0% and 20%
threshold = 40
style = "bold red"

#python_binary = "python3"

symbol = "ﯣ (orange)"
eval "$(starship init zsh)"

Key Bindings Changes

export EDITOR=nvim
bindkey '^X^e' edit-command-line
bindkey -e
bindkey | less

reference: https://matija.suklje.name/zsh-vi-and-emacs-modes

ZSH autosuggestion

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

Z Script Integration

. /Users/sample/Scripts/Production/z.sh

History override


FZF Integration

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

NeoVim as Manpager [Optional]

export MANPAGER="nvim -c 'set ft=man' -"


alias zshcnf="nvim ~/.zshrc"
alias zshsrc="source ~/.zshrc"