V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Visual Studio Code
Sublime Text
IOGraphica
Livid
272.76D
572.54D
V2EX  ›  Dev

powerline-shell: Nice to have everywhere

  •  
  •   Livid ·
    PRO
    · Aug 14, 2017 · 869 views
    This topic created in 3191 days ago, the information mentioned may be changed or developed.

    安装步骤:

    git clone https://github.com/milkbikis/powerline-shell ~/.powerline-shell
    cd ~/.powerline-shell
    cp config.py.dist config.py
    ./install.py
    

    然后将下面的内容放入 .bashrc 的末尾:

    function _update_ps1() {
        PS1="$(~/.powerline-shell/powerline-shell.py $? 2> /dev/null)"
    }
    
    if [ "$TERM" != "linux" ]; then
        PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
    fi
    

    然后执行:

    exec $SHELL
    

    即可完成安装。

    因为读取 git 状态这个操作会频繁依赖 git status 的结果,所以需要将系统上的 git 更新到最新版本,这样 git status 会快很多:

    sudo add-apt-repository ppa:git-core/ppa
    sudo apt-get update
    sudo apt-get install git
    
    1 replies    2017-08-14 18:28:37 +08:00
    hei1000
        1
    hei1000  
       Aug 14, 2017
    这么花哨, 上图有点麻烦,懒得上图了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3067 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 12:58 · PVG 20:58 · LAX 05:58 · JFK 08:58
    ♥ Do have faith in what you're doing.