Skip to content
This repository

Gaetan pushes "stibbons" theme #1863

Closed
wants to merge 4 commits into from

2 participants

Stibbons Robby Russell
Stibbons

Stibbons is a clean, one-lined, git-optimized prompt with current branch and dirty/rebase flag.
stibbons-theme

Stibbons added some commits
Stibbons Stibbons stibbons is a clean, one-lined, git-optimized prompt
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
05452f4
Stibbons Stibbons stibbons is a clean, one-lined, git-optimized prompt
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
3c63e77
Stibbons Stibbons Missing function 64a489e
Stibbons Stibbons Modified version of git remote completion script
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
e2146d0
Robby Russell

Thanks for sending this across. However, per the README file ( https://github.com/robbyrussell/oh-my-zsh ) at this point in time... I am not going to be accepting any new themes for a while. My aim is to work out a new solution for how to manage user theme contributions better in the future, but am thinking that 100+ is already too many for folks to browse/select from. :-)

Be sure to follow @ohmyzsh on twitter ( http://twitter.com/ohmyzsh ) to stay tuned for when we might have a good location for such themes.

ProTip: If you have a custom theme and want to use it... you might check out this (poorly documented) feature from pull-request #1111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 4 unique commits by 1 author.

Jun 05, 2013
Stibbons Stibbons stibbons is a clean, one-lined, git-optimized prompt
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
05452f4
Stibbons Stibbons stibbons is a clean, one-lined, git-optimized prompt
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
3c63e77
Stibbons Stibbons Missing function 64a489e
Stibbons Stibbons Modified version of git remote completion script
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
e2146d0
This page is out of date. Refresh to see the latest.
19 lib/git.zsh
@@ -114,6 +114,25 @@ git_prompt_status() {
114 114 echo $STATUS
115 115 }
116 116
  117 +# Checks if there is a bisect, merge or rebase currently going on
  118 +git_prompt_rebase_state() {
  119 + STATUS=""
  120 +
  121 + if [ -f ".git/BISECT_LOG" ] ; then
  122 + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_BISECT"
  123 + elif [ -f ".git/MERGE_HEAD" ] ; then
  124 + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_MERGE"
  125 + else
  126 + for dir in rebase rebase-apply rebase-merge ; do
  127 + if [ -d ".git/$dir" ] ; then
  128 + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_REBASE"
  129 + break
  130 + fi
  131 + done
  132 + fi
  133 + echo $STATUS
  134 +}
  135 +
117 136 #compare the provided version of git to the version installed and on path
118 137 #prints 1 if input version <= installed version
119 138 #prints -1 otherwise
74 plugins/git/_git-remote
... ... @@ -0,0 +1,74 @@
  1 +#compdef git-remote
  2 +
  3 +# NOTE: --track is undocumented.
  4 +# TODO: --track, -t, --master, and -m should take remote branches, I guess.
  5 +# NOTE: --master is undocumented.
  6 +# NOTE: --fetch is undocumented.
  7 +_git-remote () {
  8 + local curcontext=$curcontext state line
  9 + declare -A opt_args
  10 +
  11 + _arguments -C \
  12 + ':command:->command' \
  13 + '*::options:->options' && ret=0
  14 +
  15 + case $state in
  16 + (command)
  17 + declare -a commands
  18 +
  19 + commands=(
  20 + 'add:add a new remote'
  21 + 'show:show information about a given remote'
  22 + 'prune:delete all stale tracking branches for a given remote'
  23 + 'update:fetch updates for a set of remotes'
  24 + 'rm:remove a remote from .git/config and all associated tracking branches'
  25 + 'rename:rename a remote from .git/config and update all associated tracking branches'
  26 + 'set-head:sets or deletes the default branch'
  27 + 'set-branches:changes the list of branches tracked by the named remote.'
  28 + 'set-url:changes URL remote points to.'
  29 + )
  30 +
  31 + _describe -t commands 'sub-command' commands && ret=0
  32 + ;;
  33 + (options)
  34 + case $line[1] in
  35 + (add)
  36 + _arguments \
  37 + '*'{--track,-t}'[track given branch instead of default glob refspec]:branch:__git_branch_names' \
  38 + '(--master -m)'{--master,-m}'[set the remote'\''s HEAD to point to given master branch]:branch:__git_branch_names' \
  39 + '(--fetch -f)'{--fetch,-f}'[run git-fetch on the new remote after it has been created]' \
  40 + ':branch name:__git_remotes' \
  41 + ':url:_urls' && ret=0
  42 + ;;
  43 + (show)
  44 + _arguments \
  45 + '-n[do not contact the remote for a list of branches]' \
  46 + ':remote:__git_remotes' && ret=0
  47 + ;;
  48 + (prune)
  49 + _arguments \
  50 + '(--dry-run -n)'{-n,--dry-run}'[do not actually prune, only list what would be done]' \
  51 + ':remote:__git_remotes' && ret=0
  52 + ;;
  53 + (update)
  54 + __git_remote-groups && ret=0
  55 + ;;
  56 + (rm)
  57 + __git_remotes && ret=0
  58 + ;;
  59 + (rename)
  60 + __git_remotes && ret=0
  61 + ;;
  62 + (set-url)
  63 + _arguments \
  64 + '*--push[manipulate push URLs]' \
  65 + '(--add)--add[add URL]' \
  66 + '(--delete)--delete[delete URLs]' \
  67 + ':branch name:__git_remotes' \
  68 + ':url:_urls' && ret=0
  69 + ;;
  70 +
  71 + esac
  72 + ;;
  73 + esac
  74 +}
25 themes/stibbons.zsh-theme
... ... @@ -0,0 +1,25 @@
  1 +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
  2 +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
  3 +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
  4 +ZSH_THEME_GIT_PROMPT_CLEAN=""
  5 +
  6 +#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
  7 +git_custom_status() {
  8 + local cb=$(current_branch)
  9 + if [ -n "$cb" ]; then
  10 + echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX$(git_prompt_rebase_state)"
  11 + fi
  12 +}
  13 +
  14 +#RVM and git settings
  15 +if [[ -s ~/.rvm/scripts/rvm ]] ; then
  16 + RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
  17 +else
  18 + if which rbenv &> /dev/null; then
  19 + RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
  20 + else
  21 + RPS1='$(git_custom_status) $EPS1'
  22 + fi
  23 +fi
  24 +
  25 +PROMPT='%{$fg[cyan]%}[%{$fg[yellow]%}%n%{$fg[cyan]%}@%{$fg[yellow]%}%m%{$fg[cyan]%}:%{$fg[magenta]%}%~% %{$fg[cyan]%}]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.