Command Line Feedback from RVM and Git
collectiveidea.com
collectiveidea.com
# -----------------------------------------------------------------
# BASH PROMPT
# -----------------------------------------------------------------
parse_git_branch() {
git_branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ $git_branch ]; then
echo "•$git_branch"
fi
}
# sexy prompt
export PS1='[\[\033[0;35m\]\h\[\033[0;36m\] \w\[\033[00m\]\[\033[33m\]$(parse_git_branch)\[\03 3[00m\]]\$ '
And here's what it looks like:http://akhun.com/seo/skitch/Screen_Shot_2011-08-02_at_8.47.1...
branch=$(__git_ps1 "%s")
That doesn't have any problem with detached head: http://cl.ly/8yN8Here's what it looks like: http://cl.ly/8y50
[1] https://github.com/telemachus/dotfiles/blob/master/bashrc
[2] https://github.com/adamv/dotfiles/blob/master/bashrc
[3] http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
I have one info line which tells me path, user, host, git branch etc. And then the prompt sits nicely on the line below and is always at the same alignment.
136 11:33:48 $
export PS1='\[\e[32m\]\u@\h \[\033[33m\]\w\[\033[00m\] $(__git_ps1 "(%s)") ${rvm_ruby_string}\n\# \[\033[31m\] \[\033[00m\]\t \\$ '
command_exists __git_ps1 && git="$c_vcs\$(__git_ps1)"
PS1="\n$c_path\w$git $c_id\u@$prompt_host$c_reset"
$c_* vars are just for colour, the command_exists switch lets me use the same dotfile on boxes which don't have git installed.http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/comple...
Screenshots from the article:
http://stevelosh.com/media/images/blog/2010/02/zsh-prompt.pn...
http://stevelosh.com/media/images/blog/2010/02/zsh-prompt-co...
I find the comments here far more useful, and they aren't one-line commands with no explanation of the parts. Thanks for the submission, for the discussion's sake, but I'm not going back to that blog any time soon.
Which browser and OS are you using? Scrolling isn't slow in webkit for myself, but I'd be happy to dig in and make it smoother if it's an issue.
Looking at the profiler in Chrome, I'm not seeing any unnecessary events while scrolling between things - maybe it's a transparency somewhere instead? Removing a handful I could find did speed things up, though I probably missed a few. Browsers are still lame at those, unfortunately :/
1.9.2@rails31::project(branch)⚡
Shows the ruby version, rvm gemset, working directory and git branch, followed by a thunderbolt prompt. This is how I set it https://gist.github.com/1120566