Skip to content



zsh setup


zsh setup

[[zsh]] setup.

installation and themes

# install zsh and change shell
apt install zsh
chsh -s /bin/zsh

# configuration directory
mkdir -p ~/.config/zsh
cd ~/.config/zsh

# powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.config/zsh/powerlevel10k
echo 'source ~/.config/zsh/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

# enter powerlevel10k setup
# reload .zshrc once finished
cd 
source .zshrc

environment variables

~/.zshrc
export SHELL=/usr/bin/zsh

path

~/.zshrc
export PATH=/home/$USER/.local/bin:$PATH

alias

~/.zshrc
alias v="nvim"

alias ls='ls --color'
alias ll='ls -l --color'
alias la='ls -A --color'
alias l='ls -CF --color'
alias grep='grep --color'

# tree
alias tree='find . -not -path "*/\.git/*" -not -path "*/venv/*" -not -path "*/node_modules/*" -not -path "*/.venv/*" | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"'

alias ..='cd ..'

# git
alias gs='git status'

history

~/.zshrc
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=100000
HISTFILE=~/.zsh_history
setopt EXTENDED_HISTORY
function history-all { history -E 1 }

app specific

~/.zshrc
# mise
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc