mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Merge git://github.com/sjl/oh-my-zsh into sjl
This commit is contained in:
commit
f0d9edcbb9
7 changed files with 57 additions and 6 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,5 +1,8 @@
|
||||||
locals.zsh
|
locals.zsh
|
||||||
log/.zsh_history
|
log/.zsh_history
|
||||||
projects.zsh
|
projects.zsh
|
||||||
|
custom
|
||||||
custom/*.zsh
|
custom/*.zsh
|
||||||
!custom/example.zsh
|
!custom/example.zsh
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ setopt auto_pushd
|
||||||
setopt pushd_ignore_dups
|
setopt pushd_ignore_dups
|
||||||
|
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
|
alias ...='cd ../..'
|
||||||
|
alias ....='cd ../../..'
|
||||||
|
alias .....='cd ../../../..'
|
||||||
alias cd..='cd ..'
|
alias cd..='cd ..'
|
||||||
alias cd...='cd ../..'
|
alias cd...='cd ../..'
|
||||||
alias cd....='cd ../../..'
|
alias cd....='cd ../../..'
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ function tab() {
|
||||||
end
|
end
|
||||||
tell application "Terminal"
|
tell application "Terminal"
|
||||||
activate
|
activate
|
||||||
do script with command "cd \"$PWD\"; $*" in window 1
|
do script with command "cd \"$PWD\"; clear; $*" in window 1
|
||||||
end tell
|
end tell
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
lib/git.zsh
16
lib/git.zsh
|
|
@ -5,10 +5,18 @@ function git_prompt_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_git_dirty () {
|
parse_git_dirty () {
|
||||||
if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
|
gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)')
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
|
||||||
else
|
if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\)$") > 0 ]]; then
|
||||||
|
echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(echo ${gitstat} | wc -l | tr -d ' ') == 0 ]]; then
|
||||||
|
echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ autoload -U url-quote-magic
|
||||||
zle -N self-insert url-quote-magic
|
zle -N self-insert url-quote-magic
|
||||||
|
|
||||||
## file rename magick
|
## file rename magick
|
||||||
|
autoload -U zmv
|
||||||
bindkey "^[m" copy-prev-shell-word
|
bindkey "^[m" copy-prev-shell-word
|
||||||
|
|
||||||
## jobs
|
## jobs
|
||||||
|
|
|
||||||
3
lib/python.zsh
Normal file
3
lib/python.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
function wo() {
|
||||||
|
[ -f './.venv' ] && workon `cat ./.venv`
|
||||||
|
}
|
||||||
33
themes/prose.zsh-theme
Normal file
33
themes/prose.zsh-theme
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
function prompt_char {
|
||||||
|
git branch >/dev/null 2>/dev/null && echo '±' && return
|
||||||
|
hg root >/dev/null 2>/dev/null && echo '☿' && return
|
||||||
|
echo '○'
|
||||||
|
}
|
||||||
|
|
||||||
|
function battery_charge {
|
||||||
|
echo `$BAT_CHARGE` 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function virtualenv_info {
|
||||||
|
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
|
||||||
|
}
|
||||||
|
|
||||||
|
function hg_prompt_info {
|
||||||
|
hg prompt --angle-brackets "\
|
||||||
|
< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
|
||||||
|
< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
|
||||||
|
%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
|
||||||
|
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
|
||||||
|
$(virtualenv_info)$(prompt_char) '
|
||||||
|
|
||||||
|
RPROMPT='$(battery_charge)'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue