切换到root
vim /etc/sudoers
安装ohmyzsh前必须安装zsh
yum install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
如果访问不了 参考下面解决
安装MAVROS出现"raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... 失败:拒绝连接。"问题_城南蜈蚣的博客-CSDN博客 (里面的地址不能用力改成这个 raw.githubusercontent.com域名解析IP地址查询,www.raw.githubusercontent.com 网站服务器所在地信息查询)
手动按装2(1有时候半天clone不下来)
浏览器打开 https://github.com/robbyrussell/oh-my-zsh.git 下载zip包 然后复制到 ~/.oh-my-zsh-git 下
进入~/.oh-my-zsh-git/tools文件夹,执行
./install.sh
之后可以删除
安装autojump
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py 安装
./uninstall.py 卸载
在 ~/.zshrc 中加入下面 代码
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
source ~/.zshrc
测试
autojump --version
安装 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
在 .zshrc中开头添加
ZSH_DISABLE_COMPFIX="true"
然后添加plugins里面的内容
plugins=(zsh-autosuggestions)
重新打开terminal
安装 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
添加到plugins
plugins=( [plugins...] zsh-syntax-highlighting)
重新打开terminal
安装 zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
在 .zshrc中添加 (注意开头没有 zsh-)
plugins=(history-substring-search)
重新打开terminal
直接添加 vi-mode
plugins=(vi-mode)
给子账户也加上zsh
以root身份 cp
cp -r .oh-my-zsh /home/bob
cp -r .autojump /home/bob
chown -R bob:bob /home/bob/.autojump
chown -R bob:bob /home/bob/.oh-my-zsh
切到子账户bob
cd ~
vim .zshrc
# Path to your oh-my-zsh installation. #export ZSH="/root/.oh-my-zsh" export ZSH="/home/bob/.oh-my-zsh"
vim .bash_profile 末尾加上下面代码
export PATH exec /bin/zsh -l
然后重启一个terminal 登录 即可
theme 改成 mira 可以看到是哪个用户 默认的看不到用户 不怎么好
或者自己去 https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 找个自己喜欢的