linux安装zsh插件
- 第一步查看一下目前的默认shell是神马。输入echo $SHELL
- 第二步查看一下bin目录下是否有zsh
输入:cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/bin/tcsh
/bin/csh
默认的情况下是没有安装zsh
- 安装zsh包(centos下)
yum install -y zsh
安装完成后继续查看一下shell列表:cat /etc/shells
in/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/bin/tcsh
/bin/csh
/bin/zsh
- 切换shell到zsh
chsh -s /bin/zsh
//返回结果:
Changing shell for root
shell changed
- 使用命令echo $0查看shell
如果是 bash 配置文件则为~/.bash_profile
是 zsh,则配置文件为~/.zshrc
- 安装oh-my-zsh
安装git(因为该插件在github上)
yum -y install git
安装oh-my-zsh下载源码
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
复制配置
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
修改主题
vim ~/.zshrc
将ZSH_THEME改成cloud
ZSH_THEME="cloud"
更新配置
source ~/.zshrc
- 安装incr.zsh 补全插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
修改配置文件
vim ~/.zshrc
增加配置
plugins=(
git
pip
sudo
last-working-dir
zsh-syntax-highlighting
autojump
thefuck
zsh-autosuggestions
)
保存退出,更新配置
source ~/.zshrc
到此完毕。
|