diff --git a/themes/igorgue.zsh-theme b/themes/igorgue.zsh-theme index 48081af7a..e7017a8c6 100644 --- a/themes/igorgue.zsh-theme +++ b/themes/igorgue.zsh-theme @@ -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_SUFFIX="%{$reset_color%}" @@ -15,6 +15,13 @@ function current_dir() { 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() { # FIXME python --version # doesn't work since x=`python --version` is not # capturing the thing