Giter VIP home page Giter VIP logo

Comments (4)

pdf avatar pdf commented on May 25, 2024 2

This is possible, though not efficiently, eg for ZSH, based on the example from the README:

function powerline_precmd() {
    powerline_cmd_result="$?"
    PROMPT="$(~/go/bin/powerline-go -error $powerline_cmd_result -shell zsh -modules 'nix-shell,venv,user,host,ssh,cwd,perms,exit,root')"
    RPROMPT="$(~/go/bin/powerline-go -error $powerline_cmd_result -shell zsh -modules 'git,hg,jobs,vgo')"
}

function install_powerline_precmd() {
  for s in "${precmd_functions[@]}"; do
    if [ "$s" = "powerline_precmd" ]; then
      return
    fi
  done
  precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" ]; then
    install_powerline_precmd
fi

Just pick whichever modules you want to appear on the left and right for in the PROMPT and RPROMPT lines respectively. Of course this means executing the command twice, but the performance is still not too bad, still faster than the shell/python alternatives in my testing.

Would be nice to have better support for this though, perhaps we could export content to be split or eval'd in the shell or something.

Oh, and if you want your separator arrows pointing in the opposite direction for the right-aligned portion, I submitted #92 to allow drawing reversed separators.

from powerline-go.

hachi8833 avatar hachi8833 commented on May 25, 2024

Thank you for the reply!
Unfortunately, I'm not a zsh user and I prefer to shell-independent solution...

from powerline-go.

pdf avatar pdf commented on May 25, 2024

Unfortunately, I'm not a zsh user and I prefer to shell-independent solution

Then you're out of luck - zsh and fish are the only shells that I'm aware of that support right-aligned prompts.

from powerline-go.

justjanne avatar justjanne commented on May 25, 2024

Fixed thanks to @pdf’s PR

from powerline-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.