# How to install zsh on Ubuntu 20.04 (WSL) ## Install font for terminal - Download **Hack.zip** from https://github.com/ryanoasis/nerd-fonts/releases - Install **Hack Regular Nerd Font Complete Mono Windows Compatible.ttf** - Select font **Hack NFM** ## Install some packages ``` sudo apt update sudo apt install unzip sudo apt install grc git clone https://github.com/marlonrichert/zsh-autocomplete.git ``` ## Modify xtorker's zsh_setting ``` git clone https://github.com/xtorker/zsh_setting.git cp zsh_setting/.p* zsh_setting/.z* ~ ``` ### If you don't need conda: - comment out line 29, 59-69 in **.zshrc** `:59,69s/^/# /g` - comment out line 2-4 in **.zprofile** ### If you need conda - install conda ``` wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh sh Anaconda3-2022.10-Linux-x86_64.sh ``` - add **.zshenv** in ~ ``` vim .zshenv # . ~/anaconda3/etc/profile.d/conda.sh ``` - replace /home/chenghao with ~ in **.zshrc** and **.zprofile** ``` :%s/\/home\/chenghao/\~/g ``` ## Install exa ``` wget https://github.com/ogham/exa/releases/download/v0.10.1/exa-linux-x86_64-v0.10.1.zip unzip exa-linux-x86_64-v0.10.1.zip -d exa sudo cp exa/bin/exa /usr/local/bin sudo cp exa/man/* /usr/share/man/man1 sudo mkdir -p /usr/local/share/zsh/site-functions/ sudo cp exa/completions/exa.zsh /usr/local/share/zsh/site-functions/_exa.zsh ``` ## Install zsh and zplug ``` sudo apt install zsh curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh ``` ## Final steps ``` exec zsh chsh -s $(which zsh) rm -rf exa exa-linux-x86_64-v0.10.1.zip zsh_setting Anaconda3-2022.10-Linux-x86_64.sh ``` ## Reference https://github.com/xtorker/zsh_setting https://the.exa.website/install/linux#manual ## .vimrc settings ``` set encoding=utf8 set fileencodings=utf8 set nu set ai set cursorline set tabstop=4 set shiftwidth=4 set hlsearch set cindent set laststatus=2 set wrap inoremap ( ()<Esc>i inoremap {<CR> {<CR>}<Esc>ko inoremap {{ {}<ESC>i inoremap [ []<Esc>i inoremap < <><Esc>i inoremap " ""<Esc>I inoremap ' ''<Esc>I filetype indent on syntax enable ```