Skip to content

robertwhitebit/promptig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promptig

Adds current branch/hash to prompt and colors it by current status like untracked files, behind or ahead, merge conflicts, and many more.

Install

or

  • Just download promptig and copy the content to the end of ~/.bashrc (Linux) or ~/.bash_profile (Mac).

List of current features

alt tag

Things you need to know when modifying the code

  • Update both, PS1 in the promptig file and printPrompt() in test/tests/testcase.sh for reviews.

  • Color codes are terminal dependent. http://www.arwin.net/tech/bash.php#s_1 Cyan='\e[0;34m' may not be cyan in your terminal. See color palette (Edit->Profile Preferences->Colors->Palette)

  • Do not mix colors and text in functions (see: http://stackoverflow.com/a/6592102)

  • Colors need to be escaped in PS1 explicitly (PS1=...\[${Cyan}\]...) but not in printPrompt() (echo -e "...${Cyan}...)

How to generate a preview output

  • Run test/test.sh to see a preview output

How to add a preview output

  • Add a new file to test/tests with file extension .sh (e.g. my-ultimate-feature.sh) and make it executeable (chmod +x my-ultimate-feature.sh)

  • Copy the code from another test file and modify it

  • Run test/test.sh to see a preview output

About

Add git to prompt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages