Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
1badb744
Commit
1badb744
authored
Dec 02, 2013
by
Robby Russell
Browse files
Merge pull request #948 from excepttheweasel/master
Added peepcode theme
parents
1c185f00
bcd5b3b5
Changes
1
Show whitespace changes
Inline
Side-by-side
themes/peepcode.zsh-theme
0 → 100644
View file @
1badb744
#
# Based on Geoffrey Grosenbach's peepcode zsh theme from
# https://github.com/topfunky/zsh-simple
#
git_repo_path() {
git rev-parse --git-dir 2>/dev/null
}
git_commit_id() {
git rev-parse --short HEAD 2>/dev/null
}
git_mode() {
if [[ -e "$repo_path/BISECT_LOG" ]]; then
echo "+bisect"
elif [[ -e "$repo_path/MERGE_HEAD" ]]; then
echo "+merge"
elif [[ -e "$repo_path/rebase" || -e "$repo_path/rebase-apply" || -e "$repo_path/rebase-merge" || -e "$repo_path/../.dotest" ]]; then
echo "+rebase"
fi
}
git_dirty() {
if [[ "$repo_path" != '.' && `git ls-files -m` != "" ]]; then
echo " %{$fg_bold[grey]%}✗%{$reset_color%}"
fi
}
git_prompt() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
local repo_path=$(git_repo_path)
echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)"
fi
}
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
PROMPT='
%~
${smiley} %{$reset_color%}'
RPROMPT='%{$fg[white]%} $(~/.rvm/bin/rvm-prompt)$(git_prompt)%{$reset_color%}'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment