gretel / pragmaprompt

A pragmatic bash prompt done by a wannabe zen minimalist

Home Page:https://github.com/gretel/pragmaprompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pragmaprompt

A pragmatic bash prompt done by a fish-shell user!

  • Lighweight and simple, no bloat
  • Fast, optimized for low latencies
  • Code validated using bashate and shellcheck
  • Intended to be compatible and quite POSIX.

Supports prompting of:

  • Username (in warning red if root)
  • Timestamp of last command (see DATE_FMT)
  • Return value of last command
  • State of version control (powered by vcprompt - see VCPROMPT_FMT)
  • Active Python virtualenv or current version managed by pyenv
  • Use of a multiplexer (screen or tmux).

asciicast

Tested on iTerm2 nightlies:

brew cask install iterm2-nightly

Installation

Homebrew

$ brew install https://raw.githubusercontent.com/gretel/pragmaprompt/master/pragmaprompt.rb

Please follow the instructions shown:

The prompt needs to be enabled manually.
Please add the following to your .bashrc:
    if [ -f "$(brew --prefix pragmaprompt)/share/pragmaprompt.sh" ]; then
        source "$(brew --prefix pragmaprompt)/share/pragmaprompt.sh"
    fi
Then, you may restart the shell:
    exec bash

Manually

Clone this repository or get the file somehow and put it somehwere like ~/pragmaprompt.sh.

Finally, include the file in your .bashrc or .bash_profile:

if [ -f "$HOME/pragmaprompt.sh" ]; then
    source "$HOME/pragmaprompt.sh"
fi

Integration

While truly optional the following tool is supported:

  • vcprompt - git, hg, and svn info at low latencies
  • pyenv - the currently activated virtualenv is shown - nice for Python hack*etc - otherwise maybe not.

On OS X homebrew can be used to get these:

brew install pyenv --HEAD
brew install tmux --HEAD
brew install vcprompt --HEAD

Using HEAD versions is optional but recommended especially in regards to vcprompt.

The bitbucket repo of vcprompt homebrew's HEAD formulae uses is one of the few actually being maintained.

Terminal Settings

A recommandable and well-matching font:

Have Fish?

If you tend to use fish-shell please check out the cyber-trance theme for a similar approach.

About

A pragmatic bash prompt done by a wannabe zen minimalist

https://github.com/gretel/pragmaprompt

License:MIT License


Languages

Language:Shell 66.8%Language:Ruby 33.2%