mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge branch 'plugin-git' into merge
Conflicts: custom/aliases.zsh plugins/git/git-aliases.plugin.zsh plugins/git/git-prompt-old.plugin.zsh plugins/git/git-prompt.plugin.zsh plugins/git/git.plugin.zsh themes/ashleydev.zsh-theme
This commit is contained in:
commit
415bdbfe6d
135 changed files with 2170 additions and 1523 deletions
|
|
@ -6,13 +6,6 @@ h2. Setup
|
||||||
|
|
||||||
@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
|
@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
|
||||||
|
|
||||||
h3. The automatic installer... (do you trust me?)
|
|
||||||
|
|
||||||
@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
|
|
||||||
|
|
||||||
h3. The manual way
|
|
||||||
|
|
||||||
|
|
||||||
1. Clone the repository
|
1. Clone the repository
|
||||||
|
|
||||||
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
|
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
|
||||||
|
|
@ -47,21 +40,12 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
|
||||||
|
|
||||||
h3. Customization
|
h3. Customization
|
||||||
|
|
||||||
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
|
If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugins/@ directory and then enable this plugin.
|
||||||
If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
|
|
||||||
|
|
||||||
h3. Uninstalling
|
|
||||||
|
|
||||||
If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
|
|
||||||
|
|
||||||
h2. Help out!
|
h2. Help out!
|
||||||
|
|
||||||
I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
|
I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
|
||||||
|
|
||||||
h3. Send us your theme!
|
|
||||||
|
|
||||||
I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
|
|
||||||
|
|
||||||
h2. Contributors
|
h2. Contributors
|
||||||
|
|
||||||
This project wouldn't exist without all of our awesome users and contributors.
|
This project wouldn't exist without all of our awesome users and contributors.
|
||||||
|
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
# The 'ls' family
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
[[ "$DISABLE_COLOR" != 'true' ]] && {
|
|
||||||
[[ -x "${commands[gdircolors]}" ]] && use_color_gnu='true' || use_color_bsd='true'
|
|
||||||
}
|
|
||||||
|
|
||||||
[[ "$use_color_gnu" == 'true' && -e "$HOME/.dir_colors" ]] && eval $(gdircolors $HOME/.dir_colors)
|
|
||||||
[[ "$use_color_bsd" == 'true' ]] && export CLICOLOR=1
|
|
||||||
[[ "$use_color_bsd" == 'true' ]] && export LSCOLORS="exfxcxdxbxegedabagacad"
|
|
||||||
|
|
||||||
# add colors for filetype recognition
|
|
||||||
[[ "$use_color_gnu" == 'true' ]] && alias ls='ls -hF --group-directories-first --color=auto'
|
|
||||||
[[ "$use_color_bsd" == 'true' ]] && alias ls='ls -G -F'
|
|
||||||
|
|
||||||
alias la='ls -Ahl' # show hidden files
|
|
||||||
alias lx='ls -lhXB' # sort by extension
|
|
||||||
alias lk='ls -lhSr' # sort by size, biggest last
|
|
||||||
alias lc='ls -lhtcr' # sort by and show change time, most recent last
|
|
||||||
alias lu='ls -lhtur' # sort by and show access time, most recent last
|
|
||||||
alias lt='ls -lhtr' # sort by date, most recent last
|
|
||||||
alias lm='ls -ahl | more' # pipe through 'more'
|
|
||||||
alias lr='ls -lhR' # recursive ls
|
|
||||||
alias l='ls -lha'
|
|
||||||
alias ll='ls -lh'
|
|
||||||
|
|
||||||
# General
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
alias rm='nocorrect rm -i'
|
|
||||||
alias cp='nocorrect cp -i'
|
|
||||||
alias mv='nocorrect mv -i'
|
|
||||||
alias ln='nocorrect ln -i'
|
|
||||||
alias mkdir='nocorrect mkdir -p'
|
|
||||||
alias du='du -kh'
|
|
||||||
alias df='df -kh'
|
|
||||||
alias e="$EDITOR"
|
|
||||||
alias get='curl -C - -O'
|
|
||||||
alias q='exit'
|
|
||||||
alias ssh='ssh -X'
|
|
||||||
alias h='history'
|
|
||||||
alias j='jobs -l'
|
|
||||||
alias f='fg'
|
|
||||||
alias gr='grep -r'
|
|
||||||
alias type='type -a'
|
|
||||||
alias print-path='echo -e ${PATH//:/\\n}'
|
|
||||||
alias print-libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
|
|
||||||
alias lsbom='lsbom -f -l -s -pf'
|
|
||||||
alias t="$HOME/.local/bin/t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
|
|
||||||
|
|
||||||
alias v.='vim .'
|
|
||||||
alias v='vim ~/.vimrc'
|
|
||||||
alias VS='vim -S Session.vim'
|
|
||||||
|
|
||||||
alias z='vim -o ~/.zshenv ~/.oh-my-zsh/custom/aliases.zsh ~/.zshrc'
|
|
||||||
alias zs='source ~/.zshrc'
|
|
||||||
|
|
||||||
|
|
||||||
if [[ -x "${commands[htop]}" ]]; then
|
|
||||||
alias top=htop
|
|
||||||
else
|
|
||||||
alias topm='top -o vsize'
|
|
||||||
alias topc='top -o cpu'
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ "$DISABLE_COLOR" != 'true' ]] && {
|
|
||||||
[[ -x "${commands[colordiff]}" ]] && alias diff='colordiff'
|
|
||||||
[[ -x "${commands[colormake]}" ]] && alias make='colormake'
|
|
||||||
}
|
|
||||||
|
|
||||||
# Screen
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
[[ "$TERM" == 'xterm-color' && -e "$HOME/.screenrc" ]] && screenrc="-c '$HOME/.screenrc'"
|
|
||||||
[[ "$TERM" == 'xterm-256color' && -e "$HOME/.screenrc256" ]] && screenrc="-c '$HOME/.screenrc256'"
|
|
||||||
alias screen="screen $screenrc"
|
|
||||||
alias sl="screen $screenrc -list"
|
|
||||||
alias sr="screen $screenrc -a -A -U -D -R"
|
|
||||||
alias S="screen $screenrc -U -S"
|
|
||||||
|
|
||||||
# TMUX
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
[[ "$TERM" == 'xterm-color' && -e "$HOME/.tmux.conf" ]] && tmuxconf="-f '$HOME/.tmux.conf'"
|
|
||||||
[[ "$TERM" == 'xterm-256color' && -e "$HOME/.tmux256.conf" ]] && tmuxconf="-f '$HOME/.tmux256.conf'"
|
|
||||||
alias tmux="tmux $tmuxconf"
|
|
||||||
alias tls="tmux list-sessions"
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
unsetopt auto_pushd
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
function cdll() {
|
|
||||||
if [[ -n "$1" ]]; then
|
|
||||||
builtin cd "$1"
|
|
||||||
ls -lFhA
|
|
||||||
else
|
|
||||||
ls -lFhA
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function pushdll() {
|
|
||||||
if [[ -n "$1" ]]; then
|
|
||||||
builtin pushd "$1"
|
|
||||||
ls -lFhA
|
|
||||||
else
|
|
||||||
ls -lFhA
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function popdll() {
|
|
||||||
builtin popd
|
|
||||||
ls -lFhA
|
|
||||||
}
|
|
||||||
|
|
||||||
function grab() {
|
|
||||||
sudo chown -R ${USER} ${1:-.}
|
|
||||||
}
|
|
||||||
|
|
||||||
function reload() {
|
|
||||||
source "$HOME/.zshrc"
|
|
||||||
}
|
|
||||||
|
|
||||||
function calc() {
|
|
||||||
echo "scale=4; $@" | bc -l
|
|
||||||
}
|
|
||||||
|
|
||||||
function pmine() {
|
|
||||||
ps $@ -u $USER -o pid,%cpu,%mem,command
|
|
||||||
}
|
|
||||||
|
|
||||||
function findexec() {
|
|
||||||
find . -type f -iname '*'${1:-}'*' -exec ${2:-file} {} \;
|
|
||||||
}
|
|
||||||
|
|
||||||
function httpserve() {
|
|
||||||
python -m SimpleHTTPServer
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
if [[ "$DISABLE_COLOR" != "true" ]]; then
|
|
||||||
export GREP_OPTIONS='--color=auto'
|
|
||||||
export GREP_COLOR='37;45'
|
|
||||||
else
|
|
||||||
export GREP_OPTIONS='--color=none'
|
|
||||||
export GREP_COLOR=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
if [[ "$DISABLE_COLOR" == "true" ]]; then
|
|
||||||
F_ordinary_highlight="bg=none,fg=none"
|
|
||||||
F_out_of_matches_highlight="bg=none,fg=none"
|
|
||||||
fi
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# Add yourself some shortcuts to projects you often work on
|
|
||||||
# Example:
|
|
||||||
#
|
|
||||||
# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
|
|
||||||
#
|
|
||||||
122
lib/aliases.zsh
122
lib/aliases.zsh
|
|
@ -1,24 +1,112 @@
|
||||||
# Push and pop directories on directory stack
|
# The 'ls' family
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
||||||
|
if (( ${+commands[dircolors]} )); then
|
||||||
|
dircolors="${commands[dircolors]}"
|
||||||
|
fi
|
||||||
|
if (( ${+commands[gdircolors]} )); then
|
||||||
|
dircolors="${commands[gdircolors]}"
|
||||||
|
fi
|
||||||
|
if [[ -x "$dircolors" ]] && [[ -e "$HOME/.dir_colors" ]]; then
|
||||||
|
eval $("$dircolors" "$HOME/.dir_colors")
|
||||||
|
alias ls='ls -hF --group-directories-first --color=auto'
|
||||||
|
else
|
||||||
|
export CLICOLOR=1
|
||||||
|
export LSCOLORS="exfxcxdxbxegedabagacad"
|
||||||
|
alias ls='ls -G -F'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias ll='ls -lh' # Show human readable.
|
||||||
|
alias l='ls -lha' # Show hidden files.
|
||||||
|
alias la='ls -lhA' # Show hidden files.
|
||||||
|
alias lx='ls -lhXB' # Sort by extension.
|
||||||
|
alias lk='ls -lhSr' # Sort by size, biggest last.
|
||||||
|
alias lc='ls -lhtcr' # Sort by and show change time, most recent lasa.
|
||||||
|
alias lu='ls -lhtur' # Sort by and show access time, most recent last.
|
||||||
|
alias lt='ls -lhtr' # Sort by date, most recent last.
|
||||||
|
alias lm='ls -lha | more' # Pipe through 'more'.
|
||||||
|
alias lr='ls -lhR' # Recursive ls.
|
||||||
|
|
||||||
|
# General
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
alias rm='nocorrect rm -i'
|
||||||
|
alias cp='nocorrect cp -i'
|
||||||
|
alias mv='nocorrect mv -i'
|
||||||
|
alias ln='nocorrect ln -i'
|
||||||
|
alias mkdir='nocorrect mkdir -p'
|
||||||
|
alias du='du -kh'
|
||||||
|
alias df='df -kh'
|
||||||
alias pu='pushd'
|
alias pu='pushd'
|
||||||
alias po='popd'
|
alias po='popd'
|
||||||
|
|
||||||
# Basic directory operations
|
|
||||||
alias ...='cd ../..'
|
|
||||||
alias -- -='cd -'
|
|
||||||
|
|
||||||
# Super user
|
|
||||||
alias _='sudo'
|
alias _='sudo'
|
||||||
|
alias e="$EDITOR"
|
||||||
#alias g='grep -in'
|
|
||||||
|
|
||||||
# Show history
|
|
||||||
alias history='fc -l 1'
|
alias history='fc -l 1'
|
||||||
|
alias get='curl -C - -O'
|
||||||
|
alias q='exit'
|
||||||
|
alias ssh='ssh -X'
|
||||||
|
alias h='history'
|
||||||
|
alias j='jobs -l'
|
||||||
|
alias f='fg'
|
||||||
|
alias gr='grep -r'
|
||||||
|
alias afind='ack -il'
|
||||||
|
alias type='type -a'
|
||||||
|
# alias ssh='ssh -X'
|
||||||
|
alias print-path='echo -e ${PATH//:/\\n}'
|
||||||
|
alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
|
||||||
|
|
||||||
# List direcory contents
|
alias z='vim -o ~/.zshenv ~/.oh-my-zsh/lib/aliases.zsh ~/.zshrc'
|
||||||
alias lsa='ls -lah'
|
alias zs='source ~/.zshrc'
|
||||||
alias l='ls -la'
|
|
||||||
alias ll='ls -l'
|
|
||||||
alias sl=ls # often screw this up
|
|
||||||
|
|
||||||
alias afind='ack-grep -il'
|
if [[ "$EDITOR" = vi* ]]; then
|
||||||
|
alias v.='vim .'
|
||||||
|
alias v='vim ~/.vimrc'
|
||||||
|
alias VS='vim -S Session.vim'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -x "${commands[htop]}" ]]; then
|
||||||
|
alias top=htop
|
||||||
|
else
|
||||||
|
alias topm='top -o vsize'
|
||||||
|
alias topc='top -o cpu'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
||||||
|
if [[ -x "${commands[colordiff]}" ]]; then
|
||||||
|
alias diff='colordiff'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -x "${commands[colormake]}" ]]; then
|
||||||
|
alias make='colormake'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Terminal Multiplexer
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
local screenrc tmuxconf
|
||||||
|
if [[ "$TERM" == 'xterm-color' ]]; then
|
||||||
|
if [[ -e "$HOME/.screenrc" ]]; then
|
||||||
|
screenrc="-c '$HOME/.screenrc'"
|
||||||
|
fi
|
||||||
|
if [[ -e "$HOME/.tmux.conf" ]]; then
|
||||||
|
tmuxconf="-f '$HOME/.tmux.conf'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TERM" == 'xterm-256color' ]]; then
|
||||||
|
if [[ -e "$HOME/.screenrc256" ]]; then
|
||||||
|
screenrc="-c '$HOME/.screenrc256'"
|
||||||
|
fi
|
||||||
|
if [[ -e "$HOME/.tmux256.conf" ]]; then
|
||||||
|
tmuxconf="-f '$HOME/.tmux256.conf'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias screen="screen $screenrc"
|
||||||
|
alias sl="screen $screenrc -list"
|
||||||
|
alias sr="screen $screenrc -a -A -U -D -R"
|
||||||
|
alias S="screen $screenrc -U -S"
|
||||||
|
|
||||||
|
alias tmux="tmux $tmuxconf"
|
||||||
|
alias tls="tmux list-sessions"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
# fixme - the load process here seems a bit bizarre
|
# Dumb terminals lack support.
|
||||||
[[ "$TERM" == "dumb" ]] && return
|
if [[ "$TERM" == 'dumb' ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
unsetopt menu_complete # do not autoselect the first completion entry
|
unsetopt menu_complete # Do not autoselect the first completion entry.
|
||||||
unsetopt flowcontrol
|
unsetopt flow_control # Disable start/stop characters in shell editor.
|
||||||
setopt auto_menu # show completion menu on succesive tab press
|
setopt auto_menu # Show completion menu on a succesive tab press.
|
||||||
setopt complete_in_word
|
setopt complete_in_word # Complete from both ends of a word.
|
||||||
setopt always_to_end
|
setopt always_to_end # Move cursor to the end of a completed word.
|
||||||
|
|
||||||
WORDCHARS=''
|
WORDCHARS=''
|
||||||
|
|
||||||
# fixme - complist is crashing ZSH on menu completion
|
# FIXME: complist is crashing ZSH on menu completion.
|
||||||
# zmodload -i zsh/complist
|
# zmodload -i zsh/complist
|
||||||
|
|
||||||
## case-insensitive (all),partial-word and then substring completion
|
## Case-insensitive (all), partial-word, and then substring completion.
|
||||||
if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
|
if [[ "$CASE_SENSITIVE" == "true" ]]; then
|
||||||
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||||
unset CASE_SENSITIVE
|
unset CASE_SENSITIVE
|
||||||
else
|
else
|
||||||
|
|
@ -22,18 +24,19 @@ fi
|
||||||
|
|
||||||
zstyle ':completion:*' list-colors ''
|
zstyle ':completion:*' list-colors ''
|
||||||
|
|
||||||
# should this be in keybindings?
|
# FIXME: It depends on complist which crashes ZSH on menu completion.
|
||||||
|
# Should this be in key-bindings.zsh?
|
||||||
# bindkey -M menuselect '^o' accept-and-infer-next-history
|
# bindkey -M menuselect '^o' accept-and-infer-next-history
|
||||||
|
|
||||||
zstyle ':completion:*:*:*:*:*' menu select
|
zstyle ':completion:*:*:*:*:*' menu select
|
||||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||||
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
|
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
|
||||||
|
|
||||||
# disable named-directories autocompletion
|
# Disable named-directories autocompletion.
|
||||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||||
cdpath=(.)
|
cdpath=(.)
|
||||||
|
|
||||||
# use /etc/hosts and known_hosts for hostname completion
|
# Use /etc/hosts and known_hosts for hostname completion.
|
||||||
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
||||||
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
|
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
|
||||||
hosts=(
|
hosts=(
|
||||||
|
|
@ -44,11 +47,11 @@ hosts=(
|
||||||
)
|
)
|
||||||
zstyle ':completion:*:hosts' hosts $hosts
|
zstyle ':completion:*:hosts' hosts $hosts
|
||||||
|
|
||||||
# Use caching so that commands like apt and dpkg complete are useable
|
# Use caching to make completion for cammands such as dpkg and apt usable.
|
||||||
zstyle ':completion::complete:*' use-cache 1
|
zstyle ':completion::complete:*' use-cache 1
|
||||||
zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
|
zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
|
||||||
|
|
||||||
# Don't complete uninteresting users
|
# Don't complete uninteresting users...
|
||||||
zstyle ':completion:*:*:*:users' ignored-patterns \
|
zstyle ':completion:*:*:*:users' ignored-patterns \
|
||||||
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
|
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
|
||||||
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
|
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,4 @@ alias gist='nocorrect gist'
|
||||||
alias heroku='nocorrect heroku'
|
alias heroku='nocorrect heroku'
|
||||||
alias ebuild='nocorrect ebuild'
|
alias ebuild='nocorrect ebuild'
|
||||||
alias hpodder='nocorrect hpodder'
|
alias hpodder='nocorrect hpodder'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
# Changing/making/removing directory
|
setopt auto_cd # Auto cd to a directory without typing cd.
|
||||||
setopt auto_name_dirs
|
setopt auto_pushd # Push the old directory onto the stack on cd.
|
||||||
setopt auto_pushd
|
setopt pushd_ignore_dups # Don't store duplicates in the stack.
|
||||||
setopt pushd_ignore_dups
|
setopt cdable_vars # Change directory to a path stored in a variable.
|
||||||
|
setopt auto_name_dirs # Auto add variable-stored paths to ~ list.
|
||||||
|
setopt multios # Write to multiple descriptors.
|
||||||
|
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
alias cd..='cd ..'
|
alias cd..='cd ..'
|
||||||
|
|
@ -9,6 +11,7 @@ alias cd...='cd ../..'
|
||||||
alias cd....='cd ../../..'
|
alias cd....='cd ../../..'
|
||||||
alias cd.....='cd ../../../..'
|
alias cd.....='cd ../../../..'
|
||||||
alias cd/='cd /'
|
alias cd/='cd /'
|
||||||
|
alias -- -='cd -'
|
||||||
|
|
||||||
alias 1='cd -'
|
alias 1='cd -'
|
||||||
alias 2='cd +2'
|
alias 2='cd +2'
|
||||||
|
|
@ -34,11 +37,3 @@ cd () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
alias md='mkdir -p'
|
|
||||||
alias rd=rmdir
|
|
||||||
alias d='dirs -v'
|
|
||||||
|
|
||||||
# mkdir & cd to it
|
|
||||||
function mcd() {
|
|
||||||
mkdir -p "$1" && cd "$1";
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +1,60 @@
|
||||||
function zsh_stats() {
|
function history-stat() {
|
||||||
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstall_oh_my_zsh() {
|
function mkdcd() {
|
||||||
/bin/sh $ZSH/tools/uninstall.sh
|
mkdir -p "$1"
|
||||||
|
cd "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgrade_oh_my_zsh() {
|
function cdll() {
|
||||||
/bin/sh $ZSH/tools/upgrade.sh
|
if [[ -n "$1" ]]; then
|
||||||
|
builtin cd "$1"
|
||||||
|
ls -lFhA
|
||||||
|
else
|
||||||
|
ls -lFhA
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function take() {
|
function pushdll() {
|
||||||
mkdir -p $1
|
if [[ -n "$1" ]]; then
|
||||||
cd $1
|
builtin pushd "$1"
|
||||||
|
ls -lFhA
|
||||||
|
else
|
||||||
|
ls -lFhA
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function popdll() {
|
||||||
|
builtin popd
|
||||||
|
ls -lFhA
|
||||||
|
}
|
||||||
|
|
||||||
|
function gown() {
|
||||||
|
sudo chown -R "${USER}" "${1:-.}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function reload() {
|
||||||
|
local zshrc="$HOME/.zshrc"
|
||||||
|
if [[ -n "$1" ]]; then
|
||||||
|
zshrc="$1"
|
||||||
|
fi
|
||||||
|
source "$zshrc"
|
||||||
|
}
|
||||||
|
|
||||||
|
function calc() {
|
||||||
|
echo "scale=4; $@" | bc -l
|
||||||
|
}
|
||||||
|
|
||||||
|
function pmine() {
|
||||||
|
ps "$@" -u "$USER" -o pid,%cpu,%mem,command
|
||||||
|
}
|
||||||
|
|
||||||
|
function findexec() {
|
||||||
|
find . -type f -iname "*${1:-}*" -exec "${2:-file}" {} \;
|
||||||
|
}
|
||||||
|
|
||||||
|
function httpserve() {
|
||||||
|
python -m SimpleHTTPServer "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
14
lib/grep.zsh
14
lib/grep.zsh
|
|
@ -1,4 +1,12 @@
|
||||||
if [[ "$DISABLE_COLOR" != "true" ]]; then
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
||||||
[[ -z "$GREP_OPTIONS" ]] && export GREP_OPTIONS='--color=auto'
|
if [[ -z "$GREP_OPTIONS" ]]; then
|
||||||
[[ -z "$GREP_COLOR" ]] && export GREP_COLOR='1;32'
|
export GREP_OPTIONS='--color=auto'
|
||||||
|
fi
|
||||||
|
if [[ -z "$GREP_COLOR" ]]; then
|
||||||
|
export GREP_COLOR="1;32"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
export GREP_OPTIONS='--color=none'
|
||||||
|
export GREP_COLOR=''
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
## Command history configuration
|
## Command history configuration
|
||||||
HISTFILE=$HOME/.zsh_history
|
HISTFILE="$HOME/.zsh_history"
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
|
|
||||||
setopt HIST_VERIFY
|
setopt hist_verify
|
||||||
setopt HIST_EXPIRE_DUPS_FIRST
|
setopt hist_expire_dups_first
|
||||||
setopt HIST_IGNORE_SPACE
|
setopt hist_ignore_space
|
||||||
setopt HIST_IGNORE_DUPS
|
setopt hist_ignore_dups
|
||||||
setopt SHARE_HISTORY
|
setopt share_history
|
||||||
setopt APPEND_HISTORY
|
setopt append_history
|
||||||
setopt EXTENDED_HISTORY
|
setopt extended_history
|
||||||
setopt INC_APPEND_HISTORY
|
setopt inc_append_history
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# TODO: Explain what some of this does..
|
# TODO: Write a GNU Emacs key bindings file akin to the vi-mode plugin.
|
||||||
|
|
||||||
bindkey -e
|
bindkey -e
|
||||||
bindkey '\ew' kill-region
|
bindkey '\ew' kill-region
|
||||||
|
|
@ -8,7 +8,7 @@ bindkey '^r' history-incremental-search-backward
|
||||||
bindkey "^[[5~" up-line-or-history
|
bindkey "^[[5~" up-line-or-history
|
||||||
bindkey "^[[6~" down-line-or-history
|
bindkey "^[[6~" down-line-or-history
|
||||||
|
|
||||||
# make search up and down work, so partially type and hit up/down to find relevant stuff
|
# Make key up/down move up/down or search history.
|
||||||
bindkey '^[[A' up-line-or-search
|
bindkey '^[[A' up-line-or-search
|
||||||
bindkey '^[[B' down-line-or-search
|
bindkey '^[[B' down-line-or-search
|
||||||
|
|
||||||
|
|
@ -16,18 +16,22 @@ bindkey "^[[H" beginning-of-line
|
||||||
bindkey "^[[1~" beginning-of-line
|
bindkey "^[[1~" beginning-of-line
|
||||||
bindkey "^[[F" end-of-line
|
bindkey "^[[F" end-of-line
|
||||||
bindkey "^[[4~" end-of-line
|
bindkey "^[[4~" end-of-line
|
||||||
bindkey ' ' magic-space # also do history expansion on space
|
|
||||||
|
|
||||||
|
# Do history expansion on space.
|
||||||
|
bindkey ' ' magic-space
|
||||||
|
|
||||||
|
# File rename magick.
|
||||||
|
bindkey "^[m" copy-prev-shell-word
|
||||||
bindkey '^[[Z' reverse-menu-complete
|
bindkey '^[[Z' reverse-menu-complete
|
||||||
|
|
||||||
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
|
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~.
|
||||||
bindkey "^[[3~" delete-char
|
bindkey "^[[3~" delete-char
|
||||||
bindkey "^[3;5~" delete-char
|
bindkey "^[3;5~" delete-char
|
||||||
bindkey "\e[3~" delete-char
|
bindkey "\e[3~" delete-char
|
||||||
|
|
||||||
# consider emacs keybindings:
|
# Consider GNU Emacs keybindings:
|
||||||
|
|
||||||
#bindkey -e ## emacs key bindings
|
#bindkey -e # Emacs key bindings.
|
||||||
#
|
#
|
||||||
#bindkey '^[[A' up-line-or-search
|
#bindkey '^[[A' up-line-or-search
|
||||||
#bindkey '^[[B' down-line-or-search
|
#bindkey '^[[B' down-line-or-search
|
||||||
|
|
@ -40,6 +44,6 @@ bindkey "\e[3~" delete-char
|
||||||
#bindkey '^X^N' accept-and-infer-next-history
|
#bindkey '^X^N' accept-and-infer-next-history
|
||||||
#bindkey '^W' kill-region
|
#bindkey '^W' kill-region
|
||||||
#bindkey '^I' complete-word
|
#bindkey '^I' complete-word
|
||||||
## Fix weird sequence that rxvt produces
|
## FIXME: A weird sequence that rxvt produces
|
||||||
#bindkey -s '^[[Z' '\t'
|
#bindkey -s '^[[Z' '\t'
|
||||||
#
|
|
||||||
|
|
|
||||||
20
lib/misc.zsh
20
lib/misc.zsh
|
|
@ -1,13 +1,17 @@
|
||||||
## smart urls
|
# Smart URLs
|
||||||
autoload -U url-quote-magic
|
autoload -U url-quote-magic
|
||||||
zle -N self-insert url-quote-magic
|
zle -N self-insert url-quote-magic
|
||||||
|
|
||||||
## file rename magick
|
# Jobs
|
||||||
bindkey "^[m" copy-prev-shell-word
|
|
||||||
|
|
||||||
## jobs
|
|
||||||
setopt long_list_jobs
|
setopt long_list_jobs
|
||||||
|
|
||||||
## pager
|
# Pager
|
||||||
[[ -z "$PAGER" ]] && export PAGER=less
|
if [[ -z "$PAGER" ]]; then
|
||||||
[[ -z "$LC_CTYPE" ]] && export LC_CTYPE=en_US.UTF-8
|
export PAGER=less
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Localization
|
||||||
|
if [[ -z "$LC_CTYPE" ]]; then
|
||||||
|
export LC_CTYPE=en_US.UTF-8
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# get the name of the branch we are on
|
|
||||||
function rvm_prompt_info() {
|
|
||||||
ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
|
|
||||||
echo "($ruby_version)"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#! /bin/zsh
|
# A script to make using 256 colors in ZSH less painful in your PROMPT.
|
||||||
# A script to make using 256 colors in zsh less painful.
|
|
||||||
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
||||||
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
||||||
|
|
||||||
|
|
@ -18,3 +17,4 @@ for color in {000..255}; do
|
||||||
FG[$color]="%{[38;5;${color}m%}"
|
FG[$color]="%{[38;5;${color}m%}"
|
||||||
BG[$color]="%{[48;5;${color}m%}"
|
BG[$color]="%{[48;5;${color}m%}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,40 @@
|
||||||
[[ "$TERM" == "dumb" ]] && return
|
# Dumb terminals lack support.
|
||||||
|
if [[ "$TERM" == 'dumb' ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
|
# Fully supports GNU Screen, iTerm, and most modern xterm and rxvt terminals.
|
||||||
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
|
# Partially supports Mac OS X Terminal since it can't set window and tab separately.
|
||||||
#Fully support screen, iterm, and probably most modern xterm and rxvt
|
# Usage: title "tab title" "window title"
|
||||||
#Limited support for Apple Terminal (Terminal can't set window or tab separately)
|
|
||||||
function title {
|
function title {
|
||||||
[ "$DISABLE_AUTO_TITLE" != "true" ] || return
|
if [[ "$DISABLE_AUTO_TITLE" != 'true' ]]; then
|
||||||
if [[ "$TERM" == screen* ]]; then
|
if [[ "$TERM" == screen* ]]; then
|
||||||
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
|
# Set GNU Screen's hardstatus (usually truncated at 20 characters).
|
||||||
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
|
print -Pn "\ek$1:q\e\\"
|
||||||
print -Pn "\e]2;$2:q\a" #set window name
|
elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then
|
||||||
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
|
# Set the window title.
|
||||||
|
print -Pn "\e]2;$2:q\a"
|
||||||
|
# Set the tab title (will override window title on a broken terminal).
|
||||||
|
print -Pn "\e]1;$1:q\a"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
|
# 15 character, left-truncated current working directory.
|
||||||
|
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<"
|
||||||
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
|
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
|
||||||
|
|
||||||
#Appears when you have the prompt
|
# Set the tab and window titles before the prompt is displayed.
|
||||||
function precmd {
|
function precmd {
|
||||||
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Appears at the beginning of (and during) of command execution
|
# Set the tab and window titles before command execution.
|
||||||
function preexec {
|
function preexec {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
|
# Command name only, or if this is sudo or ssh, the next command.
|
||||||
|
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
|
||||||
title "$CMD" "%100>...>$2%<<"
|
title "$CMD" "%100>...>$2%<<"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,23 @@
|
||||||
# ls colors
|
# Load and run colors.
|
||||||
autoload colors; colors;
|
autoload -U colors
|
||||||
[[ -z "$LSCOLORS" ]] && export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
colors -i
|
||||||
|
|
||||||
# Enable ls colors
|
# Set the GNU Screen window number.
|
||||||
if [ "$DISABLE_COLOR" != "true" ]
|
if [[ -n "$WINDOW" ]]; then
|
||||||
then
|
|
||||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
|
||||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
|
||||||
fi
|
|
||||||
|
|
||||||
#setopt no_beep
|
|
||||||
setopt auto_cd
|
|
||||||
setopt multios
|
|
||||||
setopt cdablevarS
|
|
||||||
|
|
||||||
if [[ x$WINDOW != x ]]
|
|
||||||
then
|
|
||||||
SCREEN_NO="%B$WINDOW%b "
|
SCREEN_NO="%B$WINDOW%b "
|
||||||
else
|
else
|
||||||
SCREEN_NO=""
|
SCREEN_NO=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply theming defaults
|
# Set the default prompt theme.
|
||||||
PS1="%n@%m:%~%# "
|
PS1="%n@%m:%~%# "
|
||||||
|
|
||||||
# git theming default: Variables for theming the git info prompt
|
# Set the default Git prompt theme.
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix before the branch name.
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # Suffix after the branch name.
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
|
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Indicator to display if the branch is dirty.
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
|
ZSH_THEME_GIT_PROMPT_CLEAN="" # Indicator to display if the branch is clean.
|
||||||
|
|
||||||
# Setup the prompt with pretty colors
|
# Enable parameter, arithmentic expansion and command substitution in prompt.
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it.
|
|
||||||
|
|
||||||
feel free to add love notes for people here.
|
|
||||||
|
|
||||||
63
oh-my-zsh.sh
63
oh-my-zsh.sh
|
|
@ -1,58 +1,45 @@
|
||||||
# Initializes Oh My Zsh
|
# Initializes OH MY ZSH.
|
||||||
|
|
||||||
# Disable colors on dumb terminals
|
# Disable color in dumb terminals.
|
||||||
if [ "$TERM" = "dumb" ]; then
|
if [[ "$TERM" == 'dumb' ]]; then
|
||||||
DISABLE_COLOR="true"
|
DISABLE_COLOR='true'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add a function path
|
# Load all files in $ZSH/oh-my-zsh/lib/ that end in .zsh.
|
||||||
fpath=($ZSH/functions $fpath)
|
for config_file in $ZSH/lib/*.zsh; do
|
||||||
|
source "$config_file"
|
||||||
|
done
|
||||||
|
|
||||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
# Add all defined plugins to fpath.
|
||||||
# TIP: Add files you don't want in git to .gitignore
|
|
||||||
for config_file ($ZSH/lib/*.zsh) source $config_file
|
|
||||||
|
|
||||||
# Add all defined plugins to fpath
|
|
||||||
plugin=${plugin:=()}
|
plugin=${plugin:=()}
|
||||||
for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
|
for plugin in $plugins; do
|
||||||
|
fpath=($ZSH/plugins/$plugin $fpath)
|
||||||
|
done
|
||||||
|
|
||||||
# Load and run compinit
|
# Load and run compinit.
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
compinit -i
|
compinit -i
|
||||||
|
|
||||||
# Load all of the plugins that were defined in ~/.zshrc
|
# Load all plugins defined in ~/.zshrc.
|
||||||
for plugin ($plugins); do
|
for plugin in $plugins; do
|
||||||
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
if [[ -f "$ZSH/plugins/$plugin/$plugin.plugin.zsh" ]]; then
|
||||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
source "$ZSH/plugins/$plugin/$plugin.plugin.zsh"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load the theme
|
# Load the theme.
|
||||||
# Check for updates on initial load...
|
if [[ "$ZSH_THEME" == "random" ]]; then
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
themes=($ZSH/themes/*.zsh-theme)
|
||||||
then
|
theme_index=${#themes[@]}
|
||||||
themes=($ZSH/themes/*zsh-theme)
|
(( theme_index=((RANDOM % theme_index) + 1) ))
|
||||||
N=${#themes[@]}
|
random_theme="${themes[$theme_index]}"
|
||||||
((N=RANDOM%N))
|
source "$random_theme"
|
||||||
RANDOM_THEME=${themes[$N]}
|
|
||||||
source "$RANDOM_THEME"
|
|
||||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
|
||||||
else
|
else
|
||||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load all of your custom configurations from custom/
|
|
||||||
for config_file ($ZSH/custom/*.zsh) source $config_file
|
|
||||||
|
|
||||||
# Compile zcompdump, if modified, to increase startup speed.
|
# Compile zcompdump, if modified, to increase startup speed.
|
||||||
if [ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" -o ! -e "$HOME/.zcompdump.zwc" ]; then
|
if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -e "$HOME/.zcompdump.zwc" ]]; then
|
||||||
zcompile "$HOME/.zcompdump"
|
zcompile "$HOME/.zcompdump"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for updates on initial load...
|
|
||||||
if [ "$DISABLE_AUTO_UPDATE" = "true" ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
/usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
26
plugins/ant/ant.plugin.zsh
Normal file
26
plugins/ant/ant.plugin.zsh
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
stat -f%m . > /dev/null 2>&1
|
||||||
|
if [ "$?" = 0 ]; then
|
||||||
|
stat_cmd=(stat -f%m)
|
||||||
|
else
|
||||||
|
stat_cmd=(stat -L --format=%y)
|
||||||
|
fi
|
||||||
|
|
||||||
|
_ant_does_target_list_need_generating () {
|
||||||
|
if [ ! -f .ant_targets ]; then return 0;
|
||||||
|
else
|
||||||
|
accurate=$($stat_cmd -f%m .ant_targets)
|
||||||
|
changed=$($stat_cmd -f%m build.xml)
|
||||||
|
return $(expr $accurate '>=' $changed)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_ant () {
|
||||||
|
if [ -f build.xml ]; then
|
||||||
|
if _ant_does_target_list_need_generating; then
|
||||||
|
sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
|
||||||
|
fi
|
||||||
|
compadd `cat .ant_targets`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _ant ant
|
||||||
3
plugins/autojump/autojump.plugin.zsh
Normal file
3
plugins/autojump/autojump.plugin.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
if [ -f `brew --prefix`/etc/autojump ]; then
|
||||||
|
. `brew --prefix`/etc/autojump
|
||||||
|
fi
|
||||||
|
|
@ -25,10 +25,12 @@ _1st_arguments=(
|
||||||
'link:link a formula'
|
'link:link a formula'
|
||||||
'list:list files in a formula or not-installed formulae'
|
'list:list files in a formula or not-installed formulae'
|
||||||
'log:git commit log for a formula'
|
'log:git commit log for a formula'
|
||||||
|
'missing:check all installed formuale for missing dependencies.'
|
||||||
'outdated:list formulas for which a newer version is available'
|
'outdated:list formulas for which a newer version is available'
|
||||||
'prune:remove dead links'
|
'prune:remove dead links'
|
||||||
'remove:remove a formula'
|
'remove:remove a formula'
|
||||||
'search:search for a formula (/regex/ or string)'
|
'search:search for a formula (/regex/ or string)'
|
||||||
|
'server:start a local web app that lets you browse formulae (requires Sinatra)'
|
||||||
'unlink:unlink a formula'
|
'unlink:unlink a formula'
|
||||||
'update:freshen up links'
|
'update:freshen up links'
|
||||||
'upgrade:upgrade outdated formulae'
|
'upgrade:upgrade outdated formulae'
|
||||||
|
|
@ -36,10 +38,14 @@ _1st_arguments=(
|
||||||
)
|
)
|
||||||
|
|
||||||
local expl
|
local expl
|
||||||
local -a formula installed_formulae
|
local -a formulae installed_formulae
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-v --verbose)'{-v,--verbose}'[verbose]' \
|
'(-v)-v[verbose]' \
|
||||||
|
'(--cellar)--cellar[brew cellar]' \
|
||||||
|
'(--config)--config[brew configuration]' \
|
||||||
|
'(--env)--env[brew environment]' \
|
||||||
|
'(--repository)--repository[brew repository]' \
|
||||||
'(--version)--version[version information]' \
|
'(--version)--version[version information]' \
|
||||||
'(--prefix)--prefix[where brew lives on this system]' \
|
'(--prefix)--prefix[where brew lives on this system]' \
|
||||||
'(--cache)--cache[brew cache]' \
|
'(--cache)--cache[brew cache]' \
|
||||||
|
|
@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$words[1]" in
|
case "$words[1]" in
|
||||||
list)
|
search|-S)
|
||||||
|
_arguments \
|
||||||
|
'(--macports)--macports[search the macports repository]' \
|
||||||
|
'(--fink)--fink[search the fink repository]' ;;
|
||||||
|
list|ls)
|
||||||
_arguments \
|
_arguments \
|
||||||
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
||||||
|
'(--versions)--versions[list all installed versions of a formula]' \
|
||||||
'1: :->forms' && return 0
|
'1: :->forms' && return 0
|
||||||
|
|
||||||
if [[ "$state" == forms ]]; then
|
if [[ "$state" == forms ]]; then
|
||||||
_brew_installed_formulae
|
_brew_installed_formulae
|
||||||
_requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
||||||
fi ;;
|
fi ;;
|
||||||
install|home|log|info|uses|cat|deps)
|
install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
|
||||||
_brew_all_formulae
|
_brew_all_formulae
|
||||||
_wanted formulae expl 'all formulae' compadd -a formulae ;;
|
_wanted formulae expl 'all formulae' compadd -a formulae ;;
|
||||||
remove|edit|xo)
|
remove|rm|uninstall|unlink|cleanup|link|ln)
|
||||||
_brew_installed_formulae
|
_brew_installed_formulae
|
||||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
|
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
# VERSION: 1.0.0
|
# VERSION: 1.0.0
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
if (( ${+commands[compleat]} )); then
|
if (( ${+commands[compleat]} )); then
|
||||||
local prefix="${commands[compleat]:h:h}"
|
local prefix="${commands[compleat]:h:h}"
|
||||||
local setup="${prefix}/share/compleat-1.0/compleat_setup"
|
local setup="${prefix}/share/compleat-1.0/compleat_setup"
|
||||||
|
|
@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then
|
||||||
source "$setup"
|
source "$setup"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ _git-archive () {
|
||||||
'--format=-[format of the resulting archive]:archive format:__git_archive_formats' \
|
'--format=-[format of the resulting archive]:archive format:__git_archive_formats' \
|
||||||
'(- :)'{-l,--list}'[list available archive formats]' \
|
'(- :)'{-l,--list}'[list available archive formats]' \
|
||||||
'(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \
|
'(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \
|
||||||
'--prefix=-[prepend the given path prefix to to each filename]:path prefix:_directories -r ""' \
|
'--prefix=-[prepend the given path prefix to each filename]:path prefix:_directories -r ""' \
|
||||||
'--output=[write archive to argument instead of stdout]:archive:_files' \
|
'--output=[write archive to argument instead of stdout]:archive:_files' \
|
||||||
'--worktree-attributes[look for attributes in .gitattributes in working directory too]' \
|
'--worktree-attributes[look for attributes in .gitattributes in working directory too]' \
|
||||||
$backend_args \
|
$backend_args \
|
||||||
|
|
@ -258,16 +258,22 @@ _git-branch () {
|
||||||
d='-d -D'
|
d='-d -D'
|
||||||
|
|
||||||
declare -a dependent_creation_args
|
declare -a dependent_creation_args
|
||||||
|
if (( words[(I)-r] == 0 )); then
|
||||||
dependent_creation_args=(
|
dependent_creation_args=(
|
||||||
"($l $m $d): :__git_branch_names"
|
"($l $m $d): :__git_branch_names"
|
||||||
"::start-point:__git_revisions")
|
"::start-point:__git_revisions")
|
||||||
|
fi
|
||||||
|
|
||||||
declare -a dependent_deletion_args
|
declare -a dependent_deletion_args
|
||||||
if (( words[(I)-d] || words[(I)-D] )); then
|
if (( words[(I)-d] || words[(I)-D] )); then
|
||||||
dependent_creation_args=
|
dependent_creation_args=
|
||||||
dependent_deletion_args=(
|
dependent_deletion_args=(
|
||||||
'-r[delete remote-tracking branches]'
|
'-r[delete only remote-tracking branches]')
|
||||||
'*: :__git_ignore_line_inside_arguments __git_branch_names')
|
if (( words[(I)-r] )); then
|
||||||
|
dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names'
|
||||||
|
else
|
||||||
|
dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -a dependent_modification_args
|
declare -a dependent_modification_args
|
||||||
|
|
@ -281,7 +287,7 @@ _git-branch () {
|
||||||
_arguments -w -S -s \
|
_arguments -w -S -s \
|
||||||
"($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \
|
"($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \
|
||||||
"($c $m $d : --color)--no-color[turn off branch coloring]" \
|
"($c $m $d : --color)--no-color[turn off branch coloring]" \
|
||||||
"($c $m $d : -a)-r[list only the remote-tracking branches]" \
|
"($c $m -a)-r[list or delete only remote-tracking branches]" \
|
||||||
"($c $m $d : -r)-a[list both remote-tracking branches and local branches]" \
|
"($c $m $d : -r)-a[list both remote-tracking branches and local branches]" \
|
||||||
"($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \
|
"($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \
|
||||||
"($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \
|
"($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \
|
||||||
|
|
@ -2941,7 +2947,7 @@ _git-rev-parse () {
|
||||||
else
|
else
|
||||||
# TODO: Parse option specification?
|
# TODO: Parse option specification?
|
||||||
_arguments -w -S -s \
|
_arguments -w -S -s \
|
||||||
'(- *)'{-h,--help}'[display usage]'
|
'(- *)'{-h,--help}'[display usage]' \
|
||||||
'--keep-dashdash[do not skip first -- option]' \
|
'--keep-dashdash[do not skip first -- option]' \
|
||||||
'--stop-at-non-option[stop parsing options at first non-option argument]' \
|
'--stop-at-non-option[stop parsing options at first non-option argument]' \
|
||||||
'*:option specification' && ret=0
|
'*:option specification' && ret=0
|
||||||
|
|
@ -3958,7 +3964,7 @@ _git-name-rev () {
|
||||||
'--refs=[only use refs matching given pattern]: :_guard "?#" "shell pattern"' \
|
'--refs=[only use refs matching given pattern]: :_guard "?#" "shell pattern"' \
|
||||||
'(--stdin :)--all[list all commits reachable from all refs]' \
|
'(--stdin :)--all[list all commits reachable from all refs]' \
|
||||||
'(--all :)--stdin[read from stdin and append revision-name]' \
|
'(--all :)--stdin[read from stdin and append revision-name]' \
|
||||||
'--name-only[display only name of commits]'
|
'--name-only[display only name of commits]' \
|
||||||
'--no-undefined[die with non-zero return when a reference is undefined]' \
|
'--no-undefined[die with non-zero return when a reference is undefined]' \
|
||||||
'--always[show uniquely abbreviated commit object as fallback]' \
|
'--always[show uniquely abbreviated commit object as fallback]' \
|
||||||
'(--stdin --all)*: :__git_commits' && ret=0
|
'(--stdin --all)*: :__git_commits' && ret=0
|
||||||
|
|
@ -4919,7 +4925,7 @@ __git_remote_branch_names () {
|
||||||
local expl
|
local expl
|
||||||
declare -a branch_names
|
declare -a branch_names
|
||||||
|
|
||||||
branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='%(refname)' refs/remotes 2>/dev/null)"}#refs/remotes/})
|
branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/})
|
||||||
__git_command_successful $pipestatus || return
|
__git_command_successful $pipestatus || return
|
||||||
|
|
||||||
_wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names
|
_wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names
|
||||||
|
|
@ -5162,7 +5168,7 @@ __git_files_relative () {
|
||||||
|
|
||||||
files=()
|
files=()
|
||||||
|
|
||||||
# Collapse "//" and "/./" into "/". Strip any remaining "/." and "/".
|
# Collapse “//” and “/./” into “/”. Strip any remaining “/.” and “/”.
|
||||||
for file in ${${${${${(0)1}//\/\///}//\/.\///}%/.}%/}; do
|
for file in ${${${${${(0)1}//\/\///}//\/.\///}%/.}%/}; do
|
||||||
integer i n
|
integer i n
|
||||||
(( n = $#file > $#prefix ? $#file : $#prefix ))
|
(( n = $#file > $#prefix ? $#file : $#prefix ))
|
||||||
|
|
@ -5413,6 +5419,10 @@ __git_guard_diff-stat-width () {
|
||||||
|
|
||||||
(( $+functions[__git_guard_number] )) ||
|
(( $+functions[__git_guard_number] )) ||
|
||||||
__git_guard_number () {
|
__git_guard_number () {
|
||||||
|
declare -A opts
|
||||||
|
|
||||||
|
zparseopts -K -D -A opts M: J: V: 1 2 n F: X:
|
||||||
|
|
||||||
_guard "[[:digit:]]#" ${1:-number}
|
_guard "[[:digit:]]#" ${1:-number}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Aliases
|
# Aliases
|
||||||
alias g='git' ; compdef g=git
|
# alias g='git' ; compdef g=git
|
||||||
alias ga='git add' ; compdef _git ga=git-add
|
alias ga='git add' ; compdef _git ga=git-add
|
||||||
alias gaa='git add --all' ; compdef _git gaa=git-add
|
alias gaa='git add --all' ; compdef _git gaa=git-add
|
||||||
alias gs='git status' ; compdef _git gs=git-status
|
alias gs='git status' ; compdef _git gs=git-status
|
||||||
|
|
@ -25,6 +25,7 @@ alias gcount='git shortlog -sn' ; compdef gcount=git
|
||||||
alias gcp='git cherry-pick' ; compdef _git gcp=git-cherry-pick
|
alias gcp='git cherry-pick' ; compdef _git gcp=git-cherry-pick
|
||||||
alias gm='git merge' ; compdef _git gm=git-merge
|
alias gm='git merge' ; compdef _git gm=git-merge
|
||||||
alias glg='git log --stat --max-count=5'; compdef _git glg=git-log
|
alias glg='git log --stat --max-count=5'; compdef _git glg=git-log
|
||||||
|
alias gls='git shortlog' ; compdef _git gls=shortlog
|
||||||
|
|
||||||
# Git history (pretty)
|
# Git history (pretty)
|
||||||
local pretty_format_oneline='--pretty=format:"%C(yellow)%h %C(green)%cd %C(cyan)%an %C(bold cyan)%d%C(reset) %s" --date=short'
|
local pretty_format_oneline='--pretty=format:"%C(yellow)%h %C(green)%cd %C(cyan)%an %C(bold cyan)%d%C(reset) %s" --date=short'
|
||||||
|
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
# Renders the name of the current branch.
|
|
||||||
function git_prompt_info() {
|
|
||||||
local branch=$(git_current_branch)
|
|
||||||
if [[ -n "$branch" ]]; then
|
|
||||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Gets the current branch.
|
|
||||||
function git_current_branch() {
|
|
||||||
local ref=$(git symbolic-ref HEAD 2> /dev/null)
|
|
||||||
if [[ -n "$ref" ]]; then
|
|
||||||
echo "${ref#refs/heads/}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if the working tree is dirty.
|
|
||||||
function parse_git_dirty() {
|
|
||||||
if [[ -n $(git status -s 2> /dev/null) ]]; then
|
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
|
||||||
else
|
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if there are commits ahead from remote.
|
|
||||||
function git_prompt_ahead() {
|
|
||||||
if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Formats the prompt string for current git commit short SHA.
|
|
||||||
function git_prompt_short_sha() {
|
|
||||||
local sha=$(git rev-parse --short HEAD 2> /dev/null)
|
|
||||||
if [[ -n "$sha" ]]; then
|
|
||||||
echo "${ZSH_THEME_GIT_PROMPT_SHA_BEFORE}${sha}${ZSH_THEME_GIT_PROMPT_SHA_AFTER}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Formats the prompt string for current git commit long SHA.
|
|
||||||
function git_prompt_long_sha() {
|
|
||||||
local sha=$(git rev-parse HEAD 2> /dev/null)
|
|
||||||
if [[ -n "$sha" ]]; then
|
|
||||||
echo "${ZSH_THEME_GIT_PROMPT_SHA_BEFORE}${sha}${ZSH_THEME_GIT_PROMPT_SHA_AFTER}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Gets the status of the working tree.
|
|
||||||
function git_prompt_status() {
|
|
||||||
local indicators line untracked added modified renamed deleted
|
|
||||||
while IFS=$'\n' read line; do
|
|
||||||
if [[ "$line" =~ '^\?\? ' ]]; then
|
|
||||||
[[ -n $untracked ]] && continue || untracked='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_UNTRACKED}${indicators}"
|
|
||||||
fi
|
|
||||||
if [[ "$line" =~ '^(((A|M|D|T) )|(AD|AM|AT|MM)) ' ]]; then
|
|
||||||
[[ -n $added ]] && continue || added='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_ADDED}${indicators}"
|
|
||||||
fi
|
|
||||||
if [[ "$line" =~ '^(( (M|T))|(AM|AT|MM)) ' ]]; then
|
|
||||||
[[ -n $modified ]] && continue || modified='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_MODIFIED}${indicators}"
|
|
||||||
fi
|
|
||||||
if [[ "$line" =~ '^R ' ]]; then
|
|
||||||
[[ -n $renamed ]] && continue || renamed='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_RENAMED}${indicators}"
|
|
||||||
fi
|
|
||||||
if [[ "$line" =~ '^( D|AD) ' ]]; then
|
|
||||||
[[ -n $deleted ]] && continue || deleted='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_DELETED}${indicators}"
|
|
||||||
fi
|
|
||||||
if [[ "$line" =~ '^UU ' ]]; then
|
|
||||||
[[ -n $unmerged ]] && continue || unmerged='yes'
|
|
||||||
indicators="${ZSH_THEME_GIT_PROMPT_UNMERGED}${indicators}"
|
|
||||||
fi
|
|
||||||
done < <(git status --porcelain 2> /dev/null)
|
|
||||||
echo $indicators
|
|
||||||
}
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
# FILE: git-prompt.plugin.zsh
|
# FILE: git-prompt.plugin.zsh
|
||||||
# DESCRIPTION: oh-my-zsh git information for your PROMPT.
|
# DESCRIPTION: oh-my-zsh git information for your PROMPT.
|
||||||
# AUTHOR: Ashley Dev (the.ashley.dev+git-prompt@gmail.com)
|
# AUTHOR: Ashley Dev (the.ashley.dev+git-prompt@gmail.com)
|
||||||
# VERSION: 2.1
|
# VERSION: 3.0
|
||||||
# SCREENSHOT:
|
# SCREENSHOT: http://i.imgur.com/Yw1KG.png
|
||||||
|
# http://i.imgur.com/wx6MU.png
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# USAGE:
|
# USAGE:
|
||||||
|
|
@ -11,174 +12,205 @@
|
||||||
# Add 'git' to your list of oh-my-zsh plugins (in your .zshrc) otherwise this
|
# Add 'git' to your list of oh-my-zsh plugins (in your .zshrc) otherwise this
|
||||||
# git prompt info will not show up in your prompt.
|
# git prompt info will not show up in your prompt.
|
||||||
#
|
#
|
||||||
# This example shows some of the things you can do with this plugin. This is
|
# This simple example shows some of the things you can do with this plugin.
|
||||||
# how the author uses it:
|
# (See the ashleydev theme for more complex usage.)
|
||||||
# ---------------------- SAMPLE THEME FILE ------------------------
|
# ---------------------- SAMPLE THEME FILE ------------------------
|
||||||
#
|
#
|
||||||
# # this is a simple example PROMPT with only git
|
# # this is a simple example PROMPT with only git
|
||||||
# # info from this plugin in it:
|
# # info from this plugin in it:
|
||||||
# PROMPT='$__GIT_PROMPT_INFO# '
|
# PROMPT='$GIT_PROMPT_INFO# '
|
||||||
#
|
#
|
||||||
# # Set GIT_PROMPT_SHORTCIRCUIT='off' to turn the
|
# # ...
|
||||||
# # short-circuit logic off. The short-circuit
|
# # If you want to override the default format you can define your own
|
||||||
# # logic will turn off the showing of dirty
|
# # git_prompt_info() function that sets $GIT_PROMPT_INFO (or other variables)
|
||||||
# # state in your git prompt if ctrl-c is pressed
|
# # with your format:
|
||||||
# # while the prompt is updating the dirty state
|
# git_prompt_info ()
|
||||||
# # info. Gathering dirty-state info can take a
|
|
||||||
# # long time on large repositories, so if you
|
|
||||||
# # find that your prompt is taking for ever to
|
|
||||||
# # return, and you press ctrl-c, the short-
|
|
||||||
# # circuit logic will turn off the showing of
|
|
||||||
# # dirty state for this repository (locally) and
|
|
||||||
# # let you know, that way you won't be slowed
|
|
||||||
# # down waiting for your prompt in large git
|
|
||||||
# # repositories.
|
|
||||||
# #GIT_PROMPT_SHORTCIRCUIT='off'
|
|
||||||
#
|
|
||||||
# GIT_PROMPT_SHOWUPSTREAM="verbose"
|
|
||||||
# #GIT_PROMPT_SHOWREBASEINFO='off'
|
|
||||||
# #GIT_PROMPT_SHOWBRANCH='off'
|
|
||||||
# #GIT_PROMPT_SHOWSTASHSTATE='off'
|
|
||||||
# #GIT_PROMPT_SHORTCIRCUIT='off'
|
|
||||||
# #GIT_PROMPT_SHOWDIRTYSTATE='off'
|
|
||||||
#
|
|
||||||
# # Some color settings for my prompt format
|
|
||||||
# # '_C' for color:
|
|
||||||
# if [[ "$DISABLE_COLOR" != "true" ]]; then
|
|
||||||
# local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
|
|
||||||
# local _Cb_new_repo_="%{$fg_bold[default]%}" # branch color of new repo
|
|
||||||
# local _Cb_clean_="%{$fg_no_bold[green]%}" # branch color when clean
|
|
||||||
# local _Cb_dirty_="%{$fg_no_bold[red]%}" # branch color when dirty
|
|
||||||
# local _Cr_="%{$bold_color$fg[yellow]%}" # rebase info
|
|
||||||
# local _Ci_="%{$bold_color$fg[red]%}" # index info
|
|
||||||
# local _Cu_clean_="" # untracked files state when clean
|
|
||||||
# local _Cu_dirty_="%{$fg_bold[red]%}" # untracked files state when dirty
|
|
||||||
# local _Cp_="%{${fg[cyan]}%}" # upstream info
|
|
||||||
# local _Cs_="" # stash state
|
|
||||||
# # 'R'eset formating
|
|
||||||
# local R="%{$terminfo[sgr0]%}"
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# # GIT_PROMPT_INFO_FUNC must be set to the
|
|
||||||
# # function that defines your prompt info
|
|
||||||
# # in order to turn this plugin on.
|
|
||||||
# # $GIT_PROMPT_INFO_FUNC to be called when the
|
|
||||||
# # git prompt info variable needs to be updated.
|
|
||||||
# GIT_PROMPT_INFO_FUNC='update__GIT_PROMPT_INFO'
|
|
||||||
#
|
|
||||||
# # update__GIT_PROMPT_INFO creates the format and
|
|
||||||
# # content of the git prompt info and puts the
|
|
||||||
# # result in $__GIT_PROMPT_INFO. Which you can
|
|
||||||
# # use in your $PROMPT (see above). This is an
|
|
||||||
# # example of some of the ways you can set up
|
|
||||||
# # your prompt with this plugin.
|
|
||||||
# #
|
|
||||||
# # NOTE: This function must set a global variable
|
|
||||||
# # (with the your git prompt format) that you
|
|
||||||
# # include in your PROMPT string.
|
|
||||||
# # It cannot echo this info as in:
|
|
||||||
# # PROMPT="$(update__GIT_PROMPT_INFO)"
|
|
||||||
# # or the short-circuit logic will not work.
|
|
||||||
# #
|
|
||||||
# local __GIT_PROMPT_INFO=''
|
|
||||||
# update__GIT_PROMPT_INFO ()
|
|
||||||
# {
|
# {
|
||||||
# local g="$(_git_promt__git_dir)"
|
# if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
# # short circuit if we're not in a git repo:
|
# GIT_PROMPT_INFO=''
|
||||||
# if [ -z "$g" ]; then
|
|
||||||
# __GIT_PROMPT_INFO=''
|
|
||||||
# return
|
# return
|
||||||
# fi
|
# fi
|
||||||
#
|
#
|
||||||
# _git_prompt__stash
|
# git_prompt__branch
|
||||||
# local s=$GIT_PROMPT_STASH_STATE_DIRTY
|
# local branch_=$GIT_PROMPT_BRANCH
|
||||||
#
|
#
|
||||||
# _git_prompt__upstream
|
# git_prompt__dirty_state
|
||||||
# local p=$GIT_PROMPT_UPSTREAM_STATE
|
# local work_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
|
||||||
|
# local index_=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
|
||||||
#
|
#
|
||||||
# _git_prompt__branch
|
# # Reset color
|
||||||
# local b=$GIT_PROMPT_BRANCH
|
# local R="%{$terminfo[sgr0]%}"
|
||||||
#
|
#
|
||||||
# _git_prompt__rebase_info
|
# if [[ "$index_" = "yes" ]]; then
|
||||||
# local r=$GIT_PROMPT_REBASE_INFO
|
# index_="%{$bold_color$fg[red]%}+$R"
|
||||||
#
|
|
||||||
# _git_prompt__dirty_state
|
|
||||||
# local w=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
|
|
||||||
# local i=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
|
|
||||||
# local u=$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED
|
|
||||||
# local f=$GIT_PROMPT_DIRTY_STATE_FRESH_REPO
|
|
||||||
#
|
|
||||||
# if [ -z "$b$i$w$u" ]; then
|
|
||||||
# if [ -n "$g" ]; then
|
|
||||||
# __GIT_PROMPT_INFO="$R$_Cerror_(Error: bad ./$g dir)$R"
|
|
||||||
# return
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# if [ "$s" = 'yes' ]; then
|
|
||||||
# s="$_Cs_\$$R"
|
|
||||||
# else
|
# else
|
||||||
# s=""
|
# index_=""
|
||||||
# fi
|
# fi
|
||||||
#
|
#
|
||||||
# if [ -n "$p" ]; then
|
# if [[ -n "$branch_" ]]; then
|
||||||
# p="$_Cp_$p$R"
|
# if [[ "$work_" = 'yes' ]]; then
|
||||||
# fi
|
# branch_="%{$fg_no_bold[red]%}$branch_$R"
|
||||||
#
|
# elif [[ "$work_" = 'no' ]]; then
|
||||||
# if [ "$i" = "yes" ]; then
|
# branch_="%{$fg_no_bold[green]%}$branch_$R"
|
||||||
# i="$_Ci_+$R"
|
|
||||||
# else
|
|
||||||
# i=""
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# if [ -n "$b" ]; then
|
|
||||||
# if [ "$f" = "yes" ]; then
|
|
||||||
# # this is a fresh repo, nothing here...
|
|
||||||
# b="$_Cb_new_repo_$b$R"
|
|
||||||
# elif [ "$w" = 'yes' ]; then
|
|
||||||
# b="$_Cb_dirty_$b$R"
|
|
||||||
# elif [ "$w" = 'no' ]; then
|
|
||||||
# b="$_Cb_clean_$b$R"
|
|
||||||
# fi
|
# fi
|
||||||
# fi
|
# fi
|
||||||
#
|
#
|
||||||
# if [ -n "$r" ]; then
|
# GIT_PROMPT_INFO="$R($branch_$index_)$R"
|
||||||
# r="$_Cr_$r$R"
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# local _prompt="$b$r$i$s$p"
|
|
||||||
# # add ( ) around _prompt:
|
|
||||||
# if [ "$u" = "yes" ]; then
|
|
||||||
# _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
|
||||||
# elif [ "$u" = "no" ]; then
|
|
||||||
# _prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
|
||||||
# else
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# __GIT_PROMPT_INFO="$R$_prompt$R"
|
|
||||||
# }
|
# }
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#------------------ Default Prompt Format ------------------
|
||||||
|
# You can override this by defining your own git_prompt_info in your theme that
|
||||||
|
# sets some global variable(s); i.e. $GIT_PROMPT_INFO.
|
||||||
|
# (See the ashleydev theme for more complex usage).
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
local branch=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
local dirty=$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY
|
||||||
|
|
||||||
|
local prompt=$branch
|
||||||
|
|
||||||
|
if [[ "$dirty" = 'yes' ]]; then
|
||||||
|
prompt="$prompt$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
|
elif [[ "$dirty" = 'no' ]]; then
|
||||||
|
prompt="$prompt$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="$ZSH_THEME_GIT_PROMPT_PREFIX$prompt$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
}
|
||||||
|
|
||||||
#------------------ git information utils ------------------
|
#------------------ git information utils ------------------
|
||||||
# For some of the following functions, I borrowed some from:
|
# For some of the following functions, I borrowed some from:
|
||||||
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
|
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
|
||||||
#
|
#
|
||||||
|
|
||||||
# _git_promt__git_dir accepts 0 or 1 arguments (i.e., location)
|
# sets a bunch of variables, see below:
|
||||||
|
git_prompt__dirty_state ()
|
||||||
|
{
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_FRESH_REPO=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED=''
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED=''
|
||||||
|
|
||||||
|
if [[ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local dir_="$(git_prompt__git_dir)"
|
||||||
|
if [[ -z "$dir_" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_SHOWDIRTYSTATE" = 'off' ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [[ "$(git config --bool prompt.showDirtyState)" = "false" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_FRESH_REPO='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='no'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='no'
|
||||||
|
|
||||||
|
if git rev-parse --quiet --verify HEAD >/dev/null; then
|
||||||
|
else
|
||||||
|
GIT_PROMPT_DIRTY_STATE_FRESH_REPO='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
|
_big_repo='yes'
|
||||||
|
local line
|
||||||
|
while IFS=$'\n' read line; do
|
||||||
|
if [[ "$line" = M* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = A* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = R* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = C* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = D* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$line" = \?\?* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = ?M* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
if [[ "$line" = ?D* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$line" = UU* ]]; then
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
|
GIT_PROMPT_DIRTY_STATE_ANY_DIRTY='yes'
|
||||||
|
fi
|
||||||
|
done < <(git status --porcelain 2> /dev/null)
|
||||||
|
_big_repo=''
|
||||||
|
}
|
||||||
|
|
||||||
|
# git_prompt__git_dir accepts 0 or 1 arguments (i.e., location)
|
||||||
# echos the location of .git repo.
|
# echos the location of .git repo.
|
||||||
# Useful for quickly figuring out if cwd is under a git repo.
|
# Useful for quickly figuring out if cwd is under a git repo.
|
||||||
_git_promt__git_dir ()
|
git_prompt__git_dir ()
|
||||||
{
|
{
|
||||||
if [ -z "${1-}" ]; then
|
if [[ -z "${1-}" ]]; then
|
||||||
if [ -d .git ]; then
|
if [[ -d .git ]]; then
|
||||||
echo .git
|
echo .git
|
||||||
else
|
else
|
||||||
git rev-parse --git-dir 2>/dev/null
|
git rev-parse --git-dir 2>/dev/null
|
||||||
fi
|
fi
|
||||||
elif [ -d "$1/.git" ]; then
|
elif [[ -d "$1/.git" ]]; then
|
||||||
echo "$1/.git"
|
echo "$1/.git"
|
||||||
else
|
else
|
||||||
echo "$1"
|
echo "$1"
|
||||||
|
|
@ -188,40 +220,42 @@ _git_promt__git_dir ()
|
||||||
# sets GIT_PROMPT_UPSTREAM_STATE
|
# sets GIT_PROMPT_UPSTREAM_STATE
|
||||||
#
|
#
|
||||||
# output format:
|
# output format:
|
||||||
# A "<" indicates you are behind, ">" indicates you are ahead, "<>"
|
# A "-1" indicates you are behind by one commit, "+3" indicates you are ahead by
|
||||||
# indicates you have diverged, "=" indicates no divergence, and "" indicates
|
# 3 commits, "-1+3" indicates you have diverged, "=" indicates no divergence,
|
||||||
# there is no upstream or this feature is turned 'off' (see below).
|
# and "" indicates there is no upstream or this feature is turned 'off' (see
|
||||||
|
# below).
|
||||||
#
|
#
|
||||||
# You can control behaviour by setting GIT_PROMPT_SHOWUPSTREAM to a
|
# You can control behaviour by setting GIT_PROMPT_SHOWUPSTREAM to a
|
||||||
# space-separated list of values:
|
# space-separated list of values:
|
||||||
# off no output
|
# off no output
|
||||||
# verbose show number of commits ahead/behind (+/-) upstream instead
|
# simple Instead of '+/-', a "<" indicates you are behind, ">"
|
||||||
# of using "<" and ">".
|
# indicates you are ahead, "<>" indicates you have diverged,
|
||||||
|
# "=" indicates no divergence.
|
||||||
# legacy don't use the '--count' option available in recent
|
# legacy don't use the '--count' option available in recent
|
||||||
# versions of git-rev-list
|
# versions of git-rev-list
|
||||||
# git always compare HEAD to @{upstream}
|
# git always compare HEAD to @{upstream}
|
||||||
# svn always compare HEAD to your SVN upstream
|
# svn always compare HEAD to your SVN upstream
|
||||||
# By default, _git_prompt__upstream will compare HEAD to your SVN upstream
|
# By default, git_prompt__upstream will compare HEAD to your SVN upstream
|
||||||
# if it can find one, or @{upstream} otherwise. Once you have
|
# if it can find one, or @{upstream} otherwise. Once you have
|
||||||
# set GIT_PROMPT_SHOWUPSTREAM, you can override it on a
|
# set GIT_PROMPT_SHOWUPSTREAM, you can override it on a
|
||||||
# per-repository basis by setting the prompt.showUpstream config
|
# per-repository basis by setting the prompt.showUpstream config
|
||||||
# variable (i.e. `git config prompt.showUpstream 'verbose legacy'`).
|
# variable (i.e. `git config prompt.showUpstream 'simple legacy'`).
|
||||||
#
|
#
|
||||||
# _git_prompt__upstream accepts 0 or 1 arguments. If an argument is given, it
|
# git_prompt__upstream accepts 0 or 1 arguments. If an argument is given, it
|
||||||
# must be a string of the form specified above for GIT_PROMPT_SHOWUPSTREAM.
|
# must be a string of the form specified above for GIT_PROMPT_SHOWUPSTREAM.
|
||||||
# Setting this argument will override any value set for GIT_PROMPT_SHOWUPSTREAM
|
# Setting this argument will override any value set for GIT_PROMPT_SHOWUPSTREAM
|
||||||
# or in the .git/config.
|
# or in the .git/config.
|
||||||
_git_prompt__upstream ()
|
git_prompt__upstream ()
|
||||||
{
|
{
|
||||||
GIT_PROMPT_UPSTREAM_STATE=''
|
GIT_PROMPT_UPSTREAM_STATE=''
|
||||||
|
|
||||||
if [ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
|
if [[ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local key value
|
local key value
|
||||||
local svn_remote svn_url_pattern count n
|
local svn_remote svn_url_pattern count n
|
||||||
local upstream=git legacy="" verbose=""
|
local upstream=git legacy="" simple=""
|
||||||
local p
|
local p
|
||||||
|
|
||||||
# get some config options from git-config
|
# get some config options from git-config
|
||||||
|
|
@ -238,7 +272,7 @@ _git_prompt__upstream ()
|
||||||
esac
|
esac
|
||||||
done < <(git config --get-regexp '^(svn-remote\..*\.url|prompt\.showupstream)' 2>/dev/null)
|
done < <(git config --get-regexp '^(svn-remote\..*\.url|prompt\.showupstream)' 2>/dev/null)
|
||||||
|
|
||||||
if [ -n "${1-}" ]; then
|
if [[ -n "${1-}" ]]; then
|
||||||
GIT_PROMPT_SHOWUPSTREAM=$1
|
GIT_PROMPT_SHOWUPSTREAM=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -247,7 +281,7 @@ _git_prompt__upstream ()
|
||||||
case "$option" in
|
case "$option" in
|
||||||
off) return ;;
|
off) return ;;
|
||||||
git|svn) upstream="$option" ;;
|
git|svn) upstream="$option" ;;
|
||||||
verbose) verbose=1 ;;
|
simple) simple=1 ;;
|
||||||
legacy) legacy=1 ;;
|
legacy) legacy=1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
@ -282,7 +316,7 @@ _git_prompt__upstream ()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# calculate the result
|
# calculate the result
|
||||||
if [[ -z "$verbose" ]]; then
|
if [[ -n "$simple" ]]; then
|
||||||
case "$count" in
|
case "$count" in
|
||||||
"") # no upstream
|
"") # no upstream
|
||||||
p="" ;;
|
p="" ;;
|
||||||
|
|
@ -313,76 +347,80 @@ _git_prompt__upstream ()
|
||||||
GIT_PROMPT_UPSTREAM_STATE=$p
|
GIT_PROMPT_UPSTREAM_STATE=$p
|
||||||
}
|
}
|
||||||
|
|
||||||
_git_prompt__rebase_info ()
|
# sets GIT_PROMPT_REBASE_INFO
|
||||||
|
# with info about a rebase/merge/etc if it's in progress.
|
||||||
|
git_prompt__rebase_info ()
|
||||||
{
|
{
|
||||||
GIT_PROMPT_REBASE_INFO=''
|
GIT_PROMPT_REBASE_INFO=''
|
||||||
|
|
||||||
if [ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
|
if [[ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "$GIT_PROMPT_SHOWREBASEINFO" = 'off' ]; then
|
if [[ "$GIT_PROMPT_SHOWREBASEINFO" = 'off' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "$(git config --bool prompt.showRebaseInfo)" = "false" ]; then
|
if [[ "$(git config --bool prompt.showRebaseInfo)" = "false" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local r=""
|
local rebase_=""
|
||||||
local g="$(_git_promt__git_dir)"
|
local dir_="$(git_prompt__git_dir)"
|
||||||
if [ -n "$g" ]; then
|
if [[ -n "$dir_" ]]; then
|
||||||
if [ -f "$g/rebase-merge/interactive" ]; then
|
if [[ -f "$dir_/rebase-merge/interactive" ]]; then
|
||||||
r="|REBASE-i"
|
rebase_="|REBASE-i"
|
||||||
elif [ -d "$g/rebase-merge" ]; then
|
elif [[ -d "$dir_/rebase-merge" ]]; then
|
||||||
r="|REBASE-m"
|
rebase_="|REBASE-m"
|
||||||
else
|
else
|
||||||
if [ -d "$g/rebase-apply" ]; then
|
if [[ -d "$dir_/rebase-apply" ]]; then
|
||||||
if [ -f "$g/rebase-apply/rebasing" ]; then
|
if [[ -f "$dir_/rebase-apply/rebasing" ]]; then
|
||||||
r="|REBASE"
|
rebase_="|REBASE"
|
||||||
elif [ -f "$g/rebase-apply/applying" ]; then
|
elif [[ -f "$dir_/rebase-apply/applying" ]]; then
|
||||||
r="|AM"
|
rebase_="|AM"
|
||||||
else
|
else
|
||||||
r="|AM/REBASE"
|
rebase_="|AM/REBASE"
|
||||||
fi
|
fi
|
||||||
elif [ -f "$g/MERGE_HEAD" ]; then
|
elif [[ -f "$dir_/MERGE_HEAD" ]]; then
|
||||||
r="|MERGING"
|
rebase_="|MERGING"
|
||||||
elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
|
elif [[ -f "$dir_/CHERRY_PICK_HEAD" ]]; then
|
||||||
r="|CHERRY-PICKING"
|
rebase_="|CHERRY-PICKING"
|
||||||
elif [ -f "$g/BISECT_LOG" ]; then
|
elif [[ -f "$dir_/BISECT_LOG" ]]; then
|
||||||
r="|BISECTING"
|
rebase_="|BISECTING"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GIT_PROMPT_REBASE_INFO=$r
|
GIT_PROMPT_REBASE_INFO=$rebase_
|
||||||
}
|
}
|
||||||
|
|
||||||
_git_prompt__branch ()
|
# sets GIT_PROMPT_BRANCH
|
||||||
|
# with the branch name
|
||||||
|
git_prompt__branch ()
|
||||||
{
|
{
|
||||||
GIT_PROMPT_BRANCH=''
|
GIT_PROMPT_BRANCH=''
|
||||||
|
|
||||||
if [ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
|
if [[ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$GIT_PROMPT_SHOWBRANCH" = 'off' ]; then
|
if [[ "$GIT_PROMPT_SHOWBRANCH" = 'off' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "$(git config --bool prompt.showBranch)" = "false" ]; then
|
if [[ "$(git config --bool prompt.showBranch)" = "false" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local b=""
|
local branch_=""
|
||||||
local g="$(_git_promt__git_dir)"
|
local dir_="$(git_prompt__git_dir)"
|
||||||
if [ -n "$g" ]; then
|
if [[ -n "$dir_" ]]; then
|
||||||
if [ -f "$g/rebase-merge/interactive" ]; then
|
if [[ -f "$dir_/rebase-merge/interactive" ]]; then
|
||||||
b="$(cat "$g/rebase-merge/head-name")"
|
branch_="$(cat "$dir_/rebase-merge/head-name")"
|
||||||
elif [ -d "$g/rebase-merge" ]; then
|
elif [[ -d "$dir_/rebase-merge" ]]; then
|
||||||
b="$(cat "$g/rebase-merge/head-name")"
|
branch_="$(cat "$dir_/rebase-merge/head-name")"
|
||||||
else
|
else
|
||||||
b="$(git symbolic-ref HEAD 2>/dev/null)" || {
|
branch_="$(git symbolic-ref HEAD 2>/dev/null)" || {
|
||||||
|
|
||||||
b="$(
|
branch_="$(
|
||||||
case "${GIT_PROMPT_DESCRIBE_STYLE-}" in
|
case "${GIT_PROMPT_DESCRIBE_STYLE-}" in
|
||||||
(contains)
|
(contains)
|
||||||
git describe --contains HEAD ;;
|
git describe --contains HEAD ;;
|
||||||
|
|
@ -394,36 +432,38 @@ _git_prompt__branch ()
|
||||||
git describe --tags --exact-match HEAD ;;
|
git describe --tags --exact-match HEAD ;;
|
||||||
esac 2>/dev/null)" ||
|
esac 2>/dev/null)" ||
|
||||||
|
|
||||||
b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)" ||
|
branch_="$(cut -c1-7 "$dir_/HEAD" 2>/dev/null)" ||
|
||||||
b="$b"
|
branch_="$branch_"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
b=${b##refs/heads/}
|
branch_=${branch_##refs/heads/}
|
||||||
if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
|
if [[ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]]; then
|
||||||
if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
|
if [[ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]]; then
|
||||||
b="BARE:$b"
|
branch_="BARE:$branch_"
|
||||||
else
|
else
|
||||||
b="GIT_DIR!"
|
branch_="GIT_DIR!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GIT_PROMPT_BRANCH=$b
|
GIT_PROMPT_BRANCH=$branch_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_git_prompt__stash ()
|
# sets GIT_PROMPT_STASH_STATE_DIRTY
|
||||||
|
# if the git stash state is dirty
|
||||||
|
git_prompt__stash ()
|
||||||
{
|
{
|
||||||
GIT_PROMPT_STASH_STATE_DIRTY=''
|
GIT_PROMPT_STASH_STATE_DIRTY=''
|
||||||
|
|
||||||
if [ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
|
if [[ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$GIT_PROMPT_SHOWSTASHSTATE" = 'off' ]; then
|
if [[ "$GIT_PROMPT_SHOWSTASHSTATE" = 'off' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "$(git config --bool prompt.showStashState)" = "false" ]; then
|
if [[ "$(git config --bool prompt.showStashState)" = "false" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -434,126 +474,6 @@ _git_prompt__stash ()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# This is the short-circuit logic:
|
|
||||||
local _big_repo='init'
|
|
||||||
__git_prompt_shortcircuit ()
|
|
||||||
{
|
|
||||||
if [[ "$_big_repo" == 'yes' ]]; then
|
|
||||||
_big_repo=''
|
|
||||||
if [ "$GIT_PROMPT_SHORTCIRCUIT" != 'off' ]; then
|
|
||||||
echo "$fg[red]" > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: Looks like you hit ctrl-c." > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: So for this repo I'm setting:" > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: git config prompt.showDirtyState false" > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: On big git repos it takes a long time to get info for your prompt." > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: To revert it, run:" > /dev/stderr
|
|
||||||
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]:$reset_color git config prompt.showDirtyState true" > /dev/stderr
|
|
||||||
echo '' > /dev/stderr
|
|
||||||
|
|
||||||
git config prompt.showDirtyState 'false'
|
|
||||||
$GIT_PROMPT_INFO_FUNC
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
TRAPINT ()
|
|
||||||
{
|
|
||||||
__git_prompt_shortcircuit
|
|
||||||
return $(( 128 + $1 ))
|
|
||||||
}
|
|
||||||
|
|
||||||
_git_prompt__dirty_state ()
|
|
||||||
{
|
|
||||||
GIT_PROMPT_DIRTY_STATE_FRESH_REPO=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED=''
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED=''
|
|
||||||
|
|
||||||
if [ "true" != "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
local g="$(_git_promt__git_dir)"
|
|
||||||
if [ -z "$g" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [ "$GIT_PROMPT_SHOWDIRTYSTATE" = 'off' ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [ "$(git config --bool prompt.showDirtyState)" = "false" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
GIT_PROMPT_DIRTY_STATE_FRESH_REPO='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='no'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='no'
|
|
||||||
|
|
||||||
if git rev-parse --quiet --verify HEAD >/dev/null; then
|
|
||||||
else
|
|
||||||
GIT_PROMPT_DIRTY_STATE_FRESH_REPO='yes'
|
|
||||||
fi
|
|
||||||
|
|
||||||
_big_repo='yes'
|
|
||||||
local line
|
|
||||||
while IFS=$'\n' read line; do
|
|
||||||
if [[ "$line" = M* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = A* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = R* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = C* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = D* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$line" = \?\?* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = ?M* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
if [[ "$line" = ?D* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$line" = UU* ]]; then
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes'
|
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
|
||||||
fi
|
|
||||||
done < <(git status --porcelain 2> /dev/null)
|
|
||||||
_big_repo=''
|
|
||||||
}
|
|
||||||
|
|
||||||
#------------------ Fast Prompt ------------------
|
#------------------ Fast Prompt ------------------
|
||||||
# This section sets up some functions that get called infrequently as possible
|
# This section sets up some functions that get called infrequently as possible
|
||||||
# and therefore don't slow your prompt down as you are using zsh.
|
# and therefore don't slow your prompt down as you are using zsh.
|
||||||
|
|
@ -573,30 +493,74 @@ chpwd_functions+="_git_prompt_info"
|
||||||
PERIOD=15
|
PERIOD=15
|
||||||
periodic_functions+="_git_prompt_info"
|
periodic_functions+="_git_prompt_info"
|
||||||
|
|
||||||
_git_prompt_info () { $GIT_PROMPT_INFO_FUNC }
|
_git_prompt_info ()
|
||||||
_git_prompt_info
|
{
|
||||||
|
if [[ -z $GIT_PROMPT_INFO_DISABLED ]]; then
|
||||||
|
git_prompt_info
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
_git_prompt__precmd_update_git_vars()
|
_git_prompt__precmd_update_git_vars()
|
||||||
{
|
{
|
||||||
if [[ $ZSH_VERSION = *\ 4.2* ]]; then
|
if [[ $ZSH_VERSION = *\ 4.2* ]]; then
|
||||||
# some older versions of zsh don't have periodic_functions, so do the
|
# some older versions of zsh don't have periodic_functions, so do the
|
||||||
# slow path if that's the case:
|
# slow path if that's the case:
|
||||||
$GIT_PROMPT_INFO_FUNC
|
_git_prompt_info
|
||||||
|
|
||||||
elif [ -n "$__EXECUTED_GIT_COMMAND" ]; then
|
elif [[ -n "$__EXECUTED_GIT_COMMAND" ]]; then
|
||||||
$GIT_PROMPT_INFO_FUNC
|
_git_prompt_info
|
||||||
unset __EXECUTED_GIT_COMMAND
|
unset __EXECUTED_GIT_COMMAND
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
_git_prompt__preexec_update_git_vars ()
|
_git_prompt__preexec_update_git_vars ()
|
||||||
{
|
{
|
||||||
case "$1" in
|
case "$1" in
|
||||||
$EDITOR*) __EXECUTED_GIT_COMMAND=1 ;;
|
|
||||||
g*) __EXECUTED_GIT_COMMAND=1 ;;
|
g*) __EXECUTED_GIT_COMMAND=1 ;;
|
||||||
rm*) __EXECUTED_GIT_COMMAND=1 ;;
|
rm*) __EXECUTED_GIT_COMMAND=1 ;;
|
||||||
touch*) __EXECUTED_GIT_COMMAND=1 ;;
|
touch*) __EXECUTED_GIT_COMMAND=1 ;;
|
||||||
mkdir*) __EXECUTED_GIT_COMMAND=1 ;;
|
mkdir*) __EXECUTED_GIT_COMMAND=1 ;;
|
||||||
|
echo*) __EXECUTED_GIT_COMMAND=1 ;;
|
||||||
|
$EDITOR*)
|
||||||
|
if [[ -n "$EDITOR" ]]; then
|
||||||
|
__EXECUTED_GIT_COMMAND=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
#--------------------------------------------------
|
#------------------ Short Circuit ------------------
|
||||||
|
# This is the short-circuit logic:
|
||||||
|
#
|
||||||
|
# Set GIT_PROMPT_SHORTCIRCUIT='off' to turn the short-circuit logic off.
|
||||||
|
#
|
||||||
|
# Gathering dirty-state info can take a long time on large repositories. The
|
||||||
|
# short-circuit logic is engaged by pressing ctrl-c while the prompt is trying
|
||||||
|
# to gather information about a large repository. When this happens the
|
||||||
|
# short-circuit logic will display a warning and turn off the showing of dirty
|
||||||
|
# state in your git prompt (for the local repo only).
|
||||||
|
local _big_repo='init'
|
||||||
|
__git_prompt_shortcircuit ()
|
||||||
|
{
|
||||||
|
if [[ "$_big_repo" == 'yes' ]]; then
|
||||||
|
_big_repo=''
|
||||||
|
if [[ "$GIT_PROMPT_SHORTCIRCUIT" != 'off' ]]; then
|
||||||
|
echo "$fg[red]" > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: Looks like you hit ctrl-c." > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: So for this repo I'm setting:" > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: git config prompt.showDirtyState false" > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: On big git repos it takes a long time to get info for your prompt." > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]: To revert it, run:" > /dev/stderr
|
||||||
|
echo "${bold_color}SHELL PROMPT$fg_no_bold[red]:$reset_color git config prompt.showDirtyState true" > /dev/stderr
|
||||||
|
echo '' > /dev/stderr
|
||||||
|
|
||||||
|
git config prompt.showDirtyState 'false'
|
||||||
|
_git_prompt_info
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
TRAPINT ()
|
||||||
|
{
|
||||||
|
__git_prompt_shortcircuit
|
||||||
|
return $(( 128 + $1 ))
|
||||||
|
}
|
||||||
|
#----------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
source $ZSH/plugins/git/git-aliases.plugin.zsh
|
source $ZSH/plugins/git/git-aliases.plugin.zsh
|
||||||
source $ZSH/plugins/git/git-prompt-old.plugin.zsh
|
|
||||||
source $ZSH/plugins/git/git-prompt.plugin.zsh
|
source $ZSH/plugins/git/git-prompt.plugin.zsh
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then
|
||||||
# eval `hub alias -s zsh`
|
# eval `hub alias -s zsh`
|
||||||
function git(){hub "$@"}
|
function git(){hub "$@"}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
26
plugins/gpg-agent/gpg-agent.plugin.zsh
Normal file
26
plugins/gpg-agent/gpg-agent.plugin.zsh
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Based on ssh-agent code
|
||||||
|
|
||||||
|
local GPG_ENV=$HOME/.gnupg/gpg-agent.env
|
||||||
|
|
||||||
|
function start_agent {
|
||||||
|
/usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null
|
||||||
|
chmod 600 ${GPG_ENV}
|
||||||
|
. ${GPG_ENV} > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Source GPG agent settings, if applicable
|
||||||
|
if [ -f "${GPG_ENV}" ]; then
|
||||||
|
. ${GPG_ENV} > /dev/null
|
||||||
|
ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || {
|
||||||
|
start_agent;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
start_agent;
|
||||||
|
fi
|
||||||
|
|
||||||
|
export GPG_AGENT_INFO
|
||||||
|
export SSH_AUTH_SOCK
|
||||||
|
export SSH_AGENT_PID
|
||||||
|
|
||||||
|
GPG_TTY=$(tty)
|
||||||
|
export GPG_TTY
|
||||||
5
plugins/node/node.plugin.zsh
Normal file
5
plugins/node/node.plugin.zsh
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Open the node api for your current version to the optional section.
|
||||||
|
# TODO: Make the section part easier to use.
|
||||||
|
function node-docs {
|
||||||
|
open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () {
|
||||||
_phing () {
|
_phing () {
|
||||||
if [ -f build.xml ]; then
|
if [ -f build.xml ]; then
|
||||||
if _phing_does_target_list_need_generating; then
|
if _phing_does_target_list_need_generating; then
|
||||||
echo "\nGenerating .phing_targets..." > /dev/stderr
|
|
||||||
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
|
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
|
||||||
fi
|
fi
|
||||||
compadd `cat .phing_targets`
|
compadd `cat .phing_targets`
|
||||||
|
|
|
||||||
10
plugins/pow/pow.plugin.zsh
Normal file
10
plugins/pow/pow.plugin.zsh
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Thanks to Christopher Sexton
|
||||||
|
# https://gist.github.com/965032
|
||||||
|
function kapow {
|
||||||
|
touch ~/.pow/$1/tmp/restart.txt
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "$fg[yellow]Pow restarting $1...$reset_color"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
compctl -W ~/.pow -/ kapow
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# TODO: Make this compatible with rvm.
|
||||||
|
# Run sudo gem on the system ruby, not the active ruby.
|
||||||
alias sgem='sudo gem'
|
alias sgem='sudo gem'
|
||||||
|
|
||||||
# Find ruby file
|
# Find ruby file
|
||||||
|
|
|
||||||
147
plugins/rvm/_rvm
Normal file
147
plugins/rvm/_rvm
Normal file
|
|
@ -0,0 +1,147 @@
|
||||||
|
#compdef rvm
|
||||||
|
|
||||||
|
local curcontext="$curcontext" state line cmds ret=1
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||||
|
'(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
|
||||||
|
'(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
|
||||||
|
'(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
|
||||||
|
'(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
|
||||||
|
'(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
|
||||||
|
'-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
|
||||||
|
'-e[Execute code from the command line]:code' \
|
||||||
|
'(-G)-G[root gem path to use]:path:_files' \
|
||||||
|
'(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
|
||||||
|
'(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
|
||||||
|
'(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
|
||||||
|
'(-C|--configure)'{-C,--configure}'=[custom configure options]' \
|
||||||
|
'(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
|
||||||
|
'(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
|
||||||
|
'(--head)--head[with update, updates rvm to git head version]' \
|
||||||
|
'(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
|
||||||
|
'(--default)--default[with ruby select, sets a default ruby for new shells]' \
|
||||||
|
'(--debug)--debug[Toggle debug mode on for very verbose output]' \
|
||||||
|
'(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
|
||||||
|
'(--force)--force[Force install, removes old install & source before install]' \
|
||||||
|
'(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
|
||||||
|
'(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
|
||||||
|
'(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
|
||||||
|
'(--docs)--docs[with install, attempt to generate ri after installation]' \
|
||||||
|
'(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
|
||||||
|
'1: :->cmds' \
|
||||||
|
'*: :->args' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
cmds)
|
||||||
|
cmds=(
|
||||||
|
"version:show the rvm version installed in rvm_path"
|
||||||
|
"use:setup current shell to use a specific ruby version"
|
||||||
|
"reload:reload rvm source itself (useful after changing rvm source)"
|
||||||
|
"implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)."
|
||||||
|
"update:upgrades rvm to the latest version."
|
||||||
|
"reset:remove current and stored default & system settings."
|
||||||
|
"info :show the *current* environment information for current ruby"
|
||||||
|
"current:print the *current* ruby version and the name of any gemset being used."
|
||||||
|
"debug:show info plus additional information for common issues"
|
||||||
|
"install:install one or many ruby versions"
|
||||||
|
"uninstall:uninstall one or many ruby versions, leaves their sources"
|
||||||
|
"remove:uninstall one or many ruby versions and remove their sources"
|
||||||
|
"migrate:Lets you migrate all gemsets from one ruby to another."
|
||||||
|
"upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically."
|
||||||
|
"wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like."
|
||||||
|
"cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm."
|
||||||
|
"repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)."
|
||||||
|
"snapshot:Lets your backup / restore an rvm installation in a lightweight manner."
|
||||||
|
"disk-usage:Tells you how much disk space rvm install is using."
|
||||||
|
"tools:Provides general information about the ruby environment, primarily useful when scripting rvm."
|
||||||
|
"docs:Tools to make installing ri and rdoc documentation easier."
|
||||||
|
"rvmrc:Tools related to managing rvmrc trust and loading."
|
||||||
|
"exec:runs an arbitrary command as a set operation."
|
||||||
|
"ruby:runs a named ruby file against specified and/or all rubies"
|
||||||
|
"gem:runs a gem command using selected ruby's 'gem'"
|
||||||
|
"rake:runs a rake task against specified and/or all rubies"
|
||||||
|
"tests:runs 'rake test' across selected ruby versions"
|
||||||
|
"specs:runs 'rake spec' across selected ruby versions"
|
||||||
|
"monitor:Monitor cwd for testing, run rake {spec,test} on changes."
|
||||||
|
"gemset:gemsets: http://rvm.beginrescueend.com/gemsets/"
|
||||||
|
"rubygems:Switches the installed version of rubygems for the current ruby."
|
||||||
|
"gemdir:display the path to the current gem directory (GEM_HOME)."
|
||||||
|
"srcdir:display the path to rvm source directory (may be yanked)"
|
||||||
|
"fetch:Performs an archive / src fetch only of the selected ruby."
|
||||||
|
"list:show currently installed rubies, interactive output."
|
||||||
|
"package:Install a dependency package {readline,iconv,zlib,openssl}"
|
||||||
|
"notes:Display notes, with operating system specifics."
|
||||||
|
"export:Temporarily set an environment variable in the current shell."
|
||||||
|
"unexport:Undo changes made to the environment by 'rvm export'."
|
||||||
|
)
|
||||||
|
_describe -t commands 'rvm command' cmds && ret=0
|
||||||
|
;;
|
||||||
|
args)
|
||||||
|
case $line[1] in
|
||||||
|
(use|uninstall|remove|list)
|
||||||
|
_values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0
|
||||||
|
;;
|
||||||
|
(install|fetch)
|
||||||
|
_values -S , 'rubies' $(rvm list known_strings) && ret=0
|
||||||
|
;;
|
||||||
|
gemset)
|
||||||
|
if (( CURRENT == 3 )); then
|
||||||
|
_values 'gemset_commands' \
|
||||||
|
'import' \
|
||||||
|
'export' \
|
||||||
|
'create' \
|
||||||
|
'copy' \
|
||||||
|
'rename' \
|
||||||
|
'empty' \
|
||||||
|
'delete' \
|
||||||
|
'name' \
|
||||||
|
'dir' \
|
||||||
|
'list' \
|
||||||
|
'list_all' \
|
||||||
|
'gemdir' \
|
||||||
|
'install' \
|
||||||
|
'pristine' \
|
||||||
|
'clear' \
|
||||||
|
'use' \
|
||||||
|
'update' \
|
||||||
|
'unpack' \
|
||||||
|
'globalcache'
|
||||||
|
else
|
||||||
|
_values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null)
|
||||||
|
fi
|
||||||
|
ret=0
|
||||||
|
;;
|
||||||
|
package)
|
||||||
|
if (( CURRENT == 3 )); then
|
||||||
|
_values 'package_commands' \
|
||||||
|
'install' \
|
||||||
|
'uninstall'
|
||||||
|
else
|
||||||
|
_values 'packages' \
|
||||||
|
'readline' \
|
||||||
|
'iconv' \
|
||||||
|
'curl' \
|
||||||
|
'openssl' \
|
||||||
|
'zlib' \
|
||||||
|
'autoconf' \
|
||||||
|
'ncurses' \
|
||||||
|
'pkgconfig' \
|
||||||
|
'gettext' \
|
||||||
|
'glib' \
|
||||||
|
'mono' \
|
||||||
|
'llvm' \
|
||||||
|
'libxml2' \
|
||||||
|
'libxslt' \
|
||||||
|
'libyaml'
|
||||||
|
fi
|
||||||
|
ret=0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
(( ret )) && _message 'no more arguments'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
57
plugins/rvm/rvm.plugin.zsh
Normal file
57
plugins/rvm/rvm.plugin.zsh
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Get the name of the current branch.
|
||||||
|
function rvm_prompt_info() {
|
||||||
|
local ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null)
|
||||||
|
if [[ -n "$ruby_version" ]]; then
|
||||||
|
echo "($ruby_version)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
alias rubies='rvm list rubies'
|
||||||
|
alias gemsets='rvm gemset list'
|
||||||
|
|
||||||
|
local ruby18='ruby-1.8.7-p334'
|
||||||
|
local ruby19='ruby-1.9.2-p180'
|
||||||
|
|
||||||
|
function rb18 {
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
rvm use "$ruby18"
|
||||||
|
else
|
||||||
|
rvm use "$ruby18@$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
|
||||||
|
compdef _rb18 rb18
|
||||||
|
|
||||||
|
function rb19 {
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
rvm use "$ruby19"
|
||||||
|
else
|
||||||
|
rvm use "$ruby19@$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
|
||||||
|
compdef _rb19 rb19
|
||||||
|
|
||||||
|
function rvm-update {
|
||||||
|
rvm get head
|
||||||
|
rvm reload # TODO: Reload rvm completion?
|
||||||
|
}
|
||||||
|
|
||||||
|
function rvm-link-completion {
|
||||||
|
ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official"
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO: Make this usable w/o rvm.
|
||||||
|
function gems {
|
||||||
|
local current_ruby=`rvm-prompt i v p`
|
||||||
|
local current_gemset=`rvm-prompt g`
|
||||||
|
|
||||||
|
gem list $@ | sed \
|
||||||
|
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
||||||
|
-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
|
||||||
|
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
||||||
|
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
|
alias et='mate .'
|
||||||
|
alias ett='mate app config lib db public spec test Rakefile Capfile Todo'
|
||||||
|
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||||
|
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||||
|
|
||||||
# TextMate
|
# Edit Ruby app in TextMate
|
||||||
alias et='mate . &'
|
|
||||||
alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
|
|
||||||
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
|
|
||||||
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
|
|
||||||
|
|
||||||
# Editor Ruby file in TextMate
|
|
||||||
alias mr='mate CHANGELOG app config db lib public script spec test'
|
alias mr='mate CHANGELOG app config db lib public script spec test'
|
||||||
|
|
||||||
function tm() {
|
function tm() {
|
||||||
|
|
|
||||||
4
plugins/thor/_thor
Normal file
4
plugins/thor/_thor
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#compdef thor
|
||||||
|
#autoload
|
||||||
|
|
||||||
|
compadd `thor list | grep thor | cut -d " " -f 2`
|
||||||
|
|
@ -1,28 +1,24 @@
|
||||||
# Path to your oh-my-zsh configuration.
|
# Path to oh-my-zsh.
|
||||||
export ZSH=$HOME/.oh-my-zsh
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
|
||||||
# Set name of the theme to load.
|
# Set the name of the theme to load (see $ZSH/themes/).
|
||||||
# Look in ~/.oh-my-zsh/themes/
|
# Setting it to 'random' loads a random theme.
|
||||||
# Optionally, if you set this to "random", it'll load a random theme each
|
|
||||||
# time that oh-my-zsh is loaded.
|
|
||||||
export ZSH_THEME="robbyrussell"
|
export ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
# Set to this to use case-sensitive completion
|
# Set to 'true' to enable case-sensitivity.
|
||||||
# export CASE_SENSITIVE="true"
|
export CASE_SENSITIVE='false'
|
||||||
|
|
||||||
# Comment this out to disable weekly auto-update checks
|
# Set to 'true' to disable color (auto set on dumb terminals).
|
||||||
# export DISABLE_AUTO_UPDATE="true"
|
export DISABLE_COLOR='false'
|
||||||
|
|
||||||
# Uncomment following line if you want to disable colors in ls
|
# Set to 'true' to disable auto setting the tab and window titles.
|
||||||
# export DISABLE_COLOR="true"
|
export DISABLE_AUTO_TITLE='false'
|
||||||
|
|
||||||
# Uncomment following line if you want to disable autosetting terminal title.
|
# Set the plugins to load (see $ZSH/plugins/).
|
||||||
# export DISABLE_AUTO_TITLE="true"
|
# Example: plugins=(rails git textmate ruby lighthouse)
|
||||||
|
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
||||||
plugins=(git)
|
plugins=(git)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source "$ZSH/oh-my-zsh.sh"
|
||||||
|
|
||||||
# Customize to your needs...
|
# Customize to your needs...
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,30 @@
|
||||||
PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info)
|
local R="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
|
PROMPT='%{$fg[blue]%}%n$R on %{$fg[red]%}%M$R in %{$fg[blue]%}%~%b$R$GIT_PROMPT_INFO
|
||||||
$ '
|
$ '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
|
git_prompt_info ()
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO="($(rvm_gemset)$R)"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Text to display if the branch is dirty
|
local prompt=''
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
|
|
||||||
|
|
||||||
# Text to display if the branch is clean
|
git_prompt__branch
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
prompt="%{$fg[white]%}$GIT_PROMPT_BRANCH"
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%}*"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="($(rvm_gemset)$(git_time_since_commit)$prompt$R)"
|
||||||
|
}
|
||||||
|
|
||||||
# Colors vary depending on time lapsed.
|
# Colors vary depending on time lapsed.
|
||||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
|
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
|
||||||
|
|
@ -17,24 +33,11 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
|
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
|
||||||
|
|
||||||
|
|
||||||
# Git sometimes goes into a detached head state. git_prompt_info doesn't
|
|
||||||
# return anything in this case. So wrap it in another function and check
|
|
||||||
# for an empty string.
|
|
||||||
function check_git_prompt_info() {
|
|
||||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
|
||||||
if [[ -z $(git_prompt_info) ]]; then
|
|
||||||
echo "%{$fg[magenta]%}detached-head%{$reset_color%})"
|
|
||||||
else
|
|
||||||
echo "$(git_prompt_info)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Determine if we are using a gemset.
|
# Determine if we are using a gemset.
|
||||||
function rvm_gemset() {
|
function rvm_gemset() {
|
||||||
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
|
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
|
||||||
if [[ -n $GEMSET ]]; then
|
if [[ -n $GEMSET ]]; then
|
||||||
echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
|
echo "%{$fg[yellow]%}${GEMSET}$R|"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -72,15 +75,15 @@ function git_time_since_commit() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$HOURS" -gt 24 ]; then
|
if [ "$HOURS" -gt 24 ]; then
|
||||||
echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m$R|"
|
||||||
elif [ "$MINUTES" -gt 60 ]; then
|
elif [ "$MINUTES" -gt 60 ]; then
|
||||||
echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${HOURS}h${SUB_MINUTES}m$R|"
|
||||||
else
|
else
|
||||||
echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${MINUTES}m$R|"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
||||||
echo "($(rvm_gemset)$COLOR~|"
|
echo "$COLOR~|"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
|
||||||
|
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
|
PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $GIT_PROMPT_INFO%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
|
||||||
|
|
||||||
RPS1="${return_code}"
|
RPS1="${return_code}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
|
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
|
||||||
|
|
||||||
PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
|
PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
|
||||||
RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'
|
RPROMPT='%{$fg[$NCOLOR]%}%p $GIT_PROMPT_INFO%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:"
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,34 @@
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# FILE: ashleydev.theme.zsh
|
||||||
|
# DESCRIPTION: oh-my-zsh prompt theme, shows vi mode, last shell return code,
|
||||||
|
# and verbose git info.
|
||||||
|
# AUTHOR: Ashley Dev (the.ashley.dev+zsh-theme@gmail.com)
|
||||||
|
# VERSION: 3.0
|
||||||
|
# SCREENSHOT: http://i.imgur.com/Yw1KG.png
|
||||||
|
# http://i.imgur.com/wx6MU.png
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# NOTE: make sure to add 'git' to your list of oh-my-zsh plugins (in your
|
# NOTE: make sure to add 'git' to your list of oh-my-zsh plugins (in your
|
||||||
# ~/.zshrc), otherwise the git prompt info will not be shown.
|
# ~/.zshrc), otherwise the git prompt info will not be shown.
|
||||||
|
|
||||||
#-------------------- Colors ----------------------
|
#-------------------- Colors ----------------------
|
||||||
# Colors ('_C' for color):
|
# Colors ('_C' for color):
|
||||||
if [[ "$DISABLE_COLOR" != "true" ]]; then
|
if [[ "$DISABLE_COLOR" != "true" ]]; then
|
||||||
# git prompt info colors:
|
|
||||||
local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
|
|
||||||
local _Cb_new_repo_="%{$fg_bold[default]%}" # branch color of new repo
|
|
||||||
local _Cb_clean_="%{$fg_no_bold[green]%}" # branch color when clean
|
|
||||||
local _Cb_dirty_="%{$fg_no_bold[red]%}" # branch color when dirty
|
|
||||||
local _Cr_="%{$bold_color$fg[yellow]%}" # rebase info
|
|
||||||
local _Ci_="%{$bold_color$fg[red]%}" # index info
|
|
||||||
local _Cu_clean_="" # untracked files state when clean
|
|
||||||
local _Cu_dirty_="%{$fg_bold[red]%}" # untracked files state when dirty
|
|
||||||
local _Cp_="%{${fg[cyan]}%}" # upstream info
|
|
||||||
local _Cs_="" # stash state
|
|
||||||
|
|
||||||
# Reset formating:
|
# Reset formating:
|
||||||
local R="%{$terminfo[sgr0]%}"
|
local R="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
|
# git prompt info colors:
|
||||||
|
local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
|
||||||
|
local _Cbranch_new_repo_="%{$fg_bold[default]%}" # branch color of new repo
|
||||||
|
local _Cbranch_clean_="%{$fg_no_bold[green]%}" # branch color when clean
|
||||||
|
local _Cbranch_dirty_="%{$fg_no_bold[red]%}" # branch color when dirty
|
||||||
|
local _Crebase_="%{$bold_color$fg[yellow]%}" # rebase info
|
||||||
|
local _Cindex_="%{$bold_color$fg[red]%}" # index info
|
||||||
|
local _Cuntracked_clean_="" # untracked files state when clean
|
||||||
|
local _Cuntracked_dirty_="%{$fg_bold[red]%}" # untracked files state when dirty
|
||||||
|
local _Cupstream_="%{${fg[cyan]}%}" # upstream info
|
||||||
|
local _Cstash_="" # stash state
|
||||||
|
|
||||||
# PROMPT colors:
|
# PROMPT colors:
|
||||||
local _Cuser_root_="%{$fg_bold[yellow]$bg[red]%}"
|
local _Cuser_root_="%{$fg_bold[yellow]$bg[red]%}"
|
||||||
local _Chost_root_="%{$fg[red]%}"
|
local _Chost_root_="%{$fg[red]%}"
|
||||||
|
|
@ -34,102 +44,15 @@ if [[ "$DISABLE_COLOR" != "true" ]]; then
|
||||||
local _Cvi_mode_="%{$fg_bold[cyan]%}"
|
local _Cvi_mode_="%{$fg_bold[cyan]%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#-----------------------------------------------------
|
|
||||||
# git prompt info:
|
|
||||||
|
|
||||||
# The git prompt plugin will cause $GIT_PROMPT_INFO_FUNC to be called
|
|
||||||
# when $__GIT_PROMPT_INFO needs to be updated.
|
|
||||||
GIT_PROMPT_INFO_FUNC="update__GIT_PROMPT_INFO"
|
|
||||||
GIT_PROMPT_SHOWUPSTREAM="verbose"
|
|
||||||
GIT_PROMPT_SHORTCIRCUIT='on'
|
|
||||||
|
|
||||||
local __GIT_PROMPT_INFO=''
|
|
||||||
# will set __GIT_PROMPT_INFO
|
|
||||||
update__GIT_PROMPT_INFO ()
|
|
||||||
{
|
|
||||||
local g="$(_git_promt__git_dir)"
|
|
||||||
if [ -z "$g" ]; then
|
|
||||||
__GIT_PROMPT_INFO=''
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
_git_prompt__stash
|
|
||||||
local s=$GIT_PROMPT_STASH_STATE_DIRTY
|
|
||||||
|
|
||||||
_git_prompt__upstream
|
|
||||||
local p=$GIT_PROMPT_UPSTREAM_STATE
|
|
||||||
|
|
||||||
_git_prompt__branch
|
|
||||||
local b=$GIT_PROMPT_BRANCH
|
|
||||||
|
|
||||||
_git_prompt__rebase_info
|
|
||||||
local r=$GIT_PROMPT_REBASE_INFO
|
|
||||||
|
|
||||||
_git_prompt__dirty_state
|
|
||||||
local w=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
|
|
||||||
local i=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
|
|
||||||
local u=$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED
|
|
||||||
local f=$GIT_PROMPT_DIRTY_STATE_FRESH_REPO
|
|
||||||
|
|
||||||
if [ -z "$b$i$w$u" ]; then
|
|
||||||
if [ -n "$g" ]; then
|
|
||||||
__GIT_PROMPT_INFO="$R$_Cerror_(Error: bad ./$g dir)$R"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$s" = 'yes' ]; then
|
|
||||||
s="$_Cs_\$$R"
|
|
||||||
else
|
|
||||||
s=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$p" ]; then
|
|
||||||
p="$_Cp_$p$R"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$i" = "yes" ]; then
|
|
||||||
i="$_Ci_+$R"
|
|
||||||
else
|
|
||||||
i=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$b" ]; then
|
|
||||||
if [ "$f" = "yes" ]; then
|
|
||||||
# this is a fresh repo, nothing here...
|
|
||||||
b="$_Cb_new_repo_$b$R"
|
|
||||||
elif [ "$w" = 'yes' ]; then
|
|
||||||
b="$_Cb_dirty_$b$R"
|
|
||||||
elif [ "$w" = 'no' ]; then
|
|
||||||
b="$_Cb_clean_$b$R"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$r" ]; then
|
|
||||||
r="$_Cr_$r$R"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local _prompt="$b$r$i$s$p"
|
|
||||||
# add ( ) around _prompt:
|
|
||||||
if [ "$u" = "yes" ]; then
|
|
||||||
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
|
||||||
elif [ "$u" = "no" ]; then
|
|
||||||
_prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
|
||||||
else
|
|
||||||
fi
|
|
||||||
|
|
||||||
__GIT_PROMPT_INFO="$R$_prompt$R"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------- PROMPT definition: ----------------------
|
#-------------------- PROMPT definition: ----------------------
|
||||||
#
|
#
|
||||||
|
|
||||||
local user_="%(!.$_Cuser_root_.$_Cuser_)%n$R"
|
local user_="%(!.$_Cuser_root_.$_Cuser_)%n$R"
|
||||||
local host_="%(!.$_Chost_root_.$_Chost_)%m$R"
|
local host_="%(!.$_Chost_root_.$_Chost_)%m$R"
|
||||||
local path_="%(!.$_Cpath_root_.$_Cpath_)%~$R"
|
local path_="%(!.$_Cpath_root_.$_Cpath_)%~$R"
|
||||||
local jobs_="%(1j.$_Cjobs_%j$R.)"
|
local jobs_="%(1j.$_Cjobs_%j$R.)"
|
||||||
|
|
||||||
PROMPT='$user_$host_$path_ $__GIT_PROMPT_INFO$jobs_# '
|
PROMPT='$user_$host_$path_ $GIT_PROMPT_INFO$jobs_# '
|
||||||
|
|
||||||
local date_format_='%D{%a %b %d}, %*'
|
local date_format_='%D{%a %b %d}, %*'
|
||||||
local date_="${_Cdate_}[$date_format_]$R"
|
local date_="${_Cdate_}[$date_format_]$R"
|
||||||
|
|
@ -140,3 +63,81 @@ RPROMPT='$return_code_$date_'
|
||||||
# use the vi-mode oh-my-zsh plugin to get this:
|
# use the vi-mode oh-my-zsh plugin to get this:
|
||||||
MODE_INDICATOR="${_Cvi_mode_}-- CMD MODE -- $R"
|
MODE_INDICATOR="${_Cvi_mode_}-- CMD MODE -- $R"
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------- Git prompt info format: ----------------------
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
local dir_="$(git_prompt__git_dir)"
|
||||||
|
if [ -z "$dir_" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
git_prompt__stash
|
||||||
|
local stash_=$GIT_PROMPT_STASH_STATE_DIRTY
|
||||||
|
|
||||||
|
git_prompt__upstream
|
||||||
|
local upstream_=$GIT_PROMPT_UPSTREAM_STATE
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
local branch_=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
local rebase_=$GIT_PROMPT_REBASE_INFO
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
local work_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
|
||||||
|
local index_=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
|
||||||
|
local untracked_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED
|
||||||
|
local freshy_=$GIT_PROMPT_DIRTY_STATE_FRESH_REPO
|
||||||
|
|
||||||
|
if [ -z "$branch_$index_$work_$untracked_" ]; then
|
||||||
|
if [ -n "$dir_" ]; then
|
||||||
|
GIT_PROMPT_INFO="$R$_Cerror_(Error: bad ./$dir_ dir)$R"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$stash_" = 'yes' ]; then
|
||||||
|
stash_="$_Cstash_\$$R"
|
||||||
|
else
|
||||||
|
stash_=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$upstream_" ]; then
|
||||||
|
upstream_="$_Cupstream_$upstream_$R"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$index_" = "yes" ]; then
|
||||||
|
index_="$_Cindex_+$R"
|
||||||
|
else
|
||||||
|
index_=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$branch_" ]; then
|
||||||
|
if [ "$freshy_" = "yes" ]; then
|
||||||
|
# this is a fresh repo, nothing here...
|
||||||
|
branch_="$_Cbranch_new_repo_$branch_$R"
|
||||||
|
elif [ "$work_" = 'yes' ]; then
|
||||||
|
branch_="$_Cbranch_dirty_$branch_$R"
|
||||||
|
elif [ "$work_" = 'no' ]; then
|
||||||
|
branch_="$_Cbranch_clean_$branch_$R"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$rebase_" ]; then
|
||||||
|
rebase_="$_Crebase_$rebase_$R"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local _prompt="$branch_$rebase_$index_$stash_$upstream_"
|
||||||
|
# add ( ) around _prompt:
|
||||||
|
if [ "$untracked_" = "yes" ]; then
|
||||||
|
_prompt="$_Cuntracked_dirty_($_prompt$_Cuntracked_dirty_)"
|
||||||
|
elif [ "$untracked_" = "no" ]; then
|
||||||
|
_prompt="$_Cuntracked_clean_($_prompt$_Cuntracked_clean_)"
|
||||||
|
else
|
||||||
|
_prompt="($_prompt)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="$R$_prompt$R"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color
|
PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$GIT_PROMPT_INFO$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color
|
||||||
$ '
|
$ '
|
||||||
# git theming
|
# git theming
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green]("
|
ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green]("
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# the svn plugin has to be activated for this to work.
|
# the svn plugin has to be activated for this to work.
|
||||||
|
|
||||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
||||||
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
|
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
|
||||||
local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
|
local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
|
||||||
local git_branch='$(git_prompt_info)%{$reset_color%}'
|
local git_branch='$GIT_PROMPT_INFO%{$reset_color%}'
|
||||||
|
|
||||||
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
|
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
|
||||||
╰─%B$%b "
|
╰─%B$%b "
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $GIT_PROMPT_INFO\
|
||||||
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
|
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
|
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
|
||||||
|
|
||||||
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
|
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $GIT_PROMPT_INFO%(!.#.$) '
|
||||||
RPROMPT='[%*]'
|
RPROMPT='[%*]'
|
||||||
|
|
||||||
# git theming
|
# git theming
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i
|
||||||
DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
|
DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
|
||||||
# Grab the current filepath, use shortcuts: ~/Desktop
|
# Grab the current filepath, use shortcuts: ~/Desktop
|
||||||
# Append the current git branch, if in a git repository: ~aw@master
|
# Append the current git branch, if in a git repository: ~aw@master
|
||||||
DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}"
|
DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$GIT_PROMPT_INFO%{$reset_color%}"
|
||||||
# Grab the current username: dallas
|
# Grab the current username: dallas
|
||||||
DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}"
|
DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}"
|
||||||
# Use a % for normal users and a # for privelaged (root) users.
|
# Use a % for normal users and a # for privelaged (root) users.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# meh. Dark Blood Rewind, a new beginning.
|
# meh. Dark Blood Rewind, a new beginning.
|
||||||
|
|
||||||
PROMPT=$'%{$fg[red]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[red]%}@%{$fg_bold[white]%}%m%{$reset_color%}%{$fg[red]%}] [%{$fg_bold[white]%}/dev/%y%{$reset_color%}%{$fg[red]%}] %{$(git_prompt_info)%}%(?,,%{$fg[red]%}[%{$fg_bold[white]%}%?%{$reset_color%}%{$fg[red]%}])
|
PROMPT=$'%{$fg[red]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[red]%}@%{$fg_bold[white]%}%m%{$reset_color%}%{$fg[red]%}] [%{$fg_bold[white]%}/dev/%y%{$reset_color%}%{$fg[red]%}] %{$GIT_PROMPT_INFO%}%(?,,%{$fg[red]%}[%{$fg_bold[white]%}%?%{$reset_color%}%{$fg[red]%}])
|
||||||
%{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} '
|
%{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} '
|
||||||
PS2=$' %{$fg[red]%}|>%{$reset_color%} '
|
PS2=$' %{$fg[red]%}|>%{$reset_color%} '
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Copied and modified from the oh-my-zsh theme from geoffgarside
|
# Copied and modified from the oh-my-zsh theme from geoffgarside
|
||||||
# Red server name, green cwd, blue git status
|
# Red server name, green cwd, blue git status
|
||||||
|
|
||||||
PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) '
|
PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$GIT_PROMPT_INFO %(!.#.$) '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}("
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
|
||||||
# Compacted $PWD
|
# Compacted $PWD
|
||||||
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
|
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
|
||||||
|
|
||||||
PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
|
PROMPT='${time} ${user}${host} ${pwd} $GIT_PROMPT_INFO'
|
||||||
|
|
||||||
# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
|
# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
|
||||||
# but lets see how this works out
|
# but lets see how this works out
|
||||||
|
|
|
||||||
|
|
@ -6,30 +6,70 @@
|
||||||
# SCREENSHOT: coming soon
|
# SCREENSHOT: coming soon
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
|
local R="%{$terminfo[sgr0]%}"
|
||||||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
|
||||||
|
|
||||||
PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
|
MODE_INDICATOR="%{$fg_bold[red]%}❮$R%{$fg[red]%}❮❮$R"
|
||||||
%{$fg[red]%}%!%{$reset_color%} $(prompt_char) '
|
local return_status="%{$fg[red]%}%(?..⏎)$R"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}"
|
PROMPT='%{$fg[blue]%}%m$R%{$fg_bold[white]%} ओम् $R%{$fg[cyan]%}%~:$R$GIT_PROMPT_INFO
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
%{$fg[red]%}%!$R $(prompt_char) '
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
GIT_RPROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
local prompt=''
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
|
git_prompt__branch
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
|
prompt="%{$fg_bold[green]%}git$R@%{$bg[white]%}%{$fg[black]%}$GIT_PROMPT_BRANCH"
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%}!"
|
||||||
|
fi
|
||||||
|
GIT_PROMPT_INFO="($(git_time_since_commit)$prompt$R)"
|
||||||
|
|
||||||
|
local rprompt=''
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
rprompt="%{$fg[green]%} ✚"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[blue]%} ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[blue]%} ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[red]%} ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[red]%} ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[magenta]%} ➜"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[yellow]%} ═"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[cyan]%} ✭"
|
||||||
|
fi
|
||||||
|
GIT_RPROMPT_INFO=$rprompt
|
||||||
|
}
|
||||||
|
|
||||||
|
RPROMPT='${return_status}$GIT_RPROMPT_INFO$R'
|
||||||
|
|
||||||
function prompt_char() {
|
function prompt_char() {
|
||||||
git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
|
git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±$R" && return
|
||||||
hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
|
hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿$R" && return
|
||||||
echo "%{$fg[cyan]%}◯ %{$reset_color%}"
|
echo "%{$fg[cyan]%}◯ $R"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Colors vary depending on time lapsed.
|
# Colors vary depending on time lapsed.
|
||||||
|
|
@ -40,7 +80,8 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
|
||||||
|
|
||||||
# Determine the time since last commit. If branch is clean,
|
# Determine the time since last commit. If branch is clean,
|
||||||
# use a neutral color, otherwise colors will vary according to time.
|
# use a neutral color, otherwise colors will vary according to time.
|
||||||
function git_time_since_commit() {
|
git_time_since_commit ()
|
||||||
|
{
|
||||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
# Only proceed if there is actually a commit.
|
# Only proceed if there is actually a commit.
|
||||||
if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
|
if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
|
||||||
|
|
@ -71,15 +112,15 @@ function git_time_since_commit() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$HOURS" -gt 24 ]; then
|
if [ "$HOURS" -gt 24 ]; then
|
||||||
echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m$R|"
|
||||||
elif [ "$MINUTES" -gt 60 ]; then
|
elif [ "$MINUTES" -gt 60 ]; then
|
||||||
echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${HOURS}h${SUB_MINUTES}m$R|"
|
||||||
else
|
else
|
||||||
echo "($COLOR${MINUTES}m%{$reset_color%}|"
|
echo "$COLOR${MINUTES}m$R|"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
||||||
echo "($COLOR~|"
|
echo "$COLOR~|"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ function prompt_char {
|
||||||
|
|
||||||
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
|
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
|
||||||
)
|
)
|
||||||
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info)
|
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$GIT_PROMPT_INFO
|
||||||
%_ $(prompt_char) '
|
%_ $(prompt_char) '
|
||||||
|
|
||||||
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
|
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,32 @@ function virtualenv_info {
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info)
|
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$GIT_PROMPT_INFO
|
||||||
$(virtualenv_info)$(prompt_char) '
|
$(virtualenv_info)$(prompt_char) '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
|
git_prompt_info ()
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
{
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
|
GIT_PROMPT_INFO=''
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prompt=""
|
||||||
|
git_prompt__branch
|
||||||
|
prompt=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
if [[ -n "$prompt" ]]; then
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
prompt="$prompt%{$fg[green]%}!"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
prompt="$prompt%{$fg[green]%}?"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO=" on %{$fg[magenta]%}$prompt%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,28 @@ if [[ -s ~/.rvm/scripts/rvm ]] ; then
|
||||||
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
|
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
|
local R="%{$terminfo[sgr0]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
git_prompt_info ()
|
||||||
git_custom_status() {
|
{
|
||||||
local cb=$(current_branch)
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
if [ -n "$cb" ]; then
|
GIT_PROMPT_INFO=''
|
||||||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
local cb=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
cb="${cb}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
local dirty
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
dirty="%{$fg[red]%}*%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="$dirty$R%{$fg[green]%}[$cb]$R"
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b '
|
PROMPT='$GIT_PROMPT_INFO%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b '
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,49 @@
|
||||||
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
||||||
PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
|
PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)'
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
|
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
RPROMPT='${return_status}$GIT_PROMPT_INFO%{$reset_color%}'
|
||||||
|
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prompt=''
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
prompt=" $GIT_PROMPT_BRANCH"
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[green]%} +"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[blue]%} !"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[blue]%} !"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%} -"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%} -"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[magenta]%} >"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[yellow]%} #"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[cyan]%} ?"
|
||||||
|
fi
|
||||||
|
GIT_PROMPT_INFO=$prompt
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ fi
|
||||||
|
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
|
PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $GIT_PROMPT_INFO%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
|
||||||
|
|
||||||
RPS1='$(vi_mode_prompt_info) ${return_code}'
|
RPS1='$(vi_mode_prompt_info) ${return_code}'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Copied from old version of tonotdo's theme. LSCOLORS modified.
|
# Copied from old version of tonotdo's theme. LSCOLORS modified.
|
||||||
PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» '
|
PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$GIT_PROMPT_INFO%{$reset_color%}» '
|
||||||
RPROMPT='[%*]'
|
RPROMPT='[%*]'
|
||||||
|
|
||||||
# git theming
|
# git theming
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
PROMPT=$'
|
PROMPT=$'
|
||||||
%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%}
|
%{$fg[blue]%}%/%{$reset_color%} $GIT_PROMPT_INFO%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%}
|
||||||
%{$fg_bold[black]%}>%{$reset_color%} '
|
%{$fg_bold[black]%}>%{$reset_color%} '
|
||||||
|
|
||||||
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
|
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
|
||||||
|
|
|
||||||
6
themes/fwalch.zsh-theme
Normal file
6
themes/fwalch.zsh-theme
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg
|
# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b '
|
PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $GIT_PROMPT_INFO%{$reset_color%}%B»%b '
|
||||||
RPS1="${return_code}"
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,30 @@
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
|
git_prompt_info ()
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
{
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
|
||||||
git_custom_status() {
|
|
||||||
local cb=$(current_branch)
|
|
||||||
if [ -n "$cb" ]; then
|
|
||||||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
local cb=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
cb="${cb}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
local dirty
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
dirty="%{$fg[red]%}*%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local R="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="$dirty$R%{$fg[green]%}[$cb]$R"
|
||||||
}
|
}
|
||||||
|
|
||||||
#RVM and git settings
|
#RVM and git settings
|
||||||
if [[ -s ~/.rvm/scripts/rvm ]] ; then
|
if [[ -s ~/.rvm/scripts/rvm ]] ; then
|
||||||
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
|
RPS1='$GIT_PROMPT_INFO%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
|
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: '
|
PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%}% %{$reset_color%}: '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} '
|
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $GIT_PROMPT_INFO%#%{$reset_color%} '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# PROMPT="[%*] %n:%c $(git_prompt_info)%(!.#.$) "
|
# PROMPT="[%*] %n:%c $GIT_PROMPT_INFO%(!.#.$) "
|
||||||
PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) '
|
PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$GIT_PROMPT_INFO %(!.#.$) '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:("
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,51 @@
|
||||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
local R="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO % $R'
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
|
RPROMPT='$GIT_RPROMPT_INFO$R'
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
RPROMPT='$(git_prompt_status)%{$reset_color%}'
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
GIT_RPROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
|
local prompt=''
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
|
git_prompt__branch
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
|
prompt="$GIT_PROMPT_BRANCH"
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="($prompt)"
|
||||||
|
|
||||||
|
local rprompt=''
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
rprompt="%{$fg[cyan]%} ✈"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[yellow]%} ✭"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[yellow]%} ✭"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[red]%} ✗"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[red]%} ✗"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[blue]%} ➦"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[magenta]%} ✂"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}%{$fg[grey]%} ✱"
|
||||||
|
fi
|
||||||
|
GIT_RPROMPT_INFO=$rprompt
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}'
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$GIT_PROMPT_INFO%{$fg_bold[white]%} % %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,51 @@ preexec () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setprompt () {
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prompt=''
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
prompt=" on %{$fg[green]%}$GIT_PROMPT_BRANCH"
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[green]%} ✚"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[blue]%} ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[blue]%} ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%} ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[red]%} ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[magenta]%} ➜"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[yellow]%} ═"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}%{$fg[cyan]%} ✭"
|
||||||
|
fi
|
||||||
|
GIT_PROMPT_INFO=$prompt
|
||||||
|
}
|
||||||
|
|
||||||
|
setprompt ()
|
||||||
|
{
|
||||||
###
|
###
|
||||||
# Need this so the prompt will work.
|
# Need this so the prompt will work.
|
||||||
|
|
||||||
|
|
@ -53,20 +97,6 @@ setprompt () {
|
||||||
done
|
done
|
||||||
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
|
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
###
|
|
||||||
# Modify Git prompt
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
|
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# See if we can use extended characters to look nicer.
|
# See if we can use extended characters to look nicer.
|
||||||
|
|
||||||
|
|
@ -119,7 +149,7 @@ $PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\
|
||||||
|
|
||||||
$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
|
$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
|
||||||
$PR_YELLOW%D{%H:%M:%S}\
|
$PR_YELLOW%D{%H:%M:%S}\
|
||||||
$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\
|
$PR_LIGHT_BLUE%{$reset_color%}$GIT_PROMPT_INFO$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\
|
||||||
$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
|
$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
|
||||||
>$PR_NO_COLOUR '
|
>$PR_NO_COLOUR '
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ function josh_prompt {
|
||||||
prompt=" $prompt"
|
prompt=" $prompt"
|
||||||
done
|
done
|
||||||
|
|
||||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
|
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $GIT_PROMPT_INFO"
|
||||||
|
|
||||||
echo $prompt
|
echo $prompt
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
|
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
|
||||||
$(git_prompt_info)\
|
$GIT_PROMPT_INFO\
|
||||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='${return_code}'
|
RPS1='${return_code}'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d
|
PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d
|
||||||
%{$fg_bold[yellow]%}%% %{$reset_color%}"
|
%{$fg_bold[yellow]%}%% %{$reset_color%}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
# Juan G. Hurtado oh-my-zsh theme
|
# Juan G. Hurtado oh-my-zsh theme
|
||||||
# (Needs Git plugin for current_branch method)
|
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
|
|
||||||
# Color shortcuts
|
# Color shortcuts
|
||||||
|
|
@ -16,31 +15,68 @@ WHITE_BOLD=$fg_bold[white]
|
||||||
BLUE_BOLD=$fg_bold[blue]
|
BLUE_BOLD=$fg_bold[blue]
|
||||||
RESET_COLOR=$reset_color
|
RESET_COLOR=$reset_color
|
||||||
|
|
||||||
# Format for git_prompt_info()
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
|
||||||
|
|
||||||
# Format for parse_git_dirty()
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)"
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
# Format for git_prompt_status()
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted"
|
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed"
|
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified"
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked"
|
|
||||||
|
|
||||||
# Format for git_prompt_ahead()
|
|
||||||
ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)"
|
|
||||||
|
|
||||||
# Format for git_prompt_long_sha() and git_prompt_short_sha()
|
|
||||||
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"
|
|
||||||
|
|
||||||
# Prompt format
|
# Prompt format
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%}
|
%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$GIT_PROMPT_INFO%{$RESET_COLOR%}
|
||||||
%{$BLUE%}>%{$RESET_COLOR%} '
|
%{$BLUE%}>%{$RESET_COLOR%} '
|
||||||
RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
|
RPROMPT='%{$GREEN_BOLD%}$GIT_RPROMPT_INFO%{$RESET_COLOR%}'
|
||||||
|
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
GIT_RPROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local dirty=''
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
dirty=" %{$RED%}(*)"
|
||||||
|
fi
|
||||||
|
git_prompt__upstream
|
||||||
|
if [[ "$GIT_PROMPT_UPSTREAM_STATE" != "=" ]]; then
|
||||||
|
local upstream=" %{$RED%}($GIT_PROMPT_UPSTREAM_STATE)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="$dirty$upstream"
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
local current_branch="$GIT_PROMPT_BRANCH"
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
current_branch="${current_branch}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
local sha=$(git rev-parse --short HEAD 2> /dev/null)
|
||||||
|
if [[ -n "$sha" ]]; then
|
||||||
|
sha=" %{$WHITE%}[%{$YELLOW%}$sha%{$WHITE%}]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local git_status=''
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
git_status="%{$GREEN%} added"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$YELLOW%} modified"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$YELLOW%} modified"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$RED%} deleted"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$RED%} deleted"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$YELLOW%} renamed"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$RED%} unmerged"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
git_status="${git_status}%{$WHITE%} untracked"
|
||||||
|
fi
|
||||||
|
GIT_RPROMPT_INFO="$current_branch$sha$git_status"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ function get_host {
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT='> '
|
PROMPT='> '
|
||||||
RPROMPT='%~$(git_prompt_info)$(get_host)'
|
RPROMPT='%~$GIT_PROMPT_INFO$(get_host)'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}"
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg[green]%}%c \
|
PROMPT='%{$fg[green]%}%c \
|
||||||
$(git_prompt_info)\
|
$GIT_PROMPT_INFO\
|
||||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
|
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
|
||||||
|
|
|
||||||
|
|
@ -6,45 +6,66 @@
|
||||||
# SCREENSHOT:
|
# SCREENSHOT:
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_COLORS" != "true" ]]; then
|
||||||
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
|
local R="%{$terminfo[sgr0]%}"
|
||||||
PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)]
|
local MAGENTA="%{$fg[magenta]%}"
|
||||||
%# '
|
local YELLOW="%{$fg[yellow]%}"
|
||||||
|
local GREEN="%{$fg[green]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
|
local BLUE="%{$fg[blue]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
local CYAN="%{$fg[cyan]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
local RED="%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
# display exitcode on the right when >0
|
|
||||||
return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
|
||||||
|
|
||||||
RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}'
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
|
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
|
|
||||||
else
|
|
||||||
PROMPT='[%n@%m:%~$(git_prompt_info)]
|
|
||||||
%# '
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on"
|
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
|
|
||||||
# display exitcode on the right when >0
|
|
||||||
return_code="%(?..%? ↵)"
|
|
||||||
|
|
||||||
RPROMPT='${return_code}$(git_prompt_status)'
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
|
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
|
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PROMPT='[$RED%n$R@$MAGENTA%m$R:$BLUE%~$R$GIT_PROMPT_INFO]
|
||||||
|
%# '
|
||||||
|
|
||||||
|
# display exitcode on the right when >0
|
||||||
|
return_code="%(?..$RED%? ↵$R)"
|
||||||
|
RPROMPT='${return_code}$GIT_RPROMPT_INFO$R'
|
||||||
|
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
GIT_RPROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local branch=''
|
||||||
|
|
||||||
|
git_prompt__branch
|
||||||
|
branch="$GIT_PROMPT_BRANCH"
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
branch="${branch}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO=" on $GREEN${branch}$R"
|
||||||
|
|
||||||
|
local rprompt=''
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
rprompt="$GREEN ✚"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$BLUE ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$BLUE ✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$RED ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$RED ✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$MAGENTA ➜"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$YELLOW ═"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
rprompt="${rprompt}$CYAN ✭"
|
||||||
|
fi
|
||||||
|
GIT_RPROMPT_INFO=$rprompt
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S
|
# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S
|
||||||
|
|
||||||
PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}'
|
PROMPT='λ %~/ $GIT_PROMPT_INFO%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b '
|
PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $GIT_PROMPT_INFO%{$reset_color%}%B»%b '
|
||||||
RPS1="${return_code}"
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
|
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $GIT_PROMPT_INFO%{$reset_color%}%B$%b '
|
||||||
RPS1="${return_code}"
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
|
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $GIT_PROMPT_INFO%{$reset_color%}%B$%b '
|
||||||
RPS1="${return_code}"
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Theme with full path names and hostname
|
# Theme with full path names and hostname
|
||||||
# Handy if you work on different servers all the time;
|
# Handy if you work on different servers all the time;
|
||||||
PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) '
|
PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $GIT_PROMPT_INFO %(!.#.$) '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:("
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg_bold[magenta]%}%1~$(git_prompt_info) %{$fg_bold[magenta]%}%# %{$reset_color%}'
|
PROMPT='%{$fg_bold[magenta]%}%1~$GIT_PROMPT_INFO %{$fg_bold[magenta]%}%# %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}["
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}["
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
7
themes/minimal.zsh-theme
Normal file
7
themes/minimal.zsh-theme
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
|
|
||||||
|
PROMPT='%2~ $GIT_PROMPT_INFO »%b '
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# '
|
PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# '
|
||||||
RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% '
|
RPROMPT='%{$fg_bold[green]%}$GIT_PROMPT_INFO%{$reset_color%}% '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
||||||
local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
|
local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
|
||||||
local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
|
local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
|
||||||
local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
|
local git_branch='%{$fg[blue]%}$GIT_PROMPT_INFO%{$reset_color%}'
|
||||||
|
|
||||||
PROMPT="${user_host}:${current_dir} ${rvm_ruby}
|
PROMPT="${user_host}:${current_dir} ${rvm_ruby}
|
||||||
${git_branch} %B$%b "
|
${git_branch} %B$%b "
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,71 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
local R="%{$terminfo[sgr0]%}"
|
||||||
|
#local return_code="%(?..%{$fg[red]%}%? ↵$R)"
|
||||||
|
|
||||||
setopt promptsubst
|
setopt promptsubst
|
||||||
|
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
|
|
||||||
PROMPT_SUCCESS_COLOR=$FG[117]
|
|
||||||
PROMPT_FAILURE_COLOR=$FG[124]
|
PROMPT_FAILURE_COLOR=$FG[124]
|
||||||
PROMPT_VCS_INFO_COLOR=$FG[242]
|
PROMPT_VCS_INFO_COLOR=$FG[242]
|
||||||
PROMPT_PROMPT=$FG[077]
|
PROMPT_PROMPT=$FG[077]
|
||||||
GIT_DIRTY_COLOR=$FG[133]
|
GIT_DIRTY_COLOR=$FG[133]
|
||||||
GIT_CLEAN_COLOR=$FG[118]
|
GIT_CLEAN_COLOR=$FG[118]
|
||||||
GIT_PROMPT_INFO=$FG[012]
|
GIT_PROMPT_DEFAULT=$FG[012]
|
||||||
|
|
||||||
PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
|
PROMPT='%{$FG[117]%}%~ $GIT_PROMPT_INFO $R%{$PROMPT_PROMPT%}ᐅ$R '
|
||||||
|
|
||||||
#RPS1="${return_code}"
|
#RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
git_prompt_info ()
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})"
|
{
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
|
GIT_PROMPT_INFO=''
|
||||||
|
GIT_RPROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}"
|
local branch=''
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
|
git_prompt__branch
|
||||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
|
branch="$GIT_PROMPT_BRANCH"
|
||||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
|
git_prompt__rebase_info
|
||||||
|
branch="${branch}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
local dirty=''
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
dirty=" %{$GIT_DIRTY_COLOR%}✘"
|
||||||
|
else
|
||||||
|
dirty=" %{$GIT_CLEAN_COLOR%}✔"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prompt="($R%{${branch}${dirty}${FG[012]})"
|
||||||
|
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[082]}✚"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[166]}✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[166]}✹"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[160]}✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[160]}✖"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[220]}➜"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[082]}═"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
prompt="${prompt}${FG[90]}✭"
|
||||||
|
fi
|
||||||
|
GIT_PROMPT_INFO="$prompt$R"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
PROMPT='%F{green}%2c%F{blue} [%f '
|
PROMPT='%F{green}%2c%F{blue} [%f '
|
||||||
RPROMPT='$(git_prompt_info) %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f'
|
RPROMPT='$GIT_PROMPT_INFO %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
|
||||||
|
|
|
||||||
11
themes/obraun.zsh-theme
Normal file
11
themes/obraun.zsh-theme
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
|
||||||
|
|
||||||
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
|
PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $GIT_PROMPT_INFO%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
|
||||||
|
|
||||||
|
RPS1="${return_code}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
||||||
|
|
||||||
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
|
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $GIT_PROMPT_INFO%(!.#.$) '
|
||||||
RPROMPT='[%*]'
|
RPROMPT='[%*]'
|
||||||
|
|
||||||
# git theming
|
# git theming
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%}
|
%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%}
|
||||||
$(git_prompt_info)%(!.#.$) '
|
$GIT_PROMPT_INFO%(!.#.$) '
|
||||||
RPROMPT='[%*]'
|
RPROMPT='[%*]'
|
||||||
|
|
||||||
# git theming
|
# git theming
|
||||||
|
|
|
||||||
45
themes/re5et.zsh-theme
Normal file
45
themes/re5et.zsh-theme
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
|
||||||
|
|
||||||
|
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$GIT_PROMPT_INFO
|
||||||
|
%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}'
|
||||||
|
|
||||||
|
RPS1='${return_code} %D - %*'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥"
|
||||||
|
|
||||||
|
git_prompt_info ()
|
||||||
|
{
|
||||||
|
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||||
|
GIT_PROMPT_INFO=''
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prompt=""
|
||||||
|
git_prompt__branch
|
||||||
|
prompt=$GIT_PROMPT_BRANCH
|
||||||
|
|
||||||
|
git_prompt__rebase_info
|
||||||
|
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||||
|
|
||||||
|
if [[ -n "$prompt" ]]; then
|
||||||
|
git_prompt__dirty_state
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||||
|
prompt="$prompt%{$fg_bold[red]%}±"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||||
|
prompt="$prompt%{$fg[cyan]%}?"
|
||||||
|
fi
|
||||||
|
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'no' ]]; then
|
||||||
|
prompt="$prompt%{$fg_bold[red]%}♥"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_PROMPT_INFO="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}$prompt%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%n@%m %{$fg[cyan]%}%~
|
%n@%m %{$fg[cyan]%}%~
|
||||||
%? $(git_prompt_info)%{$fg_bold[blue]%}%% %{$reset_color%}'
|
%? $GIT_PROMPT_INFO%{$fg_bold[blue]%}%% %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4:
|
# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4:
|
||||||
# It might be bash like, but I can't have my co-workers knowing I use zsh
|
# It might be bash like, but I can't have my co-workers knowing I use zsh
|
||||||
PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) '
|
PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $GIT_PROMPT_INFO%{$reset_color%}%(!.#.$) '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ function prompt_char {
|
||||||
RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
|
RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
|
%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$GIT_PROMPT_INFO
|
||||||
$(prompt_char) '
|
$(prompt_char) '
|
||||||
RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
|
RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue