V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Visual Studio Code
Sublime Text
IOGraphica
Livid
V2EX  ›  Dev

powerline-shell: Nice to have everywhere

  •  
  •   Livid · 2017-08-14 09:36:44 +08:00 · 349 次点击
    这是一个创建于 2441 天前的主题,其中的信息可能已经有所发展或是发生改变。

    安装步骤:

    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 条回复    2017-08-14 18:28:37 +08:00
    hei1000
        1
    hei1000  
       2017-08-14 18:28:37 +08:00
    这么花哨, 上图有点麻烦,懒得上图了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2842 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:03 · PVG 14:03 · LAX 23:03 · JFK 02:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.