zsh
下载
wget https://nchc.dl.sourceforge.net/project/zsh/zsh/5.8/zsh-5.8.tar.xz
安装
解压 tar xvf zsh-5.8.tar.xz 安装 cd zsh-5.8 ./configure --prefix=$HOME/.local make && make install
配置环境变量
vim .bashrc 添加 export PATH=$PATH:$HOME/.local/bin # 设置环境变量 export SHELL=`which zsh` # 设置$SHELL为zsh exec `which zsh` -l # 设置登录为zsh
安装oh-my-zsh
从github安装
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
zsh install.sh
从gitee安装 1.下载安装文件 wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh 2.修改install.sh文件内容 找到以下内容 ---------------------------------------------------------------- # Default settings ZSH=${ZSH:-~/.oh-my-zsh} REPO=${REPO:-ohmyzsh/ohmyzsh} REMOTE=${REMOTE:-https://github.com/${REPO}.git} BRANCH=${BRANCH:-master} ---------------------------------------------------------------- 将其中的第3,4行替换为以下内容 ---------------------------------------------------------------- REPO=${REPO:-mirrors/oh-my-zsh} REMOTE=${REMOTE:-https://gitee.com/${REPO}.git} ---------------------------------------------------------------- 3.保存文件,赋予执行权限 4.执行 5.修改仓库地址 cd ~/.oh-my-zsh git remote set-url origin https://gitee.com/mirrors/oh-my-zsh.git git pull 6.结束
安装插件
- autojump - autosuggestioins - syntax-highlighting
$ git clone git://github.com/joelthelion/autojump.git $ ./install.py $ vim ~/.zshrc 添加以下内容 [[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
安装autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
安装syntax-highlighting
github git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting gitee git clone https://gitee.com/wxzxingtian/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
加载插件
$ vim ~/.zshrc 修改以下内容 plugins=(git)为 plugins=(git extract zsh-autosuggestions zsh-syntax-highlighting) $ source~/.zshrc