默认的bash环境需要配置的太多,我直接选用zsh套餐了,因为默认的风格我觉得很舒服,就没有修改。
# 安装zsh
sudo apt-get install zsh
zsh --version
# 安装oh-my-zsh,需要先安装好git
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
# 配置一些插件
# git z 这两个插件已经自带,只需要配置上就可以了
# zsh-syntax-highlighting
# 高亮语法,如图,输入正确语法会显示绿色,错误的会显示红色,使得我们无需运行该命令即可知道此命令语法是否正确
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# zsh-autosuggestions
# 显示之前运行的命令, 按<control + e>即可补全,或者按右键→即可补全
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 在.zshrc加上
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)
# source ~/.zshrc 生效
source ~/.zshrc