运维开发网

centos安装zsh

运维开发网 https://www.qedev.com 2020-08-01 12:32 出处:51CTO 作者:wx5f23c62a9b5e7
yuminstall-yzsh#安装zshsh-c"$(curl-fsSLhttps://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"#安装ohmyzshorsh-c"$(wgethttps://raw.githubusercontent.com/robbyrussell/oh-my-zsh/m
yum install -y zsh     #安装zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"      #安装oh my zsh
or
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

cat /etc/shells          #查看本地有哪几种shell
chsh -s /bin/zsh       #切换到zsh,默认已经切换了

安装语法高亮插件 zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

自动补全插件 zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

跳转插件 autojump

git clone git://github.com/joelthelion/autojump.git
# 进入clone目录,接着执行安装文件
cd autojump
./install.py
# 接着根据安装完成后的提示,在~/.zshrc最后添加下面语句:
vim ~/.bashrc    
[[ -s /home/misfit/.autojump/etc/profile.d/autojump.sh ]] && source /home/misfit/.autojump/etc/profile.d/autojump.sh

启用插件

vim ~/.zshrc    
# 在plugins后括号里添加安装的插件名字
plugins=( git 
            autojump 
            zsh-autosuggestions 
            zsh-syntax-highlighting
            )

然后重新登录初始化
su -
0

精彩评论

暂无评论...
验证码 换一张
取 消