This guide provides instructions to customize your Zsh shell with various enhancements, including the installation and configuration of the Powerlevel10k theme, LSD (a modern replacement for the ls
command), and Batcat (an improved alternative to the cat
command). Additionally, it covers the configuration of custom aliases in your .zshrc
file.
Instructions to install and configure the Powerlevel10k theme in your terminal:
- Clone the Powerlevel10k repository by running the following command in your terminal:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
- Add the following line to your ~/.zshrc file to load the theme:
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc
- Restart your terminal or run the following command to load the theme:
zsh
Instructions to install LSD, a modern replacement for the ls command, on your system:
-
Download the
.deb
file from the official LSD repository on GitHub: Download LSD -
Install the downloaded package using the following command:
sudo dpkg --install [File.deb]
Instructions to install Batcat, an improved alternative to the cat command: Download Batcat
- Download the
.deb
file from the official Batcat repository on GitHub:
Download Batcat
- Install the downloaded package using the following command:
sudo dpkg --install [File.deb]
- Run the following command to open the
.zshrc
file in the nano text editor:
sudo nano ~/.zshrc
This will open the .zshrc file with superuser permissions so you can edit it.
-
Scroll to the end of the file using the keyboard navigation keys.
-
Copy and paste the following code block at the end of the
.zshrc
file:
# Custom Aliases
alias ls='lsd -l --group-dirs=first'
alias ll='lsd -lh --group-dirs=first'
alias la='lsd -a --group-dirs=first'
alias lla='lsd -lha --group-dirs=first'
alias l='lsd --group-dirs=first'
alias cat='bat'
alias catn='/bin/cat'
alias catnl='/bin/bat --paging=never'
These aliases will add custom functionality to your commands, such as additional options for the ls command and an enhanced replacement for the cat command.
-
Save the changes to the .zshrc file by pressing
Ctrl + o
, then pressEnter
to confirm the file name and save the changes. -
Close the nano editor by pressing
Ctrl + x
. -
Restart your terminal or open a new terminal window for the changes in the
.zshrc
file to take effect.
By G3kSec | 2023