最近虚拟机安的有点多,每次都要重新配置一遍Zsh,所以记录一下配置过程
安装Zsh
1 2
| sudo apt-get update sudo apt-get install zsh
|
安装Oh My Zsh
Oh My Zsh是一个社区驱动的框架,用于管理Zsh配置。它包含了许多有用的功能,助手,插件和主题
先安装git
1
| sudo apt-get install git
|
第一种安装方法
1 2 3 4
| sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
但是这种方法在网络环境不好的情况下会出现问题,可以使用下面的方法
第二种安装方法
1 2 3
| git clone https://github.com/ohmyzsh/ohmyzsh.git cd ohmyzsh/tools bash install.sh
|
对于弹出的提示,输入y
即可
常用插件的安装
zsh-syntax-highlighting
语法高亮插件
1
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
zsh-autosuggestions
自动补全插件
1
| git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
zshrc配置
修改插件
编辑~/.zshrc
文件,找到plugins
行,修改为
1
| plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
|
修改主题
编辑~/.zshrc
文件,找到ZSH_THEME
行,修改为
使配置生效