Git Product home page Git Product logo

bash-powerline's Introduction

bash-powerline

Powerline for Bash in pure Bash script.

bash-powerline bash-powerline

Features

  • Git branch: display current git branch name, or short SHA1 hash when the head is detached
  • Git branch: display "+" symbol when current branch is changed but uncommited
  • Git branch: display "⇡" symbol and the difference in the number of commits when the current branch is ahead of remote (see screenshot)
  • Git branch: display "⇣" symbol and the difference in the number of commits when the current branch is behind of remote (see screenshot)
  • Platform-dependent prompt symbol for OS X and Linux (see screenshots)
  • Color code for the previously failed command
  • Fast execution (no noticable delay)
  • No need for patched fonts

Installation

Download the Bash script

curl https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh

And source it in your .bashrc

source ~/.bash-powerline.sh

For best result, use Solarized colorscheme for your terminal emulator. Or hack your own colorscheme by modifying the script. It's really easy.

Why?

This script is largely inspired by powerline-shell. The biggest problem is that it is implemented in Python. Python scripts are much easier to write and maintain than Bash scripts, but for my simple cases I find Bash scripts to be manageable. However, invoking the Python interpreter each time to draw the shell prompt introduces a noticable delay. I hate delays. So I decided to port just the functionalities I need to pure Bash script instead.

The other issue is that I don't like the idea of requiring patched fonts for this to work. The font patching mechanism from the original Powerline does not work with the bitmap font (Apple Monaco without anti-aliasing) I use on non-retina screens. I'd rather stick with existing unicode symbols in the fonts.

See also

  • powerline: Unified Powerline written in Python. This is the future of all Powerline derivatives.
  • vim-powerline: Powerline in Vim writtien in pure Vimscript. Deprecated.
  • tmux-powerline: Powerline for Tmux written in Bash script. Deprecated.
  • powerline-shell: Powerline for Bash/Zsh/Fish implemented in Python. Might be merged into the unified Powerline.
  • emacs powerline: Powerline for Emacs

bash-powerline's People

Contributors

riobard avatar hexcles avatar ealeksandrov avatar

Watchers

James Cloos avatar lUo avatar

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.