mortenn / bash-beautify Goto Github PK
View Code? Open in Web Editor NEWThis project forked from keyboardcowboy/bash-beautify
Create colorful bash prompts to integrate with SVN and GIT
This project forked from keyboardcowboy/bash-beautify
Create colorful bash prompts to integrate with SVN and GIT
Bash Beautify ================================================================================ Bash Beautify adds simple color support and SVN and GIT branch recognition to your bash prompt. -------------------------------------------------------------------------------- + Requirements -------------------------------------------------------------------------------- - If using SVN, your project must use a standard /trunk /branches /tags structure. -------------------------------------------------------------------------------- + Installation -------------------------------------------------------------------------------- 1. Place the .bash_beautify file in your home directory. 2. Add the following line to the top of your .bash_profile or .bashrc file. source ~/.bash_beautify That's it! The next time you start a bash session you should see a pretty, new bash prompt. By default GIT branches are green and SVN are yellow. If you would like to customzize your prompt, add the following line under the previous one and use the brief tutorial below. (It might be helpful to copy the one from the bottom of the actual file to start.) export PS1="[\u@\h]\$" -------------------------------------------------------------------------------- + Building Your Bash Prompt -------------------------------------------------------------------------------- The bash prompt is really just a string with a few variables in it. Here is a list of the basic variables you can use and how they work: UNIX COMMANDS ------------- These will be replaced with their respective values. \u Your username. (ex. calbrecht) \h Your system hostname. (ex. localhost) \w Your present working directory. (ex. /var/www/htdocs/website) COLORS ------ These will alter the color of the text from this point forward. Use the reset at the bottom to stop using the changed color. ${BLACK} ${RED} ${GREEN} ${YELLOW} ${BLUE} ${VIOLET} ${CYAN} ${WHITE} ${BRIGHT_BLACK} ${BRIGHT_RED} ${BRIGHT_GREEN} ${BRIGHT_YELLOW} ${BRIGHT_BLUE} ${BRIGHT_VIOLET} ${BRIGHT_CYAN} ${BRIGHT_WHITE} ${NORMAL} ${RESET} SVN and GIT ----------- The icing on the cake. Add this variable to your line and it will be replaced with "(GIT_BRANCH|SVN_BRANCH)" depending on which (or both if you are crazy enough) version control system you are using. $(vcs_branch) -------------------------------------------------------------------------------- + Examples -------------------------------------------------------------------------------- 1. A basic prompt. [calbrecht@localhost]$ export PS1="[\u@\h]\$" 2. Add the present working directory to each prompt. [calbrecht@localhost: /var/www/htdocs/newsite/includes]$ export PS1="[\u@\h: \w]\$" 3. Put the VCS branches in it. [calbrecht@localhost(7.x-1.x): /var/www/htdocs/newsite/includes]$ export PS1="[\u@\h$(vcs_branch): \w]\$" 4. Spice it up with a little color. [calbrecht@localhost(7.x-1.x): /var/www/htdocs/newsite/includes]$ export PS1="${BRIGHT_CYAN}[${CYAN}\u${BRIGHT_WHITE}@${CYAN}\h${WHITE}\$(vcs_branch)${WHITE}: \w${BRIGHT_CYAN}]${NORMAL}\$ ${RESET}" -------------------------------------------------------------------------------- + Advanced -------------------------------------------------------------------------------- If you don't like the colors of the SVN and GIT branches, you can change those in the .bash_beautify file in the vcs_branches function. I coded them in there to make it easier to deploy for newbies. You can also call either piece separately without any formatting: $(git_branch) $(svn_branch)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.