Braggers Tech Blog


Home > Linux Knowledge > ZSH on Void customization

published 2021-08-26, updated 2021-10-14

Install and customize ZSH on Void Linux

ZSH is in my opinion the best (interactive) shell in the Linux world. Period. (Opinions may vary!) Auto suggestions and completions and the awesome PowerLevel10k theme is what makes it so good. Installation on Void is easy:

sudo xbps-install -S zsh zsh-autosuggestions zsh-completions

After that you can change your default shell to zsh with

chsh -s /usr/bin/zsh

After that install the PowerLevel10k theme via the manual install way from the repo Be sure to also install the MesloLGS Nerd Font from the P10k manual and install it system wide. After that enable it in your terminal.

When running for the first time, the setup is displayed. This can be skipped and displayed again on the next start. Configure it to use a big history file (like 1000 items) and place it somewhere suitable in your home drive. If you want to re-run the first time setup, just run "zsh-newuser-install"

After that run "p10k configure" to configure your p10k theme settings to your likings. After that everything should be setup.
In Konsole with Breeze theme this looks something like this: ZSH

My .zshrc looks like this:

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/sb/.zshrc'

autoload -Uz compinit
compinit
_comp_options+=(globdots)
# End of lines added by compinstall
source ~/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

[[ ! -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]] || source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh