Ubuntu美化终端
安装zsh
sudo apt install zsh
安装oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
或者
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
如果出现443端口被拒,使用下面的指令
sh -c "$(curl -fsSL https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
或者
sh -c "$(wget -O- https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
安装zsh插件
进入oh-my-zsh的plugings文件夹
cd ~/.oh-my-zsh/custom/plugins/
安装zsh-autosuggestions
zsh-autosuggestions
是一个补全插件,会根据输入的内容,关联出历史记录。按方向键右键,则会补全。
git clone https://github.com/zsh-users/zsh-autosuggestions
安装zsh-syntax-highlighting
zsh-syntax-highlighting
是一个高亮插件,会高亮语法,合法的命令是绿色,不合法在的命令会报红。
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
配置环境
打开.zshrc
文件,输入命令vim ~/.zshrc
找到如下代码
plugins=(git)
修改为
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
最后运行source ~/.zshrc
命令,就可以生效了