CentOS安装oh-my-zsh以及zgen

﹥>﹥吖頭↗ 提交于 2019-12-10 00:34:07

1. 安装依赖软件git和zsh

CentOS:

yum -y install git zsh

Ubuntu: 

apt-get -y install git zsh

2. 安装oh-my-zsh

github的链接如下

https://github.com/robbyrussell/oh-my-zsh

安装的命令如下: 

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

安装结束之后,自动进入了oh-my-zsh界面,可以看到酷炫的oh-my-zsh的欢迎界面。

3. 安装zgen插件

zgen的github的链接如下

https://github.com/tarjoilija/zgen

clone zgen项目到home目录下面:

cd ~
git clone https://github.com/tarjoilija/zgen.git .zgen

首先在~/.zshrc 的末尾添加如下的配置信息,导入zgen

 # load zgen
 source "${HOME}/.zgen/zgen.zsh"
 source "${HOME}/.zgenrc"

同时在HOME目录下面新建一个.zgenrc文件,内容如下:

# check if there's no init script
if ! zgen saved; then
    echo "Creating a zgen save"
    zgen oh-my-zsh
    # plugins
    zgen oh-my-zsh plugins/git
    zgen oh-my-zsh plugins/sudo
    zgen oh-my-zsh plugins/command-not-found
    zgen load zsh-users/zsh-syntax-highlighting
    # plugins
    zgen oh-my-zsh plugins/git
    zgen oh-my-zsh plugins/sudo
    zgen oh-my-zsh plugins/command-not-found
    zgen oh-my-zsh plugins/pip
    zgen oh-my-zsh plugins/sudo
    #zgen oh-my-zsh plugins/aws
    zgen oh-my-zsh plugins/chruby
    #zgen oh-my-zsh plugins/colored-man
    zgen oh-my-zsh plugins/git
    zgen oh-my-zsh plugins/github
    zgen oh-my-zsh plugins/knife
    zgen oh-my-zsh plugins/knife_ssh
    zgen oh-my-zsh plugins/python
    zgen oh-my-zsh plugins/rsync
    zgen oh-my-zsh plugins/screen
    zgen oh-my-zsh plugins/vagrant

    zgen load zsh-users/zsh-syntax-highlighting
    zgen load chrissicool/zsh-256color


    #zgen load /path/to/super-secret-private-plugin

    zgen load zsh-users/zsh-history-substring-search
    zgen load zsh-users/zsh-autosuggestions

    # completions
    zgen load zsh-users/zsh-completions src

    # theme
    #zgen oh-my-zsh themes/miloshadzic
    zgen oh-my-zsh themes/arrow

    # save all to init script
    zgen save
fi

##autosuggestion
bindkey '^f' vi-forward-word
bindkey '^e' vi-end-of-line

#### custom configure
export EDITOR=vim

 

4. 常用zgen的命令

初始化zgen配置

zgen save

删除初始化配置

zgen reset

检查是否已经初始化,如果已经初始化,返回0

zgen saved

更新所有的插件并且重置

zgen update

更新zgen

zgen selfupdate

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!