在 Linux Mint 19 上安裝 zsh 和設置小鍵盤一步到位

在 Linux Mint 19 上安裝 zsh 和設置小鍵盤

安裝 zsh 並設置 zsh 爲默認 shell

  1. 安裝
    sudo apt install zsh
  2. 設置 zsh 爲默認 shell,注意沒有 sudo
    chsh -s /bin/zsh
  3. 配置密碼認證
    sudo vim /etc/passwd
    /bin/bash/bin/zsh

安裝 oh-my-zsh 用於快速配置 zsh

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

配置小鍵盤

在 .zshrc 尾部加入linux

# 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" "*"

安裝自動完成插件

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
編輯 .zshrc
plugins 加入 zsh-autosuggestions
後面再加上
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zshgit

保存退出vimgithub

讓配置生效 source ~/.zshrcshell

相關文章
相關標籤/搜索