zoukankan      html  css  js  c++  java
  • Install oh-my-zsh and zsh-autosuggestions on Ubuntu 18.04 (including the VScode shell setting and the conda command missing problem)

    Prerequisites of this blog: Basic linux programming, including vim usage and json.

    Ack:

    https://dev.to/mskian/install-z-shell-oh-my-zsh-on-ubuntu-1804-lts-4cm4

    https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md

    PART I (oh-my-zsh)

    Install prerequisite packages (ZSH, powerline & powerline fonts)

    sudo apt install zsh
    sudo apt-get install powerline fonts-powerline
    

      

    Clone the Oh My Zsh Respo

    git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
    

      

    Create a New ZSH configuration file

    cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
    

      

    Switch to zsh

    chsh -s /bin/zsh
    

    Start a new terminal session.

    PART II (zsh-autosuggestions)

    Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

    cd $ZSH_CUSTOM/plugins
    sudo git clone https://gitee.com/cxxszz/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    

      

    Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):

    plugins=(zsh-autosuggestions)
    

      

    Start a new terminal session.

    PART III (VSCode terminal setting)

    To set the default shell in VScode as zsh, add the following item into settings.json

    "terminal.integrated.shell.linux": "/bin/zsh"
    

      

    PART IV (conda setting)

    After switching to zsh, you may find the conda command is lost. Add the following snippet to ~/.zshrc

    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home/lwj/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home/lwj/miniconda3/etc/profile.d/conda.sh" ]; then
            . "/home/lwj/miniconda3/etc/profile.d/conda.sh"
        else
            export PATH="/home/lwj/miniconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    

      

    Remember to use your own conda path.

  • 相关阅读:
    VIJOS P1057盖房子 (动态规划)
    RQNOJ PID57 / 找啊找啊找GF
    RQNOJ PID302 / [NOIP2001]统计单词个数 (动态规划)
    hdu 3829 Cat VS Dog 最大独立集
    并查集 找k颗树使节点数最多
    在 Sublime Text 3 中配置编译和运行 Java 程序
    在 Sublime Text 3 中配置编译和运行 Java 程序
    StarUML license key
    StarUML license key
    测试对于list的sort与sorted的效率
  • 原文地址:https://www.cnblogs.com/cxxszz/p/14208730.html
Copyright © 2011-2022 走看看