Shell Setup

README

This page is mainly focus on setting up shell environment in Linux, and the iTerm2 settings under MacOS. The setup was tested under Raspberry Pi OS with desktop and recommended software powered by Raspberry Pi 4 Model B Rev 1.4 and Ubuntu Server 20.04 LTS

Reference

Install Packages

sudo apt-get install zsh
sudo apt-get install tmux
sudo apt-get install python3 python3-pip
pip3 install --upgrade pip
pip3 install git+git://github.com/powerline/[email protected]
pip3 install ipython

Enable zsh as default

chsh -s $(which zsh)

Install oh-my-zsh

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

Enable powerline for zsh

Run the following command:

echo 'PYTHON_VERSION=$(python3 --version | cut -c8-10)
export PATH=$PATH:$HOME/.local/lib/python${PYTHON_VERSION}/bin
export PATH=$PATH:$HOME/.local/bin

source ~/.local/lib/python${PYTHON_VERSION}/site-packages/powerline/bindings/zsh/powerline.zsh' >> ~/.zshrc

Enable powerline for tmux

Run the following command:

PYTHON_VERSION=$(python3 --version | cut -c8-10)
echo "source ~/.local/lib/python${PYTHON_VERSION}/site-packages/powerline/bindings/tmux/powerline.conf" >> ~/.tmux.conf

Enable powerline for ipython

Run the following command:

echo "from powerline.bindings.ipython.since_7 import PowerlinePrompts
c = get_config()
c.TerminalInteractiveShell.simple_prompt = False
c.TerminalInteractiveShell.prompts_class = PowerlinePrompts" >> ~/.ipython/profile_default/ipython_config.py

Change iTerm2 settings to support powerline

Step 1: Install Fonts

git clone https://github.com/powerline/fonts.git
cd fonts/SourceCodePro
open .

Then install all fonts inside the folder

Step 2: Change iTerm2 Settings

Click "Command + ," to open "Preferences"
Goes to "Preferences -> Profiles -> Text"
Click "Use built-in Powerline glyphs"
Click "Use a different font for non-ASCII text"
Choose "Source Code Pro for Powerline"

Usage

Useful Oh My Zsh Plugins

Plugin List

All of the plugins were gone over and the following is the exhausted list of potentially useful plugins.

  • ag
  • alias-finder
  • (experimental) ansible
  • (experimental) autojump
  • autopep8
  • (experimental) aws
  • (experimental) battery
  • (experimental) bgnotify
  • (experimental) branch
  • (experimental) brew
  • (experimental) bundler
  • (experimental) catimg
  • celery
  • colored-man-pages
  • colorize
  • (experimental) command-not-found
  • common-aliases
  • (experimental) copybuffer
  • (experimental) copydir
  • (experimental) copyfile
  • debian
  • direnv
  • dirhistory
  • django
  • (experimental) dnf
  • docker
  • docker-compose
  • emoji
  • encode64
  • extract
  • fasd
  • (experimental) firewalld
  • (experimental) frontend-search
  • (experimental) gcloud
  • genpass
  • git
  • (experimental) git-auto-fetch
  • (experimental) git-extras
  • git-flow
  • golang
  • (experimental) helm
  • history-substring-search
  • httpie
  • isodate
  • (experimental) jira
  • jsontools
  • kubectl
  • (experimental) kubectx
  • (experimental) lxd
  • (experimental) nmap
  • (experimental) node
  • (experimental) npm
  • (experimental) nvm
  • (experimental) otp
  • (experimental) pep8
  • pip
  • redis-cli
  • (experimental) ripgrep
  • (experimental) shell-proxy
  • (experimental) ssh-agent
  • sudo
  • supervisor
  • systemadmin
  • terraform
  • themes
  • (experimental) timer
  • (experimental) tmux
  • (experimental) ubuntu
  • (experimental) ufw
  • universalarchive
  • urltools
  • vi-mode
  • virtualenvwrapper
  • (experimental) wakeonlan
  • wd
  • (experimental) yum

Software Needed for the plugins

sudo apt-get install -y \
silversearcher-ag \
direnv \
fasd \
git-flow \
httpie \

pip3 install virtualenvwrapper

# Make sure the following line exists in the ~/.zshrc before plugin definition
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3