安装

zsh是针对当前用户环境的,如果要设置主题,需要在 HOME 目录单独配置

# 安装zsh
sudo apt install zsh
# 安装 oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

修改主题

bash -c "$(curl -fsSL https://raw.githubusercontent.com/iGwkang/zeta-zsh-theme/master/scripts/install.sh)"

HOME/END 和 小键盘失效

# 重新绑定按键
vim ~/.zshrc

# key bindings
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history

# Fix numeric keypad
# 0 . Enter
bindkey -s "^[Op" "0"
bindkey -s "^[On" "."
bindkey -s "^[OM" "^M"
# 1 2 3
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
# 4 5 6
bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"
# 7 8 9
bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"
# + - * /
bindkey -s "^[Ol" "+"
bindkey -s "^[Om" "-"
bindkey -s "^[Oj" "*"
bindkey -s "^[Oo" "/"

# 解决无法匹配*
setopt no_nomatch

git目录卡顿

git config --add oh-my-zsh.hide-status 1
git config --add oh-my-zsh.hide-dirty 1

# 恢复
# 可以将1改为0,或者git config --remove-section oh-my-zsh