Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

New theme: ion #881

Closed
wants to merge 2 commits into from

2 participants

Johan Kiviniemi Robby Russell
Johan Kiviniemi

Hi,

Here’s yet another theme. Screenshot: http://i.imgur.com/BJI6Y.png

Thanks.

Robby Russell
Owner

@ion1 thanks, but we're holding off on new themes right now without getting up-votes from fans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 28, 2012
  1. Johan Kiviniemi

    Add ion.zsh-theme

    ion1 authored
  2. Johan Kiviniemi
This page is out of date. Refresh to see the latest.
Showing with 41 additions and 0 deletions.
  1. +41 −0 themes/ion.zsh-theme
41 themes/ion.zsh-theme
View
@@ -0,0 +1,41 @@
+typeset -gF ohmyzsh_ion_starttime
+# zsh bug or PEBKAC? The 1 refers to the float precision but zsh complains
+# about an invalid integer base. See typeset_setbase in
+# http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob;f=Src/builtin.c
+typeset -gF1 ohmyzsh_ion_time 2>/dev/null
+
+ohmyzsh_ion_preexec() {
+ typeset -gF SECONDS
+ ohmyzsh_ion_starttime="$SECONDS"
+}
+
+ohmyzsh_ion_precmd() {
+ typeset -gF SECONDS
+ ohmyzsh_ion_time="$(($SECONDS-$ohmyzsh_ion_starttime))"
+}
+
+autoload -U add-zsh-hook
+add-zsh-hook preexec ohmyzsh_ion_preexec
+add-zsh-hook precmd ohmyzsh_ion_precmd
+
+local color_error="$fg_bold[red]"
+local color_info="$fg_bold[black]"
+local color_user="$fg_bold[blue]"
+local color_root="$fg_bold[red]"
+
+local newline=$'\n'
+
+local p_error="%(?..%{$color_error%}%?%{$reset_color%} )"
+local p_fmt_a="%{$color_info%}"
+local p_cmdtime="\${ohmyzsh_ion_time}s "
+local p_time="%* "
+local p_screen="\${STY:+screen }"
+local p_tmux="\${TMUX:+tmux }"
+local p_user="%n "
+local p_host="%m "
+local p_pwd="%~ "
+local p_git="\$(git_prompt_info)"
+local p_fmt_b="%{$reset_color%}$newline"
+local p_prompt="%{%(#.$color_root.$color_user)%}%#%{$reset_color%} "
+
+PROMPT="${p_error}${p_fmt_a}${p_cmdtime}${p_time}${p_screen}${p_tmux}${p_user}${p_host}${p_pwd}${p_git}${p_fmt_b}${p_prompt}"
Something went wrong with that request. Please try again.