Shell configuration

ZSH #

I prefer to use ZSH because of its advanced features mainly the easy file name globbing. With oh my zsh a good framework for extensions to ZSH exist. The documentation can be found at GitHub. However, the installation practice with directly executing a shell script from GitHub is quite dangerous, as you do not have a trustworthy anchor like signed Linux distribution packages. Hence, I suggest to review the installation script at least prior to installing. At the very end, the install script asks for changing your users default shell to zsh.

# apt-get install zsh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Configuring oh my zsh #

Oh my zsh, is mainly configured through your .zshrc file.

Theme and Fonts #

I like the powerlevel9k theme. It is installed by cloning its GitHub repository into the theme directory

# git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

and selecting it as the theme in your .zshrc:

ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(history)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_MODE='nerdfont-complete'

As you can see, a particular font, i.e. nerdfont-complete is required. It gives you these nice symbols in shell zsh_theme_demo Ther nedfonts can be downloaded from Nerdfonts.com, GitHub or directly here. The fonts are under MIT license.

To use these fonts, copy the *.ttf files into ~/.fonts. Alternatively, you can install them system-wide by copying them over to /usr/loca/share/fonts. Aferwards, the font can be directly used from any program. You need to configure your terminal GUI, to use that fonts too.

Keychain #

As I often use SSH or GPG from shell and want to have some comfort too, I use keychain. It ensures that your SSH keys are available through ssh-agent. Hence, you must install it before configuring through

# apt install keychain

Afterwards, adapt your .zshrc to include the usage of the keychain plugin and load your SSH private key stored in the file id_rsa in your main SSH directory, i.e. usually ~/.ssh/.

plugins=(... keychain ...)
zstyle :omz:plugins:keychain agents gpg,ssh
zstyle :omz:pluginz:keychain identities id_rsa