Update on the .zshrc

I needed a little more information from my prompt so I extended it a bit

setopt autocd
setopt promptsubst

autoload -U colors && colors
autoload -Uz vcs_info && vcs_info

precmd() { vcs_info }
zstyle ‘:vcs_info:*’ enable git hg bzr
zstyle ‘:vcs_info:*’ check-for-changes true
zstyle ‘:vcs_info:*’ get-unapplied true
zstyle ‘:vcs_info:*’ unstagedstr “!”
zstyle ‘:vcs_info:*’ formats “%F{5}[%s:%r|%b]%u”
zstyle ‘:vcs_info:*’ actionformats “%F{5}[%s:%r|%b-%a]”

PROMPT=”%F{2}%n@%M:%F{6}%d%F{11}» “

The result is a shell that lets me switch into a directory without typing cd and if the dir is version controlled it shows me the versioning system, the repo name, the branch I’m on and whether there are unstaged changes (indicated by !)

ZSH and versioning systems

Since oh-my-zsh didn’t work properly with ruby I had do remove it and all the nifty stuff went with it… So i was looking for a quick fix:

First I wanted to have the directory visible, i wrote this to the left:
PROMPT=”%n@%m:%F{6}%~ %F{11}%# “

Then I loaded vcs_info to get the information from git and put it to the right, that’s all I need:
autoload -Uz vcs_info
precmd() { vcs_info }
RPROMPT=’%F{4}${vcs_info_msg_0_} ${vcs_info_msg_1_}’
setopt AUTO_CD

It’s enough for me to work.