Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
374b4e02
Commit
374b4e02
authored
Jun 08, 2020
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peepcode: add virtualenv prompt and fix git calls
parent
e27a6e75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
peepcode.zsh-theme
themes/peepcode.zsh-theme
+11
-8
No files found.
themes/peepcode.zsh-theme
View file @
374b4e02
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
#
#
git_repo_path() {
git_repo_path() {
git rev-parse --git-dir 2>/dev/null
command
git rev-parse --git-dir 2>/dev/null
}
}
git_commit_id() {
git_commit_id() {
git rev-parse --short HEAD 2>/dev/null
command
git rev-parse --short HEAD 2>/dev/null
}
}
git_mode() {
git_mode() {
...
@@ -22,23 +22,26 @@ git_mode() {
...
@@ -22,23 +22,26 @@ git_mode() {
}
}
git_dirty() {
git_dirty() {
if [[ "$repo_path" != '.' &&
`git ls-files -m` != "
" ]]; then
if [[ "$repo_path" != '.' &&
-n "$(command git ls-files -m)
" ]]; then
echo " %{$fg_bold[grey]%}✗%{$reset_color%}"
echo " %{$fg_bold[grey]%}✗%{$reset_color%}"
fi
fi
}
}
git_prompt() {
git_prompt() {
local cb=$(git_current_branch)
local cb=$(git_current_branch)
if [
-n "$cb"
]; then
if [
[ -n "$cb" ]
]; then
local repo_path=$(git_repo_path)
local repo_path=$(git_repo_path)
echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)"
echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)"
fi
fi
}
}
local smiley=
"%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
local smiley=
'%(?.%F{green}☺%f.%F{red}☹%f)'
PROMPT='
PROMPT='
%~
${VIRTUAL_ENV:+"($VIRTUAL_ENV) "}
%~
${smiley}
%{$reset_color%}
'
${smiley} '
RPROMPT='%{$fg[white]%} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
RPROMPT='%F{white} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
# Disable automatic virtualenv prompt change
export VIRTUAL_ENV_DISABLE_PROMPT=1
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