Saturday, 31 December 2011

Zsh prompt and rvm current

So I finally got around to doing something with my boring prompt in zsh. I added this to my .zshrc:


autoload -U colors && colors
export RPROMPT="%{$fg[green]%}$(rvm current)%{$reset_color%}"


And then I added the export to my precmd so it runs it each time:


precmd () {
  export RPROMPT="%{$fg[green]%}$(rvm current)%{$reset_color%}"
}


Now I get a little green prompt in the far right telling me what version of Ruby (and rvm gemset) I'm using.


I guess having the prompt change when I switch rvm itself is probably more efficient, I'll look into that another day.

No comments:

Post a Comment