在 Linux Mint 19 上安装 zsh 和设置小键盘
安装 zsh 并设置 zsh 为默认 shell
- 安装
sudo apt install zsh
- 设置 zsh 为默认 shell,注意没有 sudo
chsh -s /bin/zsh
- 配置密码认证
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 尾部加入
# 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.zsh
保存退出vim
让配置生效 source ~/.zshrc
原文地址:https://www.cnblogs.com/F4NNIU/p/10987018.html
时间: 2024-10-13 00:52:48