美文网首页
oh-my-zsh 安装配置提高 shell 逼格

oh-my-zsh 安装配置提高 shell 逼格

作者: WangZZ | 来源:发表于2017-08-02 18:37 被阅读575次

    作为程序员一定要用高逼格的 shell。

    安装 zsh

    macOS

    brew install zsh zsh-completions
    

    Ubuntu & Debian

    sudo apt-get install zsh
    

    安装 oh-my-zsh

    via curl

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

    via wget

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

    推荐插件安装

    zsh-autosuggestions

    命令的自动补全提示

    cd ~/.oh-my-zsh/plugins
    git clone git://github.com/zsh-users/zsh-autosuggestions
    

    history-substring-search

    根据 shell 输入历史搜索,命令自动补全提示
    oh-my-zsh 自带插件

    zsh-syntax-highlighting

    可执行命令语法高亮

    cd ~/.oh-my-zsh/plugins
    git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
    

    修改 .zshrc 添加插件

    vim ~/.zshrc
    修改 plugins=(git) 为 plugins=(git zsh-autosuggestions history-substring-search zsh-syntax-highlighting)
    source ~/.zshrc 使配置生效
    

    默认使用 zsh

    vim ~/.bashrc
    添加如下内容到 .bashrc 中
    # Launch Zsh
    if [ -t 1 ]; then
    exec zsh
    fi
    

    相关文章

      网友评论

          本文标题:oh-my-zsh 安装配置提高 shell 逼格

          本文链接:https://www.haomeiwen.com/subject/jsuylxtx.html