Giter Site home page Giter Site logo

Comments (3)

gabrielecirulli avatar gabrielecirulli commented on August 15, 2024 1

Thanks! Via some experimentation it turned out I just had to change the separator's color, and I ended up somewhere quite similar to the solution you pointed out (using the master branch and zsh in my case). It wasn't necessary to have a templating feature as I could export the appropriate value before the prompt renders.


precmd() {
  if [[ -n $(git rev-parse --git-dir 2>/dev/null) ]]; then
    if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
      export GBT_CAR_SIGN_SEP_FG="light_red"
    else
      export GBT_CAR_SIGN_SEP_FG="green"
    fi
  else
    unset GBT_CAR_SIGN_SEP_FG
  fi

  print ""
}

PROMPT='$(gbt $?)'

from gbt.

gabrielecirulli avatar gabrielecirulli commented on August 15, 2024 1

Screen Shot 2020-04-21 at 1 45 51 PM

Looks pretty amazing by the way! Thanks for the great project.

from gbt.

jtyr avatar jtyr commented on August 15, 2024

To "hide" the separator, you just need to set it to an empty string:

# When using GBT from a release
export GBT_CAR_CUSTOM_SEP=''
# When using GBT from master branch
export GBT_CAR_SIGN_SEP_TEXT=''

You can set the color of a particular separator like this (last release doesn't contain this feature, requires GBT compiled from master until I release new version):

export GBT_CAR_SIGN_SEP_FG='red'

Bare in mind that you currently cannot change the color the separator dynamically (if Git dir is clean = use green color, if Git dir is dirty = use dir color). That would require to implement templating feature which is outlined in the TODO.

Please let me know if the above worked for your.

from gbt.

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.