zsh & oh-my-zsh 安装 & 自动补全插件和颜色高亮插件安装

zsh & oh-my-zsh 安装
• 查看当前 shell

echo $SHELL

• 安装 zsh

yum install -y zsh

• 设置默认 shell

chsh -s /bin/zsh

• 安装 git

yum install -y git

• 安装 oh-my-zsh,已替换国内地址

sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

• 启用常用插件

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
#这一步就是安装完成了 source ~/.zshrc使用此命令刷新下  再输入命令就能看到补全命令的功能
vim ~/.zshrc
plugins=(
        git
        man
        zsh-autosuggestions
        zsh-completions
        zsh-syntax-highlighting
        docker
        docker-compose
)
autoload -U compinit && compinit
# 管理员用户可以管理网络、软件安装、服务管理、进程管理、docker 管理
admin  ALL=(ALL) NOPASSWD: NETWORKING, SOFTWARE, SERVICES, LOCATE, STORAGE, PROCESSES, DRIVERS, /usr/bin/docker
admin  ALL=(ALL) DELEGATING
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install -y kernel-lt
chown -h /opt/software
chown -R /opt/data /opt/module /opt/log
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
                  
                  
sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
# 把 admin 加入 docker 组
sudo usermod -aG docker admin
# 刷新 docker 组
newgrp docker
# jenkins 加速
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json

•如果在补全插件安装source ~/.zshrc后没有命令补全的效果,则如下手动添加进:

vim ~/.zshrc

找到plugins=(git)此行命令,更改为plugins=(git zsh-autosuggestions zsh-completions zsh-syntax-highlighting),写入并退出,再次运行source ~/.zshrc。

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值