本文编写于 1160 天前,最后修改于 1160 天前,其中某些信息可能已经过时。
最近想把公司的一百多台服务器使用ansible管理起来,那ansible主控节点装个oh-my-zshell就必不可少啦,毕竟以后都要在这台主控机上操作嘛
将默认的shell从bash改成更强大的zsh
yum install -y zsh
chsh -s /bin/zsh
安装 git, wget, curl
yum install -y git wget curl
安装 oh-my-zsh
方法1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
方法2
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="主题名称"
安装oh-my-zsh必备插件
git clone git://github.com/joelthelion/autojump.git #autojump(快速跳转文件夹,效率神器)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting #命令高亮 正确路径自带下划线
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions #自动补全可能的路径
vim ~/.zshrc
plugins=(其他的插件 zsh-autosuggestions)