DEV Community

Pau Garcia
Pau Garcia

Posted on

Customize zsh

For this, we are going to use zsh4humans

So firts, we are going to installit a nerd font and enabling it in the system for having icons in our terminal
Personally, i like:

  • Hack Nerd Fonts
  • Ubuntu Nerd Font

Then, we are going to install zsh4humans using:

if command -v curl >/dev/null 2>&1; then
  sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
else
  sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
fi
Enter fullscreen mode Exit fullscreen mode

Then, we only need to follow the installation

As we want to change from bash to zsh, we should change the main shell in our computer, se we should type this:

chsh -s $(which zsh)
Enter fullscreen mode Exit fullscreen mode

If in the future we want to change back to bash, we should change zsh to bash in the command:

chsh -s $(which bash)
Enter fullscreen mode Exit fullscreen mode

Finally, we are going to install logo-lsfor enabling icons when we do ls command

So, pase this command in the shell:

wget -q https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_Linux_x86_64.tar.gz
tar zxvf logo-ls_Linux_x86_64.tar.gz
cd logo-ls_Linux_x86_64/
sudo install -v logo-ls /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

Then, edit the ~/.zshrc for create an alias for ls

nvim ~/.zshrc
Enter fullscreen mode Exit fullscreen mode
alias ls = 'logo-ls'
Enter fullscreen mode Exit fullscreen mode

Then, save the changes using:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

or using

exec zsh
Enter fullscreen mode Exit fullscreen mode

If in some moment, you want to change to another theme of z4h, you can type the next command:

p10k configure
Enter fullscreen mode Exit fullscreen mode

Top comments (0)