Added support for Haskell projects.

This commit is contained in:
Igor Guerrero Fonseca 2011-06-26 17:53:30 -04:00
commit d821ae6b99

View file

@ -1,4 +1,4 @@
PROMPT='$(python_version)$(rvm_ruby) %{$fg_bold[green]%}$(current_dir) %{$fg_bold[cyan]%}$(git_time_since_commit)$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}' PROMPT='$(haskell_version)$(python_version)$(rvm_ruby) %{$fg_bold[green]%}$(current_dir) %{$fg_bold[cyan]%}$(git_time_since_commit)$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@ -15,6 +15,13 @@ function current_dir() {
echo "%~" echo "%~"
} }
function haskell_version() {
if [[ -x "`which ghci`" && ( "`ls`" == *.hs* || "`ls`" == *.cabal* ) ]]; then
out="`python -c "import sys; print sys.argv[-1]" \`ghci --version\``"
echo "%{$fg[red]%}ghci-$out%{$reset_color%}"
fi
}
function python_version() { function python_version() {
# FIXME python --version # doesn't work since x=`python --version` is not # FIXME python --version # doesn't work since x=`python --version` is not
# capturing the thing # capturing the thing