1. zsh

1
sudo apt install zsh

2. oh my zsh and theme

1
2
3
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo apt install fonts-powerline
vim ~/.zshrc
1
2
ZSH_THEME="agnoster" # (this is one of the fancy ones)
# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster

3. WSL: ColorTool

4. Ctrl + Backspace and Ctrl + Delete

1
2
echo "bindkey '^H' backward-kill-word" >> ~/.zshrc
echo "bindkey '^[[3;5~' kill-word" >> ~/.zshrc

Why don’t Ctrl+Backspace and Ctrl+Delete work? · Issue #7609 · robbyrussell/oh-my-zsh · GitHub

6. ll

1
2
echo "alias ll='ls -alhF'" >> ~/.bash_aliases
echo "source \$HOME/.bash_aliases" >> ~/.zshrc

5. Plugins

5.1 zsh-syntax-highlighting

1
2
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
chmod -R 755 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

5.2 zsh-autosuggestions

1
2
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
chmod -R 755 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

5.3 zsh-z

1
2
git clone https://github.com/agkozak/zsh-z ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-z
chmod -R 755 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-z

5.x Enable

1
vim ~/.zshrc
1
2
3
4
5
6
7
plugins=(
git
extract
z
zsh-syntax-highlighting
zsh-autosuggestions
)

6. WSL: fix \_z\_precmd:1: nice(5) failed: operation not permitted

By default, zsh tries to run background jobs at a lower priority, which Windows won’t let it do. A good workaround is to put

1
2
3
case $(uname -a) in
*Microsoft*) unsetopt BG_NICE ;;
esac

in your .zshrc file. That alters zsh‘s default behavior and fixes the problem entirely, in my experience.

_z_precmd:1: nice(5) failed: operation not permitted · Issue #230 · rupa/z · GitHub

7. Hide local username and host name

1
echo "DEFAULT_USER=\"\$USER\"" >> ~/.zshrc

8. Change host name text color

1
vim ~/.oh-my-zsh/themes/agnoster.zsh-theme
1
2
3
4
5
6
7
8
@@ -89,7 +89,7 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
- prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
+ prompt_segment cyan white "%(!.%{%F{yellow}%}.)%n@%m"
fi
}