mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh
This commit is contained in:
commit
a77a113f8f
78 changed files with 1487 additions and 209 deletions
21
MIT-LICENSE.txt
Normal file
21
MIT-LICENSE.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
@ -26,17 +26,20 @@ h3. The manual way
|
||||||
|
|
||||||
@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@
|
||||||
|
|
||||||
2. Create a new zsh config by copying the zsh template we've provided.
|
2. *OPTIONAL* Backup your existing ~/.zshrc file
|
||||||
|
|
||||||
*NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
|
@cp ~/.zshrc ~/.zshrc.orig@
|
||||||
|
|
||||||
|
3. Create a new zsh config by copying the zsh template we've provided.
|
||||||
|
|
||||||
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
|
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
|
||||||
|
|
||||||
3. Set zsh as your default shell:
|
|
||||||
|
4. Set zsh as your default shell:
|
||||||
|
|
||||||
@chsh -s /bin/zsh@
|
@chsh -s /bin/zsh@
|
||||||
|
|
||||||
4. Start / restart zsh (open a new terminal is easy enough...)
|
5. Start / restart zsh (open a new terminal is easy enough...)
|
||||||
|
|
||||||
h3. Problems?
|
h3. Problems?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ alias -- -='cd -'
|
||||||
|
|
||||||
# Super user
|
# Super user
|
||||||
alias _='sudo'
|
alias _='sudo'
|
||||||
|
alias please='sudo'
|
||||||
|
|
||||||
#alias g='grep -in'
|
#alias g='grep -in'
|
||||||
|
|
||||||
|
|
@ -16,8 +17,9 @@ alias history='fc -l 1'
|
||||||
|
|
||||||
# List direcory contents
|
# List direcory contents
|
||||||
alias lsa='ls -lah'
|
alias lsa='ls -lah'
|
||||||
alias l='ls -la'
|
alias l='ls -lA1'
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
|
alias la='ls -lA'
|
||||||
alias sl=ls # often screw this up
|
alias sl=ls # often screw this up
|
||||||
|
|
||||||
alias afind='ack-grep -il'
|
alias afind='ack-grep -il'
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
|
||||||
cdpath=(.)
|
cdpath=(.)
|
||||||
|
|
||||||
# use /etc/hosts and known_hosts for hostname completion
|
# use /etc/hosts and known_hosts for hostname completion
|
||||||
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
|
||||||
[ -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=(
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ cd () {
|
||||||
elif [[ "x$*" == "x...." ]]; then
|
elif [[ "x$*" == "x...." ]]; then
|
||||||
cd ../../..
|
cd ../../..
|
||||||
elif [[ "x$*" == "x....." ]]; then
|
elif [[ "x$*" == "x....." ]]; then
|
||||||
cd ../../..
|
|
||||||
elif [[ "x$*" == "x......" ]]; then
|
|
||||||
cd ../../../..
|
cd ../../../..
|
||||||
|
elif [[ "x$*" == "x......" ]]; then
|
||||||
|
cd ../../../../..
|
||||||
else
|
else
|
||||||
builtin cd "$@"
|
builtin cd "$@"
|
||||||
fi
|
fi
|
||||||
|
|
@ -37,8 +37,3 @@ cd () {
|
||||||
alias md='mkdir -p'
|
alias md='mkdir -p'
|
||||||
alias rd=rmdir
|
alias rd=rmdir
|
||||||
alias d='dirs -v | head -10'
|
alias d='dirs -v | head -10'
|
||||||
|
|
||||||
# mkdir & cd to it
|
|
||||||
function mcd() {
|
|
||||||
mkdir -p "$1" && cd "$1";
|
|
||||||
}
|
|
||||||
|
|
|
||||||
40
lib/git.zsh
40
lib/git.zsh
|
|
@ -1,6 +1,7 @@
|
||||||
# get the name of the branch we are on
|
# get the name of the branch we are on
|
||||||
function git_prompt_info() {
|
function git_prompt_info() {
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8,6 +9,7 @@ function git_prompt_info() {
|
||||||
# Checks if working tree is dirty
|
# Checks if working tree is dirty
|
||||||
parse_git_dirty() {
|
parse_git_dirty() {
|
||||||
local SUBMODULE_SYNTAX=''
|
local SUBMODULE_SYNTAX=''
|
||||||
|
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
||||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||||
fi
|
fi
|
||||||
|
|
@ -16,8 +18,28 @@ parse_git_dirty() {
|
||||||
else
|
else
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get the difference between the local and remote branches
|
||||||
|
git_remote_status() {
|
||||||
|
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||||
|
if [[ -n ${remote} ]] ; then
|
||||||
|
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||||
|
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
||||||
|
|
||||||
|
if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
|
||||||
|
then
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
|
||||||
|
elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
|
||||||
|
elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
|
||||||
|
then
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Checks if there are commits ahead from remote
|
# Checks if there are commits ahead from remote
|
||||||
function git_prompt_ahead() {
|
function git_prompt_ahead() {
|
||||||
|
|
@ -38,7 +60,7 @@ function git_prompt_long_sha() {
|
||||||
|
|
||||||
# Get the status of the working tree
|
# Get the status of the working tree
|
||||||
git_prompt_status() {
|
git_prompt_status() {
|
||||||
INDEX=$(git status --porcelain 2> /dev/null)
|
INDEX=$(git status --porcelain -b 2> /dev/null)
|
||||||
STATUS=""
|
STATUS=""
|
||||||
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
||||||
|
|
@ -60,12 +82,26 @@ git_prompt_status() {
|
||||||
fi
|
fi
|
||||||
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
|
||||||
|
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
|
||||||
|
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
|
||||||
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
|
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
|
||||||
fi
|
fi
|
||||||
|
if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
|
||||||
|
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
|
||||||
|
fi
|
||||||
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
||||||
fi
|
fi
|
||||||
|
if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
|
||||||
|
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
|
||||||
|
fi
|
||||||
|
if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
|
||||||
|
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
|
||||||
|
fi
|
||||||
|
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
|
||||||
|
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
|
||||||
|
fi
|
||||||
echo $STATUS
|
echo $STATUS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
|
||||||
setopt long_list_jobs
|
setopt long_list_jobs
|
||||||
|
|
||||||
## pager
|
## pager
|
||||||
export PAGER="less -R"
|
export PAGER="less"
|
||||||
|
export LESS="-R"
|
||||||
|
|
||||||
export LC_CTYPE=$LANG
|
export LC_CTYPE=$LANG
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
# get the name of the branch we are on
|
# get the name of the ruby version
|
||||||
function rvm_prompt_info() {
|
function rvm_prompt_info() {
|
||||||
ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
|
[ -f $HOME/.rvm/bin/rvm-prompt ] || return
|
||||||
[[ ! -z $ruby_version ]] && echo "($ruby_version)"
|
local rvm_prompt
|
||||||
|
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
|
||||||
|
[[ "${rvm_prompt}x" == "x" ]] && return
|
||||||
|
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ function omz_termsupport_precmd {
|
||||||
function omz_termsupport_preexec {
|
function omz_termsupport_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
|
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
|
||||||
title "$CMD" "%100>...>$2%<<"
|
title "$CMD" "%100>...>${2:gs/%/%%}%<<"
|
||||||
}
|
}
|
||||||
|
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
|
||||||
|
|
||||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
||||||
# TIP: Add files you don't want in git to .gitignore
|
# TIP: Add files you don't want in git to .gitignore
|
||||||
for config_file ($ZSH/lib/*.zsh) source $config_file
|
for config_file ($ZSH/lib/*.zsh); do
|
||||||
|
source $config_file
|
||||||
|
done
|
||||||
|
|
||||||
# Set ZSH_CUSTOM to the path where your custom config files
|
# Set ZSH_CUSTOM to the path where your custom config files
|
||||||
# and plugins exists, or else we will use the default custom/
|
# and plugins exists, or else we will use the default custom/
|
||||||
|
|
@ -51,7 +53,10 @@ for plugin ($plugins); do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load all of your custom configurations from custom/
|
# Load all of your custom configurations from custom/
|
||||||
for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
|
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
|
||||||
|
source $config_file
|
||||||
|
done
|
||||||
|
unset config_file
|
||||||
|
|
||||||
# Load the theme
|
# Load the theme
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
if [ "$ZSH_THEME" = "random" ]
|
||||||
|
|
|
||||||
|
|
@ -75,3 +75,19 @@ pacdisowned() {
|
||||||
|
|
||||||
comm -23 "$fs" "$db"
|
comm -23 "$fs" "$db"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pacmanallkeys() {
|
||||||
|
# Get all keys for developers and trusted users
|
||||||
|
curl https://www.archlinux.org/{developers,trustedusers}/ |
|
||||||
|
awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
|
||||||
|
xargs sudo pacman-key --recv-keys
|
||||||
|
}
|
||||||
|
|
||||||
|
pacmansignkeys() {
|
||||||
|
for key in $*; do
|
||||||
|
sudo pacman-key --recv-keys $key
|
||||||
|
sudo pacman-key --lsign-key $key
|
||||||
|
printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
|
||||||
|
--no-permission-warning --command-fd 0 --edit-key $key
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
|
||||||
. /usr/share/autojump/autojump.zsh
|
. /usr/share/autojump/autojump.zsh
|
||||||
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
|
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
|
||||||
. /etc/profile.d/autojump.zsh
|
. /etc/profile.d/autojump.zsh
|
||||||
|
elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
|
||||||
|
. $HOME/.autojump/etc/profile.d/autojump.zsh
|
||||||
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
|
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
|
||||||
. /opt/local/etc/profile.d/autojump.zsh
|
. /opt/local/etc/profile.d/autojump.zsh
|
||||||
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
|
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,53 @@
|
||||||
|
###########################################
|
||||||
|
# Battery plugin for oh-my-zsh #
|
||||||
|
# Original Author: Peter hoeg (peterhoeg) #
|
||||||
|
# Email: peter@speartail.com #
|
||||||
|
###########################################
|
||||||
|
# Author: Sean Jones (neuralsandwich) #
|
||||||
|
# Email: neuralsandwich@gmail.com #
|
||||||
|
# Modified to add support for Apple Mac #
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
if [[ $(uname) == "Darwin" ]] ; then
|
||||||
|
|
||||||
|
function battery_pct_remaining() {
|
||||||
|
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||||
|
typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
|
||||||
|
typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
|
||||||
|
integer i=$(((currentcapacity/maxcapacity) * 100))
|
||||||
|
echo $i
|
||||||
|
else
|
||||||
|
echo "External Power"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function battery_time_remaining() {
|
||||||
|
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||||
|
timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
|
||||||
|
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
|
||||||
|
else
|
||||||
|
echo "∞"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function battery_pct_prompt () {
|
||||||
|
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||||
|
b=$(battery_pct_remaining)
|
||||||
|
if [ $b -gt 50 ] ; then
|
||||||
|
color='green'
|
||||||
|
elif [ $b -gt 20 ] ; then
|
||||||
|
color='yellow'
|
||||||
|
else
|
||||||
|
color='red'
|
||||||
|
fi
|
||||||
|
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elif [[ $(uname) == "Linux" ]] ; then
|
||||||
|
|
||||||
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
|
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
|
||||||
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
|
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
|
||||||
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
||||||
|
|
@ -18,3 +68,4 @@ else
|
||||||
function battery_time_remaining() { echo $error_msg }
|
function battery_time_remaining() { echo $error_msg }
|
||||||
function battery_pct_prompt() { echo '' }
|
function battery_pct_prompt() { echo '' }
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ alias bu="bundle update"
|
||||||
|
|
||||||
# The following is based on https://github.com/gma/bundler-exec
|
# The following is based on https://github.com/gma/bundler-exec
|
||||||
|
|
||||||
bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
|
bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus)
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
|
|
@ -33,6 +33,7 @@ _run-with-bundler() {
|
||||||
|
|
||||||
## Main program
|
## Main program
|
||||||
for cmd in $bundled_commands; do
|
for cmd in $bundled_commands; do
|
||||||
|
eval "function unbundled_$cmd () { $cmd \$@ }"
|
||||||
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
|
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
|
||||||
alias $cmd=bundled_$cmd
|
alias $cmd=bundled_$cmd
|
||||||
|
|
||||||
|
|
|
||||||
13
plugins/bwana/bwana.plugin.zsh
Normal file
13
plugins/bwana/bwana.plugin.zsh
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#
|
||||||
|
# Requires http://www.bruji.com/bwana/
|
||||||
|
#
|
||||||
|
if [[ -e /Applications/Bwana.app ]] ||
|
||||||
|
( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
|
||||||
|
then
|
||||||
|
function man() {
|
||||||
|
open "man:$1"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
echo "Bwana lets you read man files in Safari through a man: URI scheme"
|
||||||
|
echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
|
||||||
|
fi
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
stat -f%m . > /dev/null 2>&1
|
|
||||||
if [ "$?" = 0 ]; then
|
|
||||||
stat_cmd=(stat -f%m)
|
|
||||||
else
|
|
||||||
stat_cmd=(stat -L --format=%y)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cache filename
|
|
||||||
_cap_show_undescribed_tasks=0
|
|
||||||
|
|
||||||
# Cache filename
|
|
||||||
_cap_task_cache_file='.cap_task_cache'
|
|
||||||
|
|
||||||
_cap_get_task_list () {
|
|
||||||
if [ ${_cap_show_undescribed_tasks} -eq 0 ]; then
|
|
||||||
cap -T | grep '^cap' | cut -d " " -f 2
|
|
||||||
else
|
|
||||||
cap -vT | grep '^cap' | cut -d " " -f 2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_cap_does_task_list_need_generating () {
|
|
||||||
|
|
||||||
if [ ! -f ${_cap_task_cache_file} ]; then return 0;
|
|
||||||
else
|
|
||||||
accurate=$($stat_cmd $_cap_task_cache_file)
|
|
||||||
changed=$($stat_cmd config/deploy.rb)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function _cap () {
|
|
||||||
if [ -f config/deploy.rb ]; then
|
|
||||||
if _cap_does_task_list_need_generating; then
|
|
||||||
_cap_get_task_list > ${_cap_task_cache_file}
|
|
||||||
fi
|
|
||||||
compadd `cat ${_cap_task_cache_file}`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
compdef _cap cap
|
|
||||||
10
plugins/capistrano/_capistrano
Normal file
10
plugins/capistrano/_capistrano
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#compdef cap
|
||||||
|
#autoload
|
||||||
|
|
||||||
|
if [ -f config/deploy.rb ]; then
|
||||||
|
if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
|
||||||
|
echo "\nGenerating .cap_tasks~..." > /dev/stderr
|
||||||
|
cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
|
||||||
|
fi
|
||||||
|
compadd `cat .cap_tasks~`
|
||||||
|
fi
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
# as seen in http://www.porcheron.info/command-not-found-for-zsh/
|
# as seen in http://www.porcheron.info/command-not-found-for-zsh/
|
||||||
# this is installed in Ubuntu
|
# this is installed in Ubuntu
|
||||||
|
|
||||||
source /etc/zsh_command_not_found
|
[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
|
||||||
|
|
|
||||||
14
plugins/cp/cp.plugin.zsh
Normal file
14
plugins/cp/cp.plugin.zsh
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#Show progress while file is copying
|
||||||
|
|
||||||
|
# Rsync options are:
|
||||||
|
# -p - preserve permissions
|
||||||
|
# -o - preserve owner
|
||||||
|
# -g - preserve group
|
||||||
|
# -h - output in human-readable format
|
||||||
|
# --progress - display progress
|
||||||
|
# -b - instead of just overwriting an existing file, save the original
|
||||||
|
# --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
|
||||||
|
# -e /dev/null - only work on local files
|
||||||
|
# -- - everything after this is an argument, even if it looks like an option
|
||||||
|
|
||||||
|
alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"
|
||||||
|
|
@ -6,14 +6,14 @@
|
||||||
|
|
||||||
# Use aptitude if installed, or apt-get if not.
|
# Use aptitude if installed, or apt-get if not.
|
||||||
# You can just set apt_pref='apt-get' to override it.
|
# You can just set apt_pref='apt-get' to override it.
|
||||||
if [[ -e $( which aptitude ) ]]; then
|
if [[ -e $( which aptitude 2>&1 ) ]]; then
|
||||||
apt_pref='aptitude'
|
apt_pref='aptitude'
|
||||||
else
|
else
|
||||||
apt_pref='apt-get'
|
apt_pref='apt-get'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use sudo by default if it's installed
|
# Use sudo by default if it's installed
|
||||||
if [[ -e $( which sudo ) ]]; then
|
if [[ -e $( which sudo 2>&1 ) ]]; then
|
||||||
use_sudo=1
|
use_sudo=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ fi
|
||||||
# These are for more obscure uses of apt-get and aptitude that aren't covered
|
# These are for more obscure uses of apt-get and aptitude that aren't covered
|
||||||
# below.
|
# below.
|
||||||
alias ag='apt-get'
|
alias ag='apt-get'
|
||||||
alias at='aptitude'
|
alias ap='aptitude'
|
||||||
|
|
||||||
# Some self-explanatory aliases
|
# Some self-explanatory aliases
|
||||||
alias acs="apt-cache search"
|
alias acs="apt-cache search"
|
||||||
|
|
@ -35,7 +35,7 @@ alias afs='apt-file search --regexp'
|
||||||
|
|
||||||
# These are apt-get only
|
# These are apt-get only
|
||||||
alias asrc='apt-get source'
|
alias asrc='apt-get source'
|
||||||
alias ap='apt-cache policy'
|
alias app='apt-cache policy'
|
||||||
|
|
||||||
# superuser operations ######################################################
|
# superuser operations ######################################################
|
||||||
if [[ $use_sudo -eq 1 ]]; then
|
if [[ $use_sudo -eq 1 ]]; then
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
encode64(){ echo -n $1 | base64 }
|
encode64(){ echo -n $1 | base64 }
|
||||||
decode64(){ echo -n $1 | base64 -D }
|
decode64(){ echo -n $1 | base64 -D }
|
||||||
|
alias e64=encode64
|
||||||
|
alias d64=decode64
|
||||||
|
|
|
||||||
44
plugins/forklift/forklift.plugin.zsh
Normal file
44
plugins/forklift/forklift.plugin.zsh
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# Open folder in ForkLift.app from console
|
||||||
|
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# fl [<folder>]
|
||||||
|
#
|
||||||
|
# Opens specified directory or current working directory in ForkLift.app
|
||||||
|
#
|
||||||
|
# Notes:
|
||||||
|
# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new
|
||||||
|
# app window.
|
||||||
|
#
|
||||||
|
# https://gist.github.com/3313481
|
||||||
|
function fl {
|
||||||
|
if [ ! -z "$1" ]; then
|
||||||
|
DIR=$1
|
||||||
|
if [ ! -d "$DIR" ]; then
|
||||||
|
DIR=$(dirname $DIR)
|
||||||
|
fi
|
||||||
|
if [ "$DIR" != "." ]; then
|
||||||
|
PWD=`cd "$DIR";pwd`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
osascript 2>&1 1>/dev/null <<END
|
||||||
|
tell application "ForkLift"
|
||||||
|
activate
|
||||||
|
end tell
|
||||||
|
tell application "System Events"
|
||||||
|
tell application process "ForkLift"
|
||||||
|
try
|
||||||
|
set topWindow to window 1
|
||||||
|
on error
|
||||||
|
keystroke "n" using command down
|
||||||
|
set topWindow to window 1
|
||||||
|
end try
|
||||||
|
keystroke "g" using {command down, shift down}
|
||||||
|
tell sheet 1 of topWindow
|
||||||
|
set value of text field 1 to "$PWD"
|
||||||
|
keystroke return
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
END
|
||||||
|
}
|
||||||
285
plugins/git-extras/git-extras.plugin.zsh
Normal file
285
plugins/git-extras/git-extras.plugin.zsh
Normal file
|
|
@ -0,0 +1,285 @@
|
||||||
|
#compdef git
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Description
|
||||||
|
# -----------
|
||||||
|
#
|
||||||
|
# Completion script for git-extras (http://github.com/visionmedia/git-extras).
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Authors
|
||||||
|
# -------
|
||||||
|
#
|
||||||
|
# * Alexis GRIMALDI (https://github.com/agrimaldi)
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Inspirations
|
||||||
|
# -----------
|
||||||
|
#
|
||||||
|
# * git-extras (http://github.com/visionmedia/git-extras)
|
||||||
|
# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
__git_command_successful () {
|
||||||
|
if (( ${#pipestatus:#0} > 0 )); then
|
||||||
|
_message 'not a git repository'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_tag_names() {
|
||||||
|
local expl
|
||||||
|
declare -a tag_names
|
||||||
|
tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted tag-names expl tag-name compadd $* - $tag_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_branch_names() {
|
||||||
|
local expl
|
||||||
|
declare -a branch_names
|
||||||
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_feature_branch_names() {
|
||||||
|
local expl
|
||||||
|
declare -a branch_names
|
||||||
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_refactor_branch_names() {
|
||||||
|
local expl
|
||||||
|
declare -a branch_names
|
||||||
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_bug_branch_names() {
|
||||||
|
local expl
|
||||||
|
declare -a branch_names
|
||||||
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_submodule_names() {
|
||||||
|
local expl
|
||||||
|
declare -a submodule_names
|
||||||
|
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__git_author_names() {
|
||||||
|
local expl
|
||||||
|
declare -a author_names
|
||||||
|
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
|
||||||
|
__git_command_successful || return
|
||||||
|
_wanted author-names expl author-name compadd $* - $author_names
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-changelog() {
|
||||||
|
_arguments \
|
||||||
|
'(-l --list)'{-l,--list}'[list commits]' \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-effort() {
|
||||||
|
_arguments \
|
||||||
|
'--above[ignore file with less than x commits]' \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-contrib() {
|
||||||
|
_arguments \
|
||||||
|
':author:__git_author_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-count() {
|
||||||
|
_arguments \
|
||||||
|
'--all[detailed commit count]'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-delete-branch() {
|
||||||
|
_arguments \
|
||||||
|
':branch-name:__git_branch_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-delete-submodule() {
|
||||||
|
_arguments \
|
||||||
|
':submodule-name:__git_submodule_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-delete-tag() {
|
||||||
|
_arguments \
|
||||||
|
':tag-name:__git_tag_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-extras() {
|
||||||
|
local curcontext=$curcontext state line ret=1
|
||||||
|
declare -A opt_args
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
': :->command' \
|
||||||
|
'*:: :->option-or-argument' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
(command)
|
||||||
|
declare -a commands
|
||||||
|
commands=(
|
||||||
|
'update:update git-extras'
|
||||||
|
)
|
||||||
|
_describe -t commands command commands && ret=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'(-v --version)'{-v,--version}'[show current version]' \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-graft() {
|
||||||
|
_arguments \
|
||||||
|
':src-branch-name:__git_branch_names' \
|
||||||
|
':dest-branch-name:__git_branch_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-squash() {
|
||||||
|
_arguments \
|
||||||
|
':branch-name:__git_branch_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-feature() {
|
||||||
|
local curcontext=$curcontext state line ret=1
|
||||||
|
declare -A opt_args
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
': :->command' \
|
||||||
|
'*:: :->option-or-argument' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
(command)
|
||||||
|
declare -a commands
|
||||||
|
commands=(
|
||||||
|
'finish:merge feature into the current branch'
|
||||||
|
)
|
||||||
|
_describe -t commands command commands && ret=0
|
||||||
|
;;
|
||||||
|
(option-or-argument)
|
||||||
|
curcontext=${curcontext%:*}-$line[1]:
|
||||||
|
case $line[1] in
|
||||||
|
(finish)
|
||||||
|
_arguments -C \
|
||||||
|
':branch-name:__git_feature_branch_names'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-refactor() {
|
||||||
|
local curcontext=$curcontext state line ret=1
|
||||||
|
declare -A opt_args
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
': :->command' \
|
||||||
|
'*:: :->option-or-argument' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
(command)
|
||||||
|
declare -a commands
|
||||||
|
commands=(
|
||||||
|
'finish:merge refactor into the current branch'
|
||||||
|
)
|
||||||
|
_describe -t commands command commands && ret=0
|
||||||
|
;;
|
||||||
|
(option-or-argument)
|
||||||
|
curcontext=${curcontext%:*}-$line[1]:
|
||||||
|
case $line[1] in
|
||||||
|
(finish)
|
||||||
|
_arguments -C \
|
||||||
|
':branch-name:__git_refactor_branch_names'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_git-bug() {
|
||||||
|
local curcontext=$curcontext state line ret=1
|
||||||
|
declare -A opt_args
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
': :->command' \
|
||||||
|
'*:: :->option-or-argument' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
(command)
|
||||||
|
declare -a commands
|
||||||
|
commands=(
|
||||||
|
'finish:merge bug into the current branch'
|
||||||
|
)
|
||||||
|
_describe -t commands command commands && ret=0
|
||||||
|
;;
|
||||||
|
(option-or-argument)
|
||||||
|
curcontext=${curcontext%:*}-$line[1]:
|
||||||
|
case $line[1] in
|
||||||
|
(finish)
|
||||||
|
_arguments -C \
|
||||||
|
':branch-name:__git_bug_branch_names'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
zstyle ':completion:*:*:git:*' user-commands \
|
||||||
|
changelog:'populate changelog file with commits since the previous tag' \
|
||||||
|
contrib:'display author contributions' \
|
||||||
|
count:'count commits' \
|
||||||
|
delete-branch:'delete local and remote branch' \
|
||||||
|
delete-submodule:'delete submodule' \
|
||||||
|
delete-tag:'delete local and remote tag' \
|
||||||
|
extras:'git-extras' \
|
||||||
|
graft:'merge commits from source branch to destination branch' \
|
||||||
|
squash:'merge commits from source branch into the current one as a single commit' \
|
||||||
|
feature:'create a feature branch' \
|
||||||
|
refactor:'create a refactor branch' \
|
||||||
|
bug:'create a bug branch' \
|
||||||
|
summary:'repository summary' \
|
||||||
|
effort:'display effort statistics' \
|
||||||
|
repl:'read-eval-print-loop' \
|
||||||
|
commits-since:'list commits since a given date' \
|
||||||
|
release:'release commit with the given tag' \
|
||||||
|
alias:'define, search and show aliases' \
|
||||||
|
ignore:'add patterns to .gitignore' \
|
||||||
|
info:'show info about the repository' \
|
||||||
|
create-branch:'create local and remote branch' \
|
||||||
|
fresh-branch:'create empty local branch' \
|
||||||
|
undo:'remove the latest commit' \
|
||||||
|
setup:'setup a git repository' \
|
||||||
|
touch:'one step creation of new files' \
|
||||||
|
obliterate:'Completely remove a file from the repository, including past commits and tags' \
|
||||||
|
local-commits:'list unpushed commits on the local branch' \
|
||||||
|
|
@ -221,6 +221,7 @@ __git-flow-feature ()
|
||||||
_arguments \
|
_arguments \
|
||||||
-F'[Fetch from origin before performing finish]' \
|
-F'[Fetch from origin before performing finish]' \
|
||||||
-r'[Rebase instead of merge]'\
|
-r'[Rebase instead of merge]'\
|
||||||
|
-k'[Keep branch after performing finish]'\
|
||||||
':feature:__git_flow_feature_list'
|
':feature:__git_flow_feature_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -236,13 +237,13 @@ __git-flow-feature ()
|
||||||
|
|
||||||
(diff)
|
(diff)
|
||||||
_arguments \
|
_arguments \
|
||||||
':branch:__git_branch_names'\
|
':branch:__git_flow_feature_list'\
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(rebase)
|
(rebase)
|
||||||
_arguments \
|
_arguments \
|
||||||
-i'[Do an interactive rebase]' \
|
-i'[Do an interactive rebase]' \
|
||||||
':branch:__git_branch_names'
|
':branch:__git_flow_feature_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(checkout)
|
(checkout)
|
||||||
|
|
@ -253,7 +254,7 @@ __git-flow-feature ()
|
||||||
(pull)
|
(pull)
|
||||||
_arguments \
|
_arguments \
|
||||||
':remote:__git_remotes'\
|
':remote:__git_remotes'\
|
||||||
':branch:__git_branch_names'
|
':branch:__git_flow_feature_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
|
||||||
18
plugins/git-remote-branch/git-remote-branch.plugin.zsh
Normal file
18
plugins/git-remote-branch/git-remote-branch.plugin.zsh
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
_git_remote_branch() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null)
|
||||||
|
if [[ -n $ref ]]; then
|
||||||
|
if (( CURRENT == 2 )); then
|
||||||
|
# first arg: operation
|
||||||
|
compadd create publish rename delete track
|
||||||
|
elif (( CURRENT == 3 )); then
|
||||||
|
# second arg: remote branch name
|
||||||
|
compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
|
||||||
|
elif (( CURRENT == 4 )); then
|
||||||
|
# third arg: remote name
|
||||||
|
compadd `git remote`
|
||||||
|
fi
|
||||||
|
else;
|
||||||
|
_files
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
compdef _git_remote_branch grb
|
||||||
|
|
@ -9,6 +9,7 @@ alias gup='git pull --rebase'
|
||||||
compdef _git gup=git-fetch
|
compdef _git gup=git-fetch
|
||||||
alias gp='git push'
|
alias gp='git push'
|
||||||
compdef _git gp=git-push
|
compdef _git gp=git-push
|
||||||
|
alias gd='git diff'
|
||||||
gdv() { git diff -w "$@" | view - }
|
gdv() { git diff -w "$@" | view - }
|
||||||
compdef _git gdv=git-diff
|
compdef _git gdv=git-diff
|
||||||
alias gc='git commit -v'
|
alias gc='git commit -v'
|
||||||
|
|
@ -18,18 +19,33 @@ compdef _git gca=git-commit
|
||||||
alias gco='git checkout'
|
alias gco='git checkout'
|
||||||
compdef _git gco=git-checkout
|
compdef _git gco=git-checkout
|
||||||
alias gcm='git checkout master'
|
alias gcm='git checkout master'
|
||||||
|
alias gr='git remote'
|
||||||
|
compdef _git gr=git-remote
|
||||||
|
alias grv='git remote -v'
|
||||||
|
compdef _git grv=git-remote
|
||||||
|
alias grmv='git remote rename'
|
||||||
|
compdef _git grmv=git-remote
|
||||||
|
alias grrm='git remote remove'
|
||||||
|
compdef _git grrm=git-remote
|
||||||
|
alias grset='git remote set-url'
|
||||||
|
compdef _git grset=git-remote
|
||||||
|
alias grup='git remote update'
|
||||||
|
compdef _git grset=git-remote
|
||||||
alias gb='git branch'
|
alias gb='git branch'
|
||||||
compdef _git gb=git-branch
|
compdef _git gb=git-branch
|
||||||
alias gba='git branch -a'
|
alias gba='git branch -a'
|
||||||
compdef _git gba=git-branch
|
compdef _git gba=git-branch
|
||||||
alias gcount='git shortlog -sn'
|
alias gcount='git shortlog -sn'
|
||||||
compdef gcount=git
|
compdef gcount=git
|
||||||
|
alias gcl='git config --list'
|
||||||
alias gcp='git cherry-pick'
|
alias gcp='git cherry-pick'
|
||||||
compdef _git gcp=git-cherry-pick
|
compdef _git gcp=git-cherry-pick
|
||||||
alias glg='git log --stat --max-count=5'
|
alias glg='git log --stat --max-count=5'
|
||||||
compdef _git glg=git-log
|
compdef _git glg=git-log
|
||||||
alias glgg='git log --graph --max-count=5'
|
alias glgg='git log --graph --max-count=5'
|
||||||
compdef _git glgg=git-log
|
compdef _git glgg=git-log
|
||||||
|
alias glgga='git log --graph --decorate --all'
|
||||||
|
compdef _git glgga=git-log
|
||||||
alias gss='git status -s'
|
alias gss='git status -s'
|
||||||
compdef _git gss=git-status
|
compdef _git gss=git-status
|
||||||
alias ga='git add'
|
alias ga='git add'
|
||||||
|
|
@ -39,6 +55,8 @@ compdef _git gm=git-merge
|
||||||
alias grh='git reset HEAD'
|
alias grh='git reset HEAD'
|
||||||
alias grhh='git reset HEAD --hard'
|
alias grhh='git reset HEAD --hard'
|
||||||
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
|
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
|
||||||
|
alias gf='git ls-files | grep'
|
||||||
|
alias gpoat='git push origin --all && git push origin --tags'
|
||||||
|
|
||||||
# Will cd into the top of the current repository
|
# Will cd into the top of the current repository
|
||||||
# or submodule.
|
# or submodule.
|
||||||
|
|
@ -55,13 +73,14 @@ alias gsd='git svn dcommit'
|
||||||
# Usage example: git pull origin $(current_branch)
|
# Usage example: git pull origin $(current_branch)
|
||||||
#
|
#
|
||||||
function current_branch() {
|
function current_branch() {
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
echo ${ref#refs/heads/}
|
echo ${ref#refs/heads/}
|
||||||
}
|
}
|
||||||
|
|
||||||
function current_repository() {
|
function current_repository() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
echo $(git remote -v | cut -d':' -f 2)
|
echo $(git remote -v | cut -d':' -f 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ exist_gh() { # [DIRECTORY]
|
||||||
cd "$1"
|
cd "$1"
|
||||||
name=$( git config user.name )
|
name=$( git config user.name )
|
||||||
ghuser=$( git config github.user )
|
ghuser=$( git config github.user )
|
||||||
|
repo=$1
|
||||||
|
|
||||||
git remote add origin git@github.com:${ghuser}/${repo}.git
|
git remote add origin git@github.com:${ghuser}/${repo}.git
|
||||||
git push -u origin master
|
git push -u origin master
|
||||||
|
|
|
||||||
8
plugins/history/history.plugin.zsh
Normal file
8
plugins/history/history.plugin.zsh
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
alias h='history'
|
||||||
|
|
||||||
|
function hs
|
||||||
|
{
|
||||||
|
history | grep $*
|
||||||
|
}
|
||||||
|
|
||||||
|
alias hsi='hs -i'
|
||||||
|
|
@ -1,20 +1,36 @@
|
||||||
# To use: add a .jira-url file in the base of your project
|
# To use: add a .jira-url file in the base of your project
|
||||||
|
# You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
|
||||||
|
# .jira-url in the current directory takes precedence
|
||||||
|
#
|
||||||
|
# If you use Rapid Board, set:
|
||||||
|
#JIRA_RAPID_BOARD="yes"
|
||||||
|
# in you .zshrc
|
||||||
|
#
|
||||||
# Setup: cd to/my/project
|
# Setup: cd to/my/project
|
||||||
# echo "https://name.jira.com" >> .jira-url
|
# echo "https://name.jira.com" >> .jira-url
|
||||||
# Usage: jira # opens a new issue
|
# Usage: jira # opens a new issue
|
||||||
# jira ABC-123 # Opens an existing issue
|
# jira ABC-123 # Opens an existing issue
|
||||||
open_jira_issue () {
|
open_jira_issue () {
|
||||||
if [ ! -f .jira-url ]; then
|
if [ -f .jira-url ]; then
|
||||||
echo "There is no .jira-url file in the current directory..."
|
jira_url=$(cat .jira-url)
|
||||||
return 0;
|
elif [ -f ~/.jira-url ]; then
|
||||||
|
jira_url=$(cat ~/.jira-url)
|
||||||
|
elif [[ "x$JIRA_URL" != "x" ]]; then
|
||||||
|
jira_url=$JIRA_URL
|
||||||
else
|
else
|
||||||
jira_url=$(cat .jira-url);
|
echo "JIRA url is not specified anywhere."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Opening new issue";
|
echo "Opening new issue"
|
||||||
`open $jira_url/secure/CreateIssue!default.jspa`;
|
`open $jira_url/secure/CreateIssue!default.jspa`
|
||||||
else
|
else
|
||||||
echo "Opening issue #$1";
|
echo "Opening issue #$1"
|
||||||
`open $jira_url/browse/$1`;
|
if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
|
||||||
|
`open $jira_url/issues/$1`
|
||||||
|
else
|
||||||
|
`open $jira_url/browse/$1`
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,11 @@ _chef_environments_remote() {
|
||||||
|
|
||||||
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
|
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
|
||||||
_chef_cookbooks_local() {
|
_chef_cookbooks_local() {
|
||||||
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
|
local knife_rb="$HOME/.chef/knife.rb"
|
||||||
|
if [ -f ./.chef/knife.rb ]; then
|
||||||
|
knife_rb="./.chef/knife.rb"
|
||||||
|
fi
|
||||||
|
(for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function extracts the available cookbook versions on the chef server
|
# This function extracts the available cookbook versions on the chef server
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
# Flag indicating if we've previously jumped to last directory.
|
# Flag indicating if we've previously jumped to last directory.
|
||||||
typeset -g ZSH_LAST_WORKING_DIRECTORY
|
typeset -g ZSH_LAST_WORKING_DIRECTORY
|
||||||
|
mkdir -p "$ZSH/cache"
|
||||||
local cache_file="$ZSH/cache/last-working-dir"
|
local cache_file="$ZSH/cache/last-working-dir"
|
||||||
|
|
||||||
# Updates the last directory once directory is changed.
|
# Updates the last directory once directory is changed.
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,29 @@ function _lein_commands() {
|
||||||
case $state in
|
case $state in
|
||||||
subcommand)
|
subcommand)
|
||||||
subcommands=(
|
subcommands=(
|
||||||
|
"classpath:print the classpath of the current project"
|
||||||
"clean:remove compiled files and dependencies from project"
|
"clean:remove compiled files and dependencies from project"
|
||||||
"compile:ahead-of-time compile the project"
|
"compile:ahead-of-time compile the project"
|
||||||
|
"deploy:build jar and deploy to remote repository"
|
||||||
"deps:download and install all dependencies"
|
"deps:download and install all dependencies"
|
||||||
"help:display a list of tasks or help for a given task"
|
"help:display a list of tasks or help for a given task"
|
||||||
"install:install the project and its dependencies in your local repository"
|
"install:install the project and its dependencies in your local repository"
|
||||||
|
"int:enter an interactive task shell"
|
||||||
|
"interactive:enter an interactive task shell"
|
||||||
|
"jack-in:jack in to a clojure slime session from emacs."
|
||||||
"jar:create a jar file containing the compiled .class files"
|
"jar:create a jar file containing the compiled .class files"
|
||||||
|
"javac:compile java source files"
|
||||||
"new:create a new project skeleton"
|
"new:create a new project skeleton"
|
||||||
|
"plugin:manage user-level plugins"
|
||||||
"pom:write a pom.xml file to disk for maven interop"
|
"pom:write a pom.xml file to disk for maven interop"
|
||||||
|
"repl:start a repl session either with the current project or standalone"
|
||||||
|
"retest:run only the test namespaces which failed last time around"
|
||||||
|
"run:run the project's -main function"
|
||||||
|
"search:search remote maven repositories for matching jars"
|
||||||
|
"swank:launch swank server for Emacs to connect"
|
||||||
"test:run the project's tests"
|
"test:run the project's tests"
|
||||||
|
"test!:run a project's tests after cleaning and fetching dependencies"
|
||||||
|
"trampoline:run a task without nesting the project's JVM inside Leiningen's."
|
||||||
"uberjar:Create a jar including the contents of each of deps"
|
"uberjar:Create a jar including the contents of each of deps"
|
||||||
"upgrade:upgrade leiningen to the latest stable release"
|
"upgrade:upgrade leiningen to the latest stable release"
|
||||||
"version:print leiningen's version"
|
"version:print leiningen's version"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ alias wtf='dmesg'
|
||||||
alias onoz='cat /var/log/errors.log'
|
alias onoz='cat /var/log/errors.log'
|
||||||
alias rtfm='man'
|
alias rtfm='man'
|
||||||
|
|
||||||
|
alias :3='echo'
|
||||||
alias visible='echo'
|
alias visible='echo'
|
||||||
alias invisible='cat'
|
alias invisible='cat'
|
||||||
alias moar='more'
|
alias moar='more'
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,9 @@ alias hgp='hg push'
|
||||||
alias hgs='hg status'
|
alias hgs='hg status'
|
||||||
# this is the 'git commit --amend' equivalent
|
# this is the 'git commit --amend' equivalent
|
||||||
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
|
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
|
||||||
|
|
||||||
|
function hg_current_branch() {
|
||||||
|
if [ -d .hg ]; then
|
||||||
|
echo hg:$(hg branch)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
@ -53,7 +53,118 @@ alias mvnag='mvn archetype:generate'
|
||||||
|
|
||||||
function listMavenCompletions {
|
function listMavenCompletions {
|
||||||
reply=(
|
reply=(
|
||||||
cli:execute cli:execute-phase archetype:generate generate-sources compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`);
|
# common lifecycle
|
||||||
|
clean process-resources compile process-test-resources test-compile test package verify install deploy site
|
||||||
|
|
||||||
|
# common plugins
|
||||||
|
deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
|
||||||
|
|
||||||
|
# deploy
|
||||||
|
deploy:deploy-file
|
||||||
|
# failsafe
|
||||||
|
failsafe:integration-test failsafe:verify
|
||||||
|
# install
|
||||||
|
install:install-file
|
||||||
|
# site
|
||||||
|
site:site site:deploy site:run site:stage site:stage-deploy
|
||||||
|
# surefire
|
||||||
|
surefire:test
|
||||||
|
|
||||||
|
# checkstyle
|
||||||
|
checkstyle:checkstyle checkstyle:check
|
||||||
|
# javadoc
|
||||||
|
javadoc:javadoc javadoc:jar javadoc:aggregate
|
||||||
|
# jxr
|
||||||
|
jxr:jxr
|
||||||
|
# pmd
|
||||||
|
pmd:pmd pmd:cpd pmd:check pmd:cpd-check
|
||||||
|
|
||||||
|
# ant
|
||||||
|
ant:ant ant:clean
|
||||||
|
# antrun
|
||||||
|
antrun:run
|
||||||
|
# archetype
|
||||||
|
archetype:generate archetype:create-from-project archetype:crawl
|
||||||
|
# assembly
|
||||||
|
assembly:single assembly:assembly
|
||||||
|
# dependency
|
||||||
|
dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
|
||||||
|
# enforcer
|
||||||
|
enforcer:enforce
|
||||||
|
# gpg
|
||||||
|
gpg:sign gpg:sign-and-deploy-file
|
||||||
|
# help
|
||||||
|
help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system
|
||||||
|
# release
|
||||||
|
release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions
|
||||||
|
# repository
|
||||||
|
repository:bundle-create repository:bundle-pack
|
||||||
|
# source
|
||||||
|
source:aggregate source:jar source:jar-no-fork
|
||||||
|
|
||||||
|
# eclipse
|
||||||
|
eclipse:clean eclipse:eclipse
|
||||||
|
# idea
|
||||||
|
idea:clean idea:idea
|
||||||
|
|
||||||
|
# jetty
|
||||||
|
jetty:run jetty:run-exploded
|
||||||
|
# cargo
|
||||||
|
cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help
|
||||||
|
# jboss
|
||||||
|
jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy
|
||||||
|
# tomcat
|
||||||
|
tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:undeploy
|
||||||
|
# tomcat6
|
||||||
|
tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
|
||||||
|
# tomcat7
|
||||||
|
tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
|
||||||
|
# exec
|
||||||
|
exec:exec exec:java
|
||||||
|
# versions
|
||||||
|
versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert
|
||||||
|
# scm
|
||||||
|
scm:add scm:checkin scm:checkout scm:update scm:status
|
||||||
|
# buildnumber
|
||||||
|
buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset
|
||||||
|
|
||||||
|
# war
|
||||||
|
war:war war:exploded war:inplace war:manifest
|
||||||
|
# ear
|
||||||
|
ear:ear ear:generate-application-xml
|
||||||
|
# ejb
|
||||||
|
ejb:ejb
|
||||||
|
# android
|
||||||
|
android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices
|
||||||
|
# nexus
|
||||||
|
nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download
|
||||||
|
# repository
|
||||||
|
repository:bundle-create repository:bundle-pack repository:help
|
||||||
|
|
||||||
|
# sonar
|
||||||
|
sonar:sonar
|
||||||
|
# license
|
||||||
|
license:format license:check
|
||||||
|
# hibernate3
|
||||||
|
hibernate3:hbm2ddl hibernate3:help
|
||||||
|
# liquibase
|
||||||
|
liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback
|
||||||
|
# flyway
|
||||||
|
flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate
|
||||||
|
# gwt
|
||||||
|
gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test
|
||||||
|
|
||||||
|
# options
|
||||||
|
-Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven
|
||||||
|
|
||||||
|
# arguments
|
||||||
|
-am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X
|
||||||
|
|
||||||
|
cli:execute cli:execute-phase
|
||||||
|
archetype:generate generate-sources
|
||||||
|
cobertura:cobertura
|
||||||
|
-Dtest= `if [ -d ./src ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
compctl -K listMavenCompletions mvn
|
compctl -K listMavenCompletions mvn
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Open the node api for your current version to the optional section.
|
# Open the node api for your current version to the optional section.
|
||||||
# TODO: Make the section part easier to use.
|
# TODO: Make the section part easier to use.
|
||||||
function node-docs {
|
function node-docs {
|
||||||
open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
|
open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@
|
||||||
# FILE: osx.plugin.zsh
|
# FILE: osx.plugin.zsh
|
||||||
# DESCRIPTION: oh-my-zsh plugin file.
|
# DESCRIPTION: oh-my-zsh plugin file.
|
||||||
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
|
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
|
||||||
# VERSION: 1.0.1
|
# VERSION: 1.1.0
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
function tab() {
|
function tab() {
|
||||||
local command="cd \\\"$PWD\\\""
|
local command="cd \\\"$PWD\\\""
|
||||||
(( $# > 0 )) && command="${command}; $*"
|
(( $# > 0 )) && command="${command}; $*"
|
||||||
|
|
@ -35,7 +34,7 @@ EOF
|
||||||
launch session "Default Session"
|
launch session "Default Session"
|
||||||
set current_session to current session
|
set current_session to current session
|
||||||
tell current_session
|
tell current_session
|
||||||
write text "${command}"
|
write text "${command}; clear;"
|
||||||
end tell
|
end tell
|
||||||
end tell
|
end tell
|
||||||
end tell
|
end tell
|
||||||
|
|
@ -43,6 +42,64 @@ EOF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function vsplit_tab() {
|
||||||
|
local command="cd \\\"$PWD\\\""
|
||||||
|
(( $# > 0 )) && command="${command}; $*"
|
||||||
|
|
||||||
|
the_app=$(
|
||||||
|
osascript 2>/dev/null <<EOF
|
||||||
|
tell application "System Events"
|
||||||
|
name of first item of (every process whose frontmost is true)
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
[[ "$the_app" == 'iTerm' ]] && {
|
||||||
|
osascript 2>/dev/null <<EOF
|
||||||
|
tell application "iTerm" to activate
|
||||||
|
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "iTerm"
|
||||||
|
tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
|
||||||
|
click
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
keystroke "${command}; clear;"
|
||||||
|
keystroke return
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function split_tab() {
|
||||||
|
local command="cd \\\"$PWD\\\""
|
||||||
|
(( $# > 0 )) && command="${command}; $*"
|
||||||
|
|
||||||
|
the_app=$(
|
||||||
|
osascript 2>/dev/null <<EOF
|
||||||
|
tell application "System Events"
|
||||||
|
name of first item of (every process whose frontmost is true)
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
[[ "$the_app" == 'iTerm' ]] && {
|
||||||
|
osascript 2>/dev/null <<EOF
|
||||||
|
tell application "iTerm" to activate
|
||||||
|
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "iTerm"
|
||||||
|
tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
|
||||||
|
click
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
keystroke "${command}; clear;"
|
||||||
|
keystroke return
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function pfd() {
|
function pfd() {
|
||||||
osascript 2>/dev/null <<EOF
|
osascript 2>/dev/null <<EOF
|
||||||
tell application "Finder"
|
tell application "Finder"
|
||||||
|
|
|
||||||
42
plugins/pj/pj.plugin.zsh
Normal file
42
plugins/pj/pj.plugin.zsh
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Original idea by DefV (Jan De Poorter)
|
||||||
|
# Source: https://gist.github.com/pjaspers/368394#comment-1016
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# - Set `$PROJECT_PATHS` in your ~/.zshrc
|
||||||
|
# e.g.: PROJECT_PATHS=(~/src ~/work)
|
||||||
|
# - In ZSH you now can open a project directory with the command: `pj my-project`
|
||||||
|
# the plugin will locate the `my-project` directory in one of the $PROJECT_PATHS
|
||||||
|
# Also tab completion is supported.
|
||||||
|
# - `pjo my-project` will open the directory in $EDITOR
|
||||||
|
#
|
||||||
|
|
||||||
|
function pj() {
|
||||||
|
cmd="cd"
|
||||||
|
file=$1
|
||||||
|
|
||||||
|
if [[ "open" == "$file" ]] then
|
||||||
|
file=$2
|
||||||
|
cmd=(${(s: :)EDITOR})
|
||||||
|
fi
|
||||||
|
|
||||||
|
for project in $PROJECT_PATHS; do
|
||||||
|
if [[ -d $project/$file ]] then
|
||||||
|
$cmd "$project/$file"
|
||||||
|
unset project # Unset project var
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "No such project $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
alias pjo="pj open"
|
||||||
|
|
||||||
|
function _pj () {
|
||||||
|
compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'`
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _pj pj
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
# Find python file
|
# Find python file
|
||||||
alias pyfind='find . -name "*.py"'
|
alias pyfind='find . -name "*.py"'
|
||||||
|
|
||||||
# Remove python compiled byte-code
|
# Remove python compiled byte-code in either current directory or in a
|
||||||
alias pyclean='find . -type f -name "*.py[co]" -delete'
|
# list of specified directories
|
||||||
|
function pyclean() {
|
||||||
|
ZSH_PYCLEAN_PLACES=${*:-'.'}
|
||||||
|
find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
|
||||||
|
}
|
||||||
|
|
||||||
# Grep among .py files
|
# Grep among .py files
|
||||||
alias pygrep='grep --include="*.py"'
|
alias pygrep='grep --include="*.py"'
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ alias sr='ruby script/runner'
|
||||||
alias ssp='ruby script/spec'
|
alias ssp='ruby script/spec'
|
||||||
alias rdbm='rake db:migrate'
|
alias rdbm='rake db:migrate'
|
||||||
alias rdbtp='rake db:test:prepare'
|
alias rdbtp='rake db:test:prepare'
|
||||||
|
alias migrate='rake db:migrate && rake db:test:prepare'
|
||||||
alias sc='ruby script/console'
|
alias sc='ruby script/console'
|
||||||
alias sd='ruby script/server --debugger'
|
alias sd='ruby script/server --debugger'
|
||||||
alias devlog='tail -f log/development.log'
|
alias devlog='tail -f log/development.log'
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ for rbenvdir in "${rbenvdirs[@]}" ; do
|
||||||
|
|
||||||
function gems {
|
function gems {
|
||||||
local rbenv_path=$(rbenv prefix)
|
local rbenv_path=$(rbenv prefix)
|
||||||
gem list $@ | sed \
|
gem list $@ | sed -E \
|
||||||
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
-e "s/\([0-9a-z, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
||||||
-Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
|
-e "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
|
||||||
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
-e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
||||||
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
-e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
||||||
}
|
}
|
||||||
|
|
||||||
function rbenv_prompt_info() {
|
function rbenv_prompt_info() {
|
||||||
|
|
|
||||||
4
plugins/rsync/rsync.plugin.zsh
Normal file
4
plugins/rsync/rsync.plugin.zsh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
alias rsync-copy="rsync -av --progress -h"
|
||||||
|
alias rsync-move="rsync -av --progress -h --remove-source-files"
|
||||||
|
alias rsync-update="rsync -avu --progress -h"
|
||||||
|
alias rsync-synchronize="rsync -avu --delete --progress -h"
|
||||||
|
|
@ -4,7 +4,7 @@ alias rubies='rvm list rubies'
|
||||||
alias gemsets='rvm gemset list'
|
alias gemsets='rvm gemset list'
|
||||||
|
|
||||||
local ruby18='ruby-1.8.7-p334'
|
local ruby18='ruby-1.8.7-p334'
|
||||||
local ruby19='ruby-1.9.2-p180'
|
local ruby19='ruby-1.9.3-p194'
|
||||||
|
|
||||||
function rb18 {
|
function rb18 {
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
|
@ -44,3 +44,8 @@ function gems {
|
||||||
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
||||||
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _rvm_completion {
|
||||||
|
source $rvm_path"/scripts/zsh/Completion/_rvm"
|
||||||
|
}
|
||||||
|
compdef _rvm_completion rvm
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,6 @@ sprunge() {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo Using input from a pipe or STDIN redirection... >&2
|
echo Using input from a pipe or STDIN redirection... >&2
|
||||||
while read -r line ; do
|
curl -F 'sprunge=<-' http://sprunge.us
|
||||||
echo $line
|
|
||||||
done | curl -F 'sprunge=<-' http://sprunge.us
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,21 @@
|
||||||
# Sublime Text 2 Aliases
|
# Sublime Text 2 Aliases
|
||||||
#unamestr = 'uname'
|
#unamestr = 'uname'
|
||||||
|
|
||||||
|
local _sublime_darwin_subl=/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
|
||||||
|
|
||||||
if [[ $('uname') == 'Linux' ]]; then
|
if [[ $('uname') == 'Linux' ]]; then
|
||||||
if [ -f '/usr/bin/sublime_text' ]; then
|
if [ -f '/usr/bin/sublime_text' ]; then
|
||||||
alias st='/usr/bin/sublime_text&'
|
st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
|
||||||
else
|
else
|
||||||
alias st='/usr/bin/sublime-text&'
|
st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
|
||||||
fi
|
fi
|
||||||
|
alias st=st_run
|
||||||
elif [[ $('uname') == 'Darwin' ]]; then
|
elif [[ $('uname') == 'Darwin' ]]; then
|
||||||
alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
|
# Check if Sublime is installed in user's home application directory
|
||||||
|
if [[ -a $HOME/${_sublime_darwin_subl} ]]; then
|
||||||
|
alias st='$HOME/${_sublime_darwin_subl}'
|
||||||
|
else
|
||||||
|
alias st='${_sublime_darwin_subl}'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
alias stt='st .'
|
alias stt='st .'
|
||||||
|
|
|
||||||
13
plugins/symfony/symfony.plugin.zsh
Normal file
13
plugins/symfony/symfony.plugin.zsh
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# symfony basic command completion
|
||||||
|
|
||||||
|
_symfony_get_command_list () {
|
||||||
|
./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }'
|
||||||
|
}
|
||||||
|
|
||||||
|
_symfony () {
|
||||||
|
if [ -f symfony ]; then
|
||||||
|
compadd `_symfony_get_command_list`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _symfony symfony
|
||||||
|
|
@ -11,7 +11,9 @@ _symfony2 () {
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _symfony2 app/console
|
compdef _symfony2 app/console
|
||||||
|
compdef _symfony2 sf
|
||||||
|
|
||||||
#Alias
|
#Alias
|
||||||
alias sf2='php app/console'
|
alias sf2='php app/console'
|
||||||
alias sf2clear='php app/console cache:clear'
|
alias sf2clear='php app/console cache:clear'
|
||||||
|
|
||||||
|
|
|
||||||
11
plugins/systemd/systemd.plugin.zsh
Normal file
11
plugins/systemd/systemd.plugin.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
user_commands=(
|
||||||
|
list-units is-active status show help list-unit-files
|
||||||
|
is-enabled list-jobs show-environment)
|
||||||
|
|
||||||
|
sudo_commands=(
|
||||||
|
start stop reload restart try-restart isolate kill
|
||||||
|
reset-failed enable disable reenable preset mask unmask
|
||||||
|
link load cancel set-environment unset-environment)
|
||||||
|
|
||||||
|
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
|
||||||
|
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
|
||||||
|
|
@ -1,11 +1,39 @@
|
||||||
# Set Apple Terminal.app resume directory
|
# Set Apple Terminal.app resume directory
|
||||||
# based on this answer: http://superuser.com/a/315029
|
# based on this answer: http://superuser.com/a/315029
|
||||||
|
# 2012-10-26: (javageek) Changed code using the updated answer
|
||||||
|
|
||||||
function chpwd {
|
# Tell the terminal about the working directory whenever it changes.
|
||||||
local SEARCH=' '
|
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
|
||||||
local REPLACE='%20'
|
update_terminal_cwd() {
|
||||||
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
|
# Identify the directory using a "file:" scheme URL, including
|
||||||
|
# the host name to disambiguate local vs. remote paths.
|
||||||
|
|
||||||
|
# Percent-encode the pathname.
|
||||||
|
local URL_PATH=''
|
||||||
|
{
|
||||||
|
# Use LANG=C to process text byte-by-byte.
|
||||||
|
local i ch hexch LANG=C
|
||||||
|
for ((i = 1; i <= ${#PWD}; ++i)); do
|
||||||
|
ch="$PWD[i]"
|
||||||
|
if [[ "$ch" =~ [/._~A-Za-z0-9-] ]]; then
|
||||||
|
URL_PATH+="$ch"
|
||||||
|
else
|
||||||
|
hexch=$(printf "%02X" "'$ch")
|
||||||
|
URL_PATH+="%$hexch"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
local PWD_URL="file://$HOST$URL_PATH"
|
||||||
|
#echo "$PWD_URL" # testing
|
||||||
printf '\e]7;%s\a' "$PWD_URL"
|
printf '\e]7;%s\a' "$PWD_URL"
|
||||||
}
|
}
|
||||||
|
|
||||||
chpwd
|
# Register the function so it is called whenever the working
|
||||||
|
# directory changes.
|
||||||
|
autoload add-zsh-hook
|
||||||
|
add-zsh-hook chpwd update_terminal_cwd
|
||||||
|
|
||||||
|
# Tell the terminal about the initial directory.
|
||||||
|
update_terminal_cwd
|
||||||
|
fi
|
||||||
|
|
|
||||||
3
plugins/themes/_theme
Normal file
3
plugins/themes/_theme
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#compdef theme
|
||||||
|
|
||||||
|
_arguments "1: :($(lstheme | tr "\n" " "))"
|
||||||
24
plugins/themes/themes.plugin.zsh
Normal file
24
plugins/themes/themes.plugin.zsh
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
function theme
|
||||||
|
{
|
||||||
|
if [ "$1" = "random" ]; then
|
||||||
|
themes=($ZSH/themes/*zsh-theme)
|
||||||
|
N=${#themes[@]}
|
||||||
|
((N=(RANDOM%N)+1))
|
||||||
|
RANDOM_THEME=${themes[$N]}
|
||||||
|
source "$RANDOM_THEME"
|
||||||
|
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||||
|
else
|
||||||
|
if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
|
||||||
|
then
|
||||||
|
source "$ZSH_CUSTOM/$1.zsh-theme"
|
||||||
|
else
|
||||||
|
source "$ZSH/themes/$1.zsh-theme"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function lstheme
|
||||||
|
{
|
||||||
|
cd $ZSH/themes
|
||||||
|
ls *zsh-theme | sed 's,\.zsh-theme$,,'
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,33 @@
|
||||||
# Taken from:
|
# Taken from:
|
||||||
# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/
|
# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/
|
||||||
|
|
||||||
alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"'
|
if [[ $(whence $URLTOOLS_METHOD) = "" ]]; then
|
||||||
|
URLTOOLS_METHOD=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xnode" ) ]]; then
|
||||||
|
alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"'
|
||||||
alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"'
|
alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"'
|
||||||
|
elif [[ $(whence python) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then
|
||||||
|
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
|
||||||
|
alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
|
||||||
|
elif [[ $(whence ruby) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xruby" ) ]]; then
|
||||||
|
alias urlencode='ruby -r cgi -e "puts CGI.escape(ARGV[0])"'
|
||||||
|
alias urldecode='ruby -r cgi -e "puts CGI.unescape(ARGV[0])"'
|
||||||
|
elif [[ $(whence php) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xphp" ) ]]; then
|
||||||
|
alias urlencode='php -r "echo rawurlencode(\$argv[1]); echo \"\n\";"'
|
||||||
|
alias urldecode='php -r "echo rawurldecode(\$argv[1]); echo \"\\n\";"'
|
||||||
|
elif [[ $(whence perl) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xperl" ) ]]; then
|
||||||
|
if perl -MURI::Encode -e 1&> /dev/null; then
|
||||||
|
alias urlencode='perl -MURI::Encode -ep "uri_encode($ARGV[0]);"'
|
||||||
|
alias urldecode='perl -MURI::Encode -ep "uri_decode($ARGV[0]);"'
|
||||||
|
elif perl -MURI::Escape -e 1 &> /dev/null; then
|
||||||
|
alias urlencode='perl -MURI::Escape -ep "uri_escape($ARGV[0]);"'
|
||||||
|
alias urldecode='perl -MURI::Escape -ep "uri_unescape($ARGV[0]);"'
|
||||||
|
else
|
||||||
|
alias urlencode="perl -e '\$new=\$ARGV[0]; \$new =~ s/([^A-Za-z0-9])/sprintf(\"%%%02X\", ord(\$1))/seg; print \"\$new\n\";'"
|
||||||
|
alias urldecode="perl -e '\$new=\$ARGV[0]; \$new =~ s/\%([A-Fa-f0-9]{2})/pack(\"C\", hex(\$1))/seg; print \"\$new\n\";'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset URLTOOLS_METHOD
|
||||||
|
|
@ -46,6 +46,11 @@ __box_list ()
|
||||||
_wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
|
_wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__vm_list ()
|
||||||
|
{
|
||||||
|
_wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
|
||||||
|
}
|
||||||
|
|
||||||
__vagrant-box ()
|
__vagrant-box ()
|
||||||
{
|
{
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
|
|
@ -99,6 +104,8 @@ case $state in
|
||||||
(box)
|
(box)
|
||||||
__vagrant-box
|
__vagrant-box
|
||||||
;;
|
;;
|
||||||
|
(up|provision|package|destroy|reload|ssh|halt|resume|status)
|
||||||
|
_arguments ':feature:__vm_list'
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,21 @@
|
||||||
function zle-line-init zle-keymap-select {
|
# Ensures that $terminfo values are valid and updates editor information when
|
||||||
|
# the keymap changes.
|
||||||
|
function zle-keymap-select zle-line-init zle-line-finish {
|
||||||
|
# The terminal must be in application mode when ZLE is active for $terminfo
|
||||||
|
# values to be valid.
|
||||||
|
if (( ${+terminfo[smkx]} )); then
|
||||||
|
printf '%s' ${terminfo[smkx]}
|
||||||
|
fi
|
||||||
|
if (( ${+terminfo[rmkx]} )); then
|
||||||
|
printf '%s' ${terminfo[rmkx]}
|
||||||
|
fi
|
||||||
|
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
|
zle -R
|
||||||
}
|
}
|
||||||
|
|
||||||
zle -N zle-line-init
|
zle -N zle-line-init
|
||||||
|
zle -N zle-line-finish
|
||||||
zle -N zle-keymap-select
|
zle -N zle-keymap-select
|
||||||
|
|
||||||
bindkey -v
|
bindkey -v
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
WRAPPER_FOUND=0
|
wrapsource=`which virtualenvwrapper_lazy.sh`
|
||||||
for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do
|
|
||||||
if [[ -e $wrapsource ]] ; then
|
if [[ -f "$wrapsource" ]]; then
|
||||||
WRAPPER_FOUND=1
|
|
||||||
source $wrapsource
|
source $wrapsource
|
||||||
|
|
||||||
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
||||||
|
|
@ -36,11 +35,6 @@ for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrap
|
||||||
builtin cd "$@" && workon_cwd
|
builtin cd "$@" && workon_cwd
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
break
|
print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper_lazy.sh. Please install with \`pip install virtualenvwrapper\`."
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $WRAPPER_FOUND -eq 0 ] ; then
|
|
||||||
print "zsh virtualenvwrapper plugin: Couldn't activate virtualenvwrapper. Please run \`pip install virtualenvwrapper\`."
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
* `zcu` aliases `zeus cucumber`
|
* `zcu` aliases `zeus cucumber`
|
||||||
* `zucumber` aliases `zeus cucumber`
|
* `zucumber` aliases `zeus cucumber`
|
||||||
|
|
||||||
|
* `zspec` aliases `zeus rspec`
|
||||||
|
|
||||||
* `zt` aliases `zeus test`
|
* `zt` aliases `zeus test`
|
||||||
* `zest` aliases `zeus test`
|
* `zest` aliases `zeus test`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@ alias zunner='zeus runner'
|
||||||
alias zcu='zeus cucumber'
|
alias zcu='zeus cucumber'
|
||||||
alias zucumber='zeus cucumber'
|
alias zucumber='zeus cucumber'
|
||||||
|
|
||||||
|
# Rspec
|
||||||
|
alias zspec='zeus rspec'
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
alias zt='zeus test'
|
alias zt='zeus test'
|
||||||
alias zest='zeus test'
|
alias zest='zeus test'
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ ZSH_THEME="robbyrussell"
|
||||||
# Set to this to use case-sensitive completion
|
# Set to this to use case-sensitive completion
|
||||||
# CASE_SENSITIVE="true"
|
# CASE_SENSITIVE="true"
|
||||||
|
|
||||||
# Comment this out to disable weekly auto-update checks
|
# Comment this out to disable bi-weekly auto-update checks
|
||||||
# DISABLE_AUTO_UPDATE="true"
|
# DISABLE_AUTO_UPDATE="true"
|
||||||
|
|
||||||
# Change this value to set how frequently ZSH updates¬
|
# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
|
||||||
export UPDATE_ZSH_DAYS=13
|
# export UPDATE_ZSH_DAYS=13
|
||||||
|
|
||||||
# Uncomment following line if you want to disable colors in ls
|
# Uncomment following line if you want to disable colors in ls
|
||||||
# DISABLE_LS_COLORS="true"
|
# DISABLE_LS_COLORS="true"
|
||||||
|
|
|
||||||
26
themes/adben.zsh-theme
Normal file
26
themes/adben.zsh-theme
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
local USER_HOST='%{$terminfo[bold]$fg[yellow]%}%n@%m%{$reset_color%}'
|
||||||
|
local RETURN_CODE="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
local GIT_BRANCH='%{$terminfo[bold]$fg[red]%}$(git_prompt_info)%{$reset_color%}'
|
||||||
|
local CURRENT_DIR='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}'
|
||||||
|
local RUBY_RVM='%{$fg[gray]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
|
||||||
|
local COMMAND_TIP='%{$terminfo[bold]$fg[blue]%}$(wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' | sed 's/^/║/g')%{$reset_color%}'
|
||||||
|
######### PROMPT #########
|
||||||
|
PROMPT="%{$terminfo[bold]$fg[blue]%}╔═ %{$reset_color%}${USER_HOST} ${CURRENT_DIR} ${RUBY_RVM} ${GIT_BRANCH}
|
||||||
|
${COMMAND_TIP}
|
||||||
|
%{$terminfo[bold]$fg[blue]%}╚═ %{$reset_color%}%B%{$terminfo[bold]$fg[white]%}$%b%{$reset_color%} "
|
||||||
|
RPS1='${RETURN_CODE}'
|
||||||
|
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
|
||||||
|
######### PROMPT #########
|
||||||
|
########## GIT ###########
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="‹"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%}›"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
|
||||||
|
########## GIT ###########
|
||||||
|
|
@ -95,7 +95,7 @@ prompt_dir() {
|
||||||
prompt_status() {
|
prompt_status() {
|
||||||
local symbols
|
local symbols
|
||||||
symbols=()
|
symbols=()
|
||||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL"
|
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
|
||||||
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
||||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,23 @@ function _prompt_char() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This theme works with both the "dark" and "light" variants of the
|
||||||
|
# Solarized color schema. Set the SOLARIZED_THEME variable to one of
|
||||||
|
# these two values to choose. If you don't specify, we'll assume you're
|
||||||
|
# using the "dark" variant.
|
||||||
|
|
||||||
|
case ${SOLARIZED_THEME:-dark} in
|
||||||
|
light) bkg=white;;
|
||||||
|
*) bkg=black;;
|
||||||
|
esac
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{${bkg}}%B%F{green}%}]"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
PROMPT='%{%f%k%b%}
|
PROMPT='%{%f%k%b%}
|
||||||
%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
%{%K{${bkg}}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{${bkg}}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
||||||
%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} '
|
%{%K{${bkg}}%}$(_prompt_char)%{%K{${bkg}}%} %#%{%f%k%b%} '
|
||||||
|
|
||||||
RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
|
RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
|
||||||
|
|
|
||||||
37
themes/candy-kingdom.zsh-theme
Normal file
37
themes/candy-kingdom.zsh-theme
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
# neuralsanwich.zsh-theme
|
||||||
|
#
|
||||||
|
# Author: Sean Jones
|
||||||
|
# URL: http://www.neuralsandwich.com
|
||||||
|
# Repo:
|
||||||
|
# Direct link:
|
||||||
|
# Create:
|
||||||
|
# Modified:
|
||||||
|
|
||||||
|
if [ "x$OH_MY_ZSH_HG" = "x" ]; then
|
||||||
|
OH_MY_ZSH_HG="hg"
|
||||||
|
fi
|
||||||
|
|
||||||
|
function hg_prompt_info {
|
||||||
|
$OH_MY_ZSH_HG prompt --angle-brackets "\
|
||||||
|
< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
|
||||||
|
< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
|
||||||
|
%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
|
||||||
|
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function box_name {
|
||||||
|
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
|
||||||
|
%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
||||||
|
|
||||||
|
local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
|
||||||
|
RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
|
||||||
|
ZSH_THEME_CLOUD_PREFIX='☁'
|
||||||
|
fi
|
||||||
|
|
||||||
|
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$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%}"
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ function virtualenv_info {
|
||||||
}
|
}
|
||||||
|
|
||||||
function prompt_char {
|
function prompt_char {
|
||||||
git branch >/dev/null 2>/dev/null && echo '±' && return
|
git branch >/dev/null 2>/dev/null && echo '⠠⠵' && return
|
||||||
echo '○'
|
echo '○'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
# ZSH Theme emulating the Fish shell's default prompt.
|
# ZSH Theme emulating the Fish shell's default prompt.
|
||||||
|
|
||||||
|
_fishy_collapsed_wd() {
|
||||||
|
echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
|
||||||
|
}
|
||||||
|
|
||||||
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]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
|
|
||||||
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,22 @@
|
||||||
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)$(bzr_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%}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
|
GIT_CB="git::"
|
||||||
|
ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}["
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
|
## Bazaar integration
|
||||||
|
bzr_prompt_info() {
|
||||||
|
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
|
||||||
|
if [ -n "$BZR_CB" ]; then
|
||||||
|
BZR_DIRTY=""
|
||||||
|
[[ -n `bzr status` ]] && BZR_DIRTY="%{$fg[red]%} *%{$reset_color%}"
|
||||||
|
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
12
themes/frontcube.zsh-theme
Normal file
12
themes/frontcube.zsh-theme
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}"
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%}
|
||||||
|
%{$fg[green]%}➞ %{$reset_color%'
|
||||||
|
|
||||||
|
RPROMPT='$(git_prompt_info) $(rvm)'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✖ %{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}] %{$fg[green]%}✔%{$reset_color%}"
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} '
|
function prompt_char {
|
||||||
|
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
||||||
|
|
|
||||||
24
themes/intheloop.zsh-theme
Normal file
24
themes/intheloop.zsh-theme
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# ZSH theme by James Smith (http://loopj.com)
|
||||||
|
# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status
|
||||||
|
|
||||||
|
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
||||||
|
|
||||||
|
local host_color="green"
|
||||||
|
if [ -n "$SSH_CLIENT" ]; then
|
||||||
|
local host_color="red"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status)
|
||||||
|
%{$fg_bold[cyan]%}❯%{$reset_color%} '
|
||||||
|
|
||||||
|
|
||||||
|
RPROMPT='${return_status}%{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})"
|
||||||
|
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}"
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
functions rbenv_prompt_info >& /dev/null || rbenv_prompt_info(){}
|
||||||
|
|
||||||
function theme_precmd {
|
function theme_precmd {
|
||||||
local TERMWIDTH
|
local TERMWIDTH
|
||||||
(( TERMWIDTH = ${COLUMNS} - 1 ))
|
(( TERMWIDTH = ${COLUMNS} - 1 ))
|
||||||
|
|
|
||||||
34
themes/junkfood.zsh-theme
Normal file
34
themes/junkfood.zsh-theme
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# ------------------------------------------------------------------------
|
||||||
|
# Tyler Cipriani
|
||||||
|
# oh-my-zsh theme
|
||||||
|
# Totally ripped off Dallas theme
|
||||||
|
# ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Grab the current date (%W) and time (%t):
|
||||||
|
JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}"
|
||||||
|
|
||||||
|
# Grab the current machine name
|
||||||
|
JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}"
|
||||||
|
|
||||||
|
# Grab the current username
|
||||||
|
JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}"
|
||||||
|
|
||||||
|
# Grab the current filepath, use shortcuts: ~/Desktop
|
||||||
|
# Append the current git branch, if in a git repository: ~aw@master
|
||||||
|
JUNKFOOD_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}"
|
||||||
|
|
||||||
|
# For the git prompt, use a white @ and blue text for the branch name
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg_bold[white]%}"
|
||||||
|
|
||||||
|
# Close it all off by resetting the color and styles.
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
||||||
|
# Do nothing if the branch is clean (no changes).
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✔"
|
||||||
|
|
||||||
|
# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch!
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗"
|
||||||
|
|
||||||
|
# Put it all together!
|
||||||
|
PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_
|
||||||
|
"
|
||||||
6
themes/kafeitu.zsh-theme
Normal file
6
themes/kafeitu.zsh-theme
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})"
|
||||||
44
themes/michelebologna.zsh-theme
Normal file
44
themes/michelebologna.zsh-theme
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# reference colors
|
||||||
|
GREEN="%{$fg_bold[green]%}"
|
||||||
|
RED="%{$fg_bold[red]%}"
|
||||||
|
CYAN="%{$fg_bold[cyan]%}"
|
||||||
|
YELLOW="%{$fg_bold[yellow]%}"
|
||||||
|
BLUE="%{$fg_bold[blue]%}"
|
||||||
|
MAGENTA="%{$fg_bold[magenta]%}"
|
||||||
|
WHITE="%{$fg_bold[white]%}"
|
||||||
|
|
||||||
|
COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE)
|
||||||
|
|
||||||
|
# color reset
|
||||||
|
RESET_COLOR="%{$reset_color%}"
|
||||||
|
|
||||||
|
# which color should be applied?
|
||||||
|
USERNAME_NORMAL_COLOR=$WHITE
|
||||||
|
USERNAME_ROOT_COLOR=$RED
|
||||||
|
HOSTNAME_NORMAL_COLOR=$BLUE
|
||||||
|
# uncomment next line if you want auto-generated hostname color
|
||||||
|
#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]]
|
||||||
|
HOSTNAME_ROOT_COLOR=$RED
|
||||||
|
HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR)
|
||||||
|
CURRENT_DIR_COLOR=$CYAN
|
||||||
|
|
||||||
|
# zsh commands
|
||||||
|
USERNAME_COMMAND="%n"
|
||||||
|
HOSTNAME_COMMAND="%m"
|
||||||
|
CURRENT_DIR="%~"
|
||||||
|
|
||||||
|
# output: colors + commands
|
||||||
|
USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)"
|
||||||
|
HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR"
|
||||||
|
CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR"
|
||||||
|
LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)"
|
||||||
|
|
||||||
|
# git theming
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=")"
|
||||||
|
|
||||||
|
# wrap all together
|
||||||
|
PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR '
|
||||||
|
RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]'
|
||||||
|
|
@ -46,7 +46,8 @@ function ssh_connection() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n%# '
|
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}"
|
||||||
|
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# '
|
||||||
|
|
||||||
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
|
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}'
|
PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
|
||||||
|
|
|
||||||
141
themes/simonoff.zsh-theme
Normal file
141
themes/simonoff.zsh-theme
Normal file
|
|
@ -0,0 +1,141 @@
|
||||||
|
# Prompt
|
||||||
|
#
|
||||||
|
# Below are the color init strings for the basic file types. A color init
|
||||||
|
# string consists of one or more of the following numeric codes:
|
||||||
|
# Attribute codes:
|
||||||
|
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||||
|
# Text color codes:
|
||||||
|
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||||
|
# Background color codes:
|
||||||
|
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||||
|
function precmd {
|
||||||
|
|
||||||
|
local TERMWIDTH
|
||||||
|
(( TERMWIDTH = ${COLUMNS} - 1 ))
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# Truncate the path if it's too long.
|
||||||
|
|
||||||
|
PR_FILLBAR=""
|
||||||
|
PR_PWDLEN=""
|
||||||
|
|
||||||
|
local promptsize=${#${(%):---(%n@%M:%l)---()}}
|
||||||
|
local pwdsize=${#${(%):-%~}}
|
||||||
|
local gitbranch="$(git_prompt_info)"
|
||||||
|
local rvmprompt="$(rvm_prompt_info)"
|
||||||
|
local gitbranchsize=${#${gitbranch:-''}}
|
||||||
|
local rvmpromptsize=${#${rvmprompt:-''}}
|
||||||
|
|
||||||
|
if [[ "$promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize" -gt $TERMWIDTH ]]; then
|
||||||
|
((PR_PWDLEN=$TERMWIDTH - $promptsize))
|
||||||
|
else
|
||||||
|
PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize)))..${PR_SPACE}.)}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setopt extended_glob
|
||||||
|
|
||||||
|
preexec () {
|
||||||
|
if [[ "$TERM" == "screen" ]]; then
|
||||||
|
local CMD=${1[(wr)^(*=*|sudo|-*)]}
|
||||||
|
echo -n "\ek$CMD\e\\"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TERM" == "xterm" ]]; then
|
||||||
|
print -Pn "\e]0;$1\a"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TERM" == "rxvt" ]]; then
|
||||||
|
print -Pn "\e]0;$1\a"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setprompt () {
|
||||||
|
###
|
||||||
|
# Need this so the prompt will work.
|
||||||
|
|
||||||
|
setopt prompt_subst
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# See if we can use colors.
|
||||||
|
|
||||||
|
autoload colors zsh/terminfo
|
||||||
|
if [[ "$terminfo[colors]" -ge 8 ]]; then
|
||||||
|
colors
|
||||||
|
fi
|
||||||
|
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
|
||||||
|
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
|
||||||
|
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
|
||||||
|
(( count = $count + 1 ))
|
||||||
|
done
|
||||||
|
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# See if we can use extended characters to look nicer.
|
||||||
|
|
||||||
|
typeset -A altchar
|
||||||
|
# set -A altchar "${(s..)terminfo[acsc]}"
|
||||||
|
PR_SET_CHARSET="%{$terminfo[enacs]%}"
|
||||||
|
PR_HBAR=${altchar[q]:--}
|
||||||
|
PR_ULCORNER=${altchar[l]:--}
|
||||||
|
PR_LLCORNER=${altchar[m]:--}
|
||||||
|
PR_LRCORNER=${altchar[j]:--}
|
||||||
|
PR_URCORNER=${altchar[k]:--}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Modify Git prompt
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=" ["
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="]"
|
||||||
|
###
|
||||||
|
# Modify RVM prompt
|
||||||
|
ZSH_THEME_RVM_PROMPT_PREFIX=" ["
|
||||||
|
ZSH_THEME_RVM_PROMPT_SUFFIX="]"
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# Decide if we need to set titlebar text.
|
||||||
|
|
||||||
|
case $TERM in
|
||||||
|
xterm*|*rxvt*)
|
||||||
|
PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%M:%~ $(git_prompt_info) $(rvm_prompt_info) | ${COLUMNS}x${LINES} | %y\a%}'
|
||||||
|
;;
|
||||||
|
screen)
|
||||||
|
PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PR_TITLEBAR=''
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# Decide whether to set a screen title
|
||||||
|
if [[ "$TERM" == "screen" ]]; then
|
||||||
|
PR_STITLE=$'%{\ekzsh\e\\%}'
|
||||||
|
else
|
||||||
|
PR_STITLE=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
# Finally, the prompt.
|
||||||
|
#
|
||||||
|
PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
|
||||||
|
$PR_RED$PR_HBAR<\
|
||||||
|
$PR_BLUE%(!.$PR_RED%SROOT%s.%n)$PR_GREEN@$PR_BLUE%M:$PR_GREEN%$PR_PWDLEN<...<%~$PR_CYAN$(git_prompt_info)$(rvm_prompt_info)\
|
||||||
|
$PR_RED>$PR_HBAR$PR_SPACE${(e)PR_FILLBAR}\
|
||||||
|
$PR_RED$PR_HBAR<\
|
||||||
|
$PR_GREEN%l$PR_RED>$PR_HBAR\
|
||||||
|
|
||||||
|
$PR_RED$PR_HBAR<\
|
||||||
|
%(?..$PR_LIGHT_RED%?$PR_BLUE:)\
|
||||||
|
$PR_LIGHT_BLUE%(!.$PR_RED.$PR_WHITE)%#$PR_RED>$PR_HBAR\
|
||||||
|
$PR_NO_COLOUR '
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setprompt
|
||||||
|
|
@ -14,8 +14,7 @@ echo "\033[0;34mLooking for an existing zsh config...\033[0m"
|
||||||
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
|
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
|
||||||
then
|
then
|
||||||
echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";
|
echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";
|
||||||
cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
|
mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
|
||||||
rm ~/.zshrc;
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
|
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,20 @@ then
|
||||||
rm -rf ~/.oh-my-zsh
|
rm -rf ~/.oh-my-zsh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Looking for an existing zsh config..."
|
echo "Looking for original zsh config..."
|
||||||
if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
|
if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
|
||||||
then
|
then
|
||||||
echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
|
echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc";
|
||||||
rm ~/.zshrc;
|
|
||||||
cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
|
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
|
||||||
|
then
|
||||||
|
ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`";
|
||||||
|
echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}";
|
||||||
|
mv ~/.zshrc ~/${ZSHRC_SAVE};
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
|
||||||
|
|
||||||
source ~/.zshrc;
|
source ~/.zshrc;
|
||||||
else
|
else
|
||||||
echo "Switching back to bash"
|
echo "Switching back to bash"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue