mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
This commit is contained in:
commit
e2091b282b
30 changed files with 472 additions and 71 deletions
13
lib/git.zsh
13
lib/git.zsh
|
|
@ -9,16 +9,19 @@ 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=''
|
||||||
|
local GIT_STATUS=''
|
||||||
|
local CLEAN_MESSAGE='nothing to commit (working directory clean)'
|
||||||
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
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
|
||||||
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
|
||||||
|
if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
else
|
else
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# get the difference between the local and remote branches
|
# get the difference between the local and remote branches
|
||||||
|
|
@ -62,7 +65,7 @@ function git_prompt_long_sha() {
|
||||||
git_prompt_status() {
|
git_prompt_status() {
|
||||||
INDEX=$(git status --porcelain -b 2> /dev/null)
|
INDEX=$(git status --porcelain -b 2> /dev/null)
|
||||||
STATUS=""
|
STATUS=""
|
||||||
if $(echo "$INDEX" | grep '^\?\? ' &> /dev/null); then
|
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
||||||
fi
|
fi
|
||||||
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Check for updates on initial load...
|
# Check for updates on initial load...
|
||||||
if [ "$DISABLE_AUTO_UPDATE" != "true" ]
|
if [ "$DISABLE_AUTO_UPDATE" != "true" ]
|
||||||
then
|
then
|
||||||
/usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
|
/usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Initializes Oh My Zsh
|
# Initializes Oh My Zsh
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,7 @@
|
||||||
stat -f%m . > /dev/null 2>&1
|
|
||||||
if [ "$?" = 0 ]; then
|
|
||||||
stat_cmd=(stat -f%m)
|
|
||||||
else
|
|
||||||
stat_cmd=(stat -L --format=%Y)
|
|
||||||
fi
|
|
||||||
|
|
||||||
_ant_does_target_list_need_generating () {
|
_ant_does_target_list_need_generating () {
|
||||||
if [ ! -f .ant_targets ]; then return 0;
|
[ ! -f .ant_targets ] && return 0;
|
||||||
else
|
[ .ant_targets -nt build.xml ] && return 0;
|
||||||
accurate=$($stat_cmd .ant_targets)
|
return 1;
|
||||||
changed=$($stat_cmd build.xml)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ant () {
|
_ant () {
|
||||||
|
|
|
||||||
58
plugins/bower/_bower
Executable file
58
plugins/bower/_bower
Executable file
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Credits to npm's awesome completion utility.
|
||||||
|
#
|
||||||
|
# Bower completion script, based on npm completion script.
|
||||||
|
|
||||||
|
###-begin-bower-completion-###
|
||||||
|
#
|
||||||
|
# Installation: bower completion >> ~/.bashrc (or ~/.zshrc)
|
||||||
|
# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/bower
|
||||||
|
#
|
||||||
|
|
||||||
|
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
|
||||||
|
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
|
||||||
|
export COMP_WORDBREAKS
|
||||||
|
|
||||||
|
if type complete &>/dev/null; then
|
||||||
|
_bower_completion () {
|
||||||
|
local si="$IFS"
|
||||||
|
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
|
||||||
|
COMP_LINE="$COMP_LINE" \
|
||||||
|
COMP_POINT="$COMP_POINT" \
|
||||||
|
bower completion -- "${COMP_WORDS[@]}" \
|
||||||
|
2>/dev/null)) || return $?
|
||||||
|
IFS="$si"
|
||||||
|
}
|
||||||
|
complete -F _bower_completion bower
|
||||||
|
elif type compdef &>/dev/null; then
|
||||||
|
_bower_completion() {
|
||||||
|
si=$IFS
|
||||||
|
compadd -- $(COMP_CWORD=$((CURRENT-1)) \
|
||||||
|
COMP_LINE=$BUFFER \
|
||||||
|
COMP_POINT=0 \
|
||||||
|
bower completion -- "${words[@]}" \
|
||||||
|
2>/dev/null)
|
||||||
|
IFS=$si
|
||||||
|
}
|
||||||
|
compdef _bower_completion bower
|
||||||
|
elif type compctl &>/dev/null; then
|
||||||
|
_bower_completion () {
|
||||||
|
local cword line point words si
|
||||||
|
read -Ac words
|
||||||
|
read -cn cword
|
||||||
|
let cword-=1
|
||||||
|
read -l line
|
||||||
|
read -ln point
|
||||||
|
si="$IFS"
|
||||||
|
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
|
||||||
|
COMP_LINE="$line" \
|
||||||
|
COMP_POINT="$point" \
|
||||||
|
bower completion -- "${words[@]}" \
|
||||||
|
2>/dev/null)) || return $?
|
||||||
|
IFS="$si"
|
||||||
|
}
|
||||||
|
compctl -K _bower_completion bower
|
||||||
|
fi
|
||||||
|
###-end-bower-completion-###
|
||||||
|
|
||||||
|
|
@ -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 zeus)
|
bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () {
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f ${_cake_task_cache_file} ]; then return 0;
|
[ ! -f ${_cake_task_cache_file} ] && return 0;
|
||||||
else
|
[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
|
||||||
accurate=$(stat -f%m $_cake_task_cache_file)
|
return 1;
|
||||||
changed=$(stat -f%m Cakefile)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cake () {
|
_cake () {
|
||||||
|
|
@ -33,4 +30,4 @@ _cake () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _cake cake
|
compdef _cake cake
|
||||||
|
|
|
||||||
11
plugins/colored-man/colored-man.plugin.zsh
Normal file
11
plugins/colored-man/colored-man.plugin.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
man() {
|
||||||
|
env \
|
||||||
|
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||||
|
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||||
|
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_se=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
|
||||||
|
LESS_TERMCAP_ue=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_us=$(printf "\e[1;32m") \
|
||||||
|
man "$@"
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,8 @@ _composer_get_command_list () {
|
||||||
_composer () {
|
_composer () {
|
||||||
if [ -f composer.json ]; then
|
if [ -f composer.json ]; then
|
||||||
compadd `_composer_get_command_list`
|
compadd `_composer_get_command_list`
|
||||||
|
else
|
||||||
|
compadd create-project init search selfupdate show
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,4 +28,4 @@ alias ci='composer install'
|
||||||
alias ccp='composer create-project'
|
alias ccp='composer create-project'
|
||||||
|
|
||||||
# install composer in the current directory
|
# install composer in the current directory
|
||||||
alias cget='curl -s https://getcomposer.org/installer | php'
|
alias cget='curl -s https://getcomposer.org/installer | php'
|
||||||
|
|
|
||||||
29
plugins/emoji-clock/emoji-clock.plugin.zsh
Normal file
29
plugins/emoji-clock/emoji-clock.plugin.zsh
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# FILE: emoji-clock.plugin.zsh
|
||||||
|
# DESCRIPTION: The current time with half hour accuracy as an emoji symbol.
|
||||||
|
# Inspired by Andre Torrez' "Put A Burger In Your Shell"
|
||||||
|
# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
|
||||||
|
# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
|
||||||
|
# VERSION: 1.0.0
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function emoji-clock() {
|
||||||
|
hour=$(date '+%I')
|
||||||
|
minutes=$(date '+%M')
|
||||||
|
case $hour in
|
||||||
|
01) clock="🕐"; [ $minutes -ge 30 ] && clock="🕜";;
|
||||||
|
02) clock="🕑"; [ $minutes -ge 30 ] && clock="🕝";;
|
||||||
|
03) clock="🕒"; [ $minutes -ge 30 ] && clock="🕞";;
|
||||||
|
04) clock="🕓"; [ $minutes -ge 30 ] && clock="🕟";;
|
||||||
|
05) clock="🕔"; [ $minutes -ge 30 ] && clock="🕠";;
|
||||||
|
06) clock="🕕"; [ $minutes -ge 30 ] && clock="🕡";;
|
||||||
|
07) clock="🕖"; [ $minutes -ge 30 ] && clock="🕢";;
|
||||||
|
08) clock="🕗"; [ $minutes -ge 30 ] && clock="🕣";;
|
||||||
|
09) clock="🕘"; [ $minutes -ge 30 ] && clock="🕤";;
|
||||||
|
10) clock="🕙"; [ $minutes -ge 30 ] && clock="🕥";;
|
||||||
|
11) clock="🕚"; [ $minutes -ge 30 ] && clock="🕦";;
|
||||||
|
12) clock="🕛"; [ $minutes -ge 30 ] && clock="🕧";;
|
||||||
|
*) clock="⌛";;
|
||||||
|
esac
|
||||||
|
echo $clock
|
||||||
|
}
|
||||||
|
|
@ -17,8 +17,12 @@ 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'
|
||||||
compdef _git gc=git-commit
|
compdef _git gc=git-commit
|
||||||
|
alias gc!='git commit -v --amend'
|
||||||
|
compdef _git gc!=git-commit
|
||||||
alias gca='git commit -v -a'
|
alias gca='git commit -v -a'
|
||||||
compdef _git gca=git-commit
|
compdef _git gc=git-commit
|
||||||
|
alias gca!='git commit -v -a --amend'
|
||||||
|
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'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,22 @@
|
||||||
# Setup hub function for git, if it is available; http://github.com/defunkt/hub
|
# Setup hub function for git, if it is available; http://github.com/defunkt/hub
|
||||||
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
|
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
|
||||||
|
# Autoload _git completion functions
|
||||||
|
if declare -f _git > /dev/null; then
|
||||||
|
_git
|
||||||
|
fi
|
||||||
|
|
||||||
|
if declare -f _git_commands > /dev/null; then
|
||||||
|
_hub_commands=(
|
||||||
|
'alias:show shell instructions for wrapping git'
|
||||||
|
'pull-request:open a pull request on GitHub'
|
||||||
|
'fork:fork origin repo on GitHub'
|
||||||
|
'create:create new repo on GitHub for the current project'
|
||||||
|
'browse:browse the project on GitHub'
|
||||||
|
'compare:open GitHub compare view'
|
||||||
|
)
|
||||||
|
# Extend the '_git_commands' function with hub commands
|
||||||
|
eval "$(declare -f _git_commands | sed -e 's/base_commands=(/base_commands=(${_hub_commands} /')"
|
||||||
|
fi
|
||||||
# eval `hub alias -s zsh`
|
# eval `hub alias -s zsh`
|
||||||
function git(){
|
function git(){
|
||||||
if ! (( $+_has_working_hub )); then
|
if ! (( $+_has_working_hub )); then
|
||||||
|
|
|
||||||
|
|
@ -54,27 +54,14 @@ function in_gradle() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Define the stat_cmd command based on platform behavior
|
|
||||||
##########################################################################
|
|
||||||
stat -f%m . > /dev/null 2>&1
|
|
||||||
if [ "$?" = 0 ]; then
|
|
||||||
stat_cmd=(stat -f%m)
|
|
||||||
else
|
|
||||||
stat_cmd=(stat -L --format=%Y)
|
|
||||||
fi
|
|
||||||
|
|
||||||
############################################################################## Examine the build.gradle file to see if its
|
############################################################################## Examine the build.gradle file to see if its
|
||||||
# timestamp has changed, and if so, regen
|
# timestamp has changed, and if so, regen
|
||||||
# the .gradle_tasks cache file
|
# the .gradle_tasks cache file
|
||||||
############################################################################
|
############################################################################
|
||||||
_gradle_does_task_list_need_generating () {
|
_gradle_does_task_list_need_generating () {
|
||||||
if [ ! -f .gradletasknamecache ]; then return 0;
|
[ ! -f .gradletasknamecache ] && return 0;
|
||||||
else
|
[ .gradletasknamecache -nt build.gradle ] && return 0;
|
||||||
accurate=$($stat_cmd .gradletasknamecache)
|
return 1;
|
||||||
changed=$($stat_cmd build.gradle)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
#compdef knife
|
#compdef knife
|
||||||
|
|
||||||
|
# You can override the path to knife.rb and your cookbooks by setting
|
||||||
|
# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb
|
||||||
|
# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks
|
||||||
|
# Read around where these are used for more detail.
|
||||||
|
|
||||||
# These flags should be available everywhere according to man knife
|
# These flags should be available everywhere according to man knife
|
||||||
knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
|
knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
|
||||||
|
|
||||||
|
|
@ -170,11 +175,13 @@ _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() {
|
||||||
local knife_rb="$HOME/.chef/knife.rb"
|
|
||||||
if [ -f ./.chef/knife.rb ]; then
|
local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}
|
||||||
knife_rb="./.chef/knife.rb"
|
if [ -f ./.chef/knife.rb ]; then
|
||||||
fi
|
knife_rb="./.chef/knife.rb"
|
||||||
(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)
|
fi
|
||||||
|
local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
|
||||||
|
(for i in $cookbook_path; 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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ local cache_file="$ZSH/cache/last-working-dir"
|
||||||
|
|
||||||
# Updates the last directory once directory is changed.
|
# Updates the last directory once directory is changed.
|
||||||
function chpwd() {
|
function chpwd() {
|
||||||
echo "$PWD" > "$cache_file"
|
# Use >| in case noclobber is set to avoid "file exists" error
|
||||||
|
pwd >| "$cache_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Changes directory to the last working directory.
|
# Changes directory to the last working directory.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ alias hgco='hg checkout'
|
||||||
alias hgd='hg diff'
|
alias hgd='hg diff'
|
||||||
alias hged='hg diffmerge'
|
alias hged='hg diffmerge'
|
||||||
# pull and update
|
# pull and update
|
||||||
|
alias hgi='hg incoming'
|
||||||
alias hgl='hg pull -u'
|
alias hgl='hg pull -u'
|
||||||
|
alias hglr='hg pull --rebase'
|
||||||
|
alias hgo='hg outgoing'
|
||||||
alias hgp='hg push'
|
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
|
||||||
|
|
@ -17,4 +20,4 @@ function hg_current_branch() {
|
||||||
if [ -d .hg ]; then
|
if [ -d .hg ]; then
|
||||||
echo hg:$(hg branch)
|
echo hg:$(hg branch)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
_phing_does_target_list_need_generating () {
|
_phing_does_target_list_need_generating () {
|
||||||
if [ ! -f .phing_targets ]; then return 0;
|
[ ! -f .phing_targets ] && return 0;
|
||||||
else
|
[ .phing_targets -nt build.xml ] && return 0;
|
||||||
accurate=$(stat -f%m .phing_targets)
|
return 1;
|
||||||
changed=$(stat -f%m build.xml)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_phing () {
|
_phing () {
|
||||||
if [ -f build.xml ]; then
|
if [ -f build.xml ]; then
|
||||||
if _phing_does_target_list_need_generating; then
|
if _phing_does_target_list_need_generating; then
|
||||||
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
|
phing -l |grep -v ":$" |grep -v "^-*$" > .phing_targets
|
||||||
fi
|
fi
|
||||||
compadd `cat .phing_targets`
|
compadd `cat .phing_targets`
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
55
plugins/powify/_powify
Normal file
55
plugins/powify/_powify
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
#compdef powify
|
||||||
|
|
||||||
|
_powify_all_servers() {
|
||||||
|
all_servers=(`ls $HOME/.pow/`)
|
||||||
|
}
|
||||||
|
|
||||||
|
local -a all_servers
|
||||||
|
|
||||||
|
local -a _1st_arguments
|
||||||
|
_1st_arguments=(
|
||||||
|
'server:server specific commands'
|
||||||
|
'utils:manage powify'
|
||||||
|
'create:creates a pow app from the current directory (to change the name append name as an argument)'
|
||||||
|
'destroy:destroys the pow app linked to the current directory'
|
||||||
|
'restart:restarts the pow app linked to the current directory'
|
||||||
|
'always_restart:reload the pow app after each request'
|
||||||
|
'always_restart_off:do not reload the pow app after each request'
|
||||||
|
'rename:rename the current pow app to [NAME] or renmae [OLD] to [NEW]'
|
||||||
|
'environment:run the this pow app in a different environment (aliased `env`)'
|
||||||
|
'browse:opens and navigates the default browser to this app'
|
||||||
|
'logs:tail the application logs'
|
||||||
|
)
|
||||||
|
|
||||||
|
_arguments '*:: :->command'
|
||||||
|
|
||||||
|
if (( CURRENT == 1 )); then
|
||||||
|
_describe -t commands "powify command" _1st_arguments
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$words[1]" in
|
||||||
|
server)
|
||||||
|
_values \
|
||||||
|
'install[install pow server]' \
|
||||||
|
'reinstall[reinstall pow server]' \
|
||||||
|
'update[update pow server]' \
|
||||||
|
'uninstall[uninstall pow server]' \
|
||||||
|
'list[list all pow apps]' \
|
||||||
|
'start[start the pow server]' \
|
||||||
|
'stop[stop the pow server]' \
|
||||||
|
'restart[restart the pow server]' \
|
||||||
|
'host[adds all pow apps to /etc/hosts file]' \
|
||||||
|
'unhost[removes all pow apps from /etc/hosts file]' \
|
||||||
|
'status[print the current server status]' \
|
||||||
|
'config[print the current server configuration]' \
|
||||||
|
'logs[tails the pow server logs]' ;;
|
||||||
|
utils)
|
||||||
|
_values \
|
||||||
|
'install[install powify.dev server management tool]' \
|
||||||
|
'reinstall[reinstall powify.dev server management tool]' \
|
||||||
|
'uninstall[uninstall powify.dev server management tool]' ;;
|
||||||
|
destroy|restart|always_restart|always_restart_off|rename|browse|logs)
|
||||||
|
_powify_all_servers
|
||||||
|
_wanted all_servers expl 'all pow servers' compadd -a all_servers ;;
|
||||||
|
esac
|
||||||
54
plugins/safe-paste/safe-paste.plugin.zsh
Normal file
54
plugins/safe-paste/safe-paste.plugin.zsh
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Code from Mikael Magnusson: http://www.zsh.org/mla/users/2011/msg00367.html
|
||||||
|
#
|
||||||
|
# Requires xterm, urxvt, iTerm2 or any other terminal that supports bracketed
|
||||||
|
# paste mode as documented: http://www.xfree86.org/current/ctlseqs.html
|
||||||
|
|
||||||
|
# create a new keymap to use while pasting
|
||||||
|
bindkey -N paste
|
||||||
|
# make everything in this keymap call our custom widget
|
||||||
|
bindkey -R -M paste "^@"-"\M-^?" paste-insert
|
||||||
|
# these are the codes sent around the pasted text in bracketed
|
||||||
|
# paste mode.
|
||||||
|
# do the first one with both -M viins and -M vicmd in vi mode
|
||||||
|
bindkey '^[[200~' _start_paste
|
||||||
|
bindkey -M paste '^[[201~' _end_paste
|
||||||
|
# insert newlines rather than carriage returns when pasting newlines
|
||||||
|
bindkey -M paste -s '^M' '^J'
|
||||||
|
|
||||||
|
zle -N _start_paste
|
||||||
|
zle -N _end_paste
|
||||||
|
zle -N zle-line-init _zle_line_init
|
||||||
|
zle -N zle-line-finish _zle_line_finish
|
||||||
|
zle -N paste-insert _paste_insert
|
||||||
|
|
||||||
|
# switch the active keymap to paste mode
|
||||||
|
function _start_paste() {
|
||||||
|
bindkey -A paste main
|
||||||
|
}
|
||||||
|
|
||||||
|
# go back to our normal keymap, and insert all the pasted text in the
|
||||||
|
# command line. this has the nice effect of making the whole paste be
|
||||||
|
# a single undo/redo event.
|
||||||
|
function _end_paste() {
|
||||||
|
#use bindkey -v here with vi mode probably. maybe you want to track
|
||||||
|
#if you were in ins or cmd mode and restore the right one.
|
||||||
|
bindkey -e
|
||||||
|
LBUFFER+=$_paste_content
|
||||||
|
unset _paste_content
|
||||||
|
}
|
||||||
|
|
||||||
|
function _paste_insert() {
|
||||||
|
_paste_content+=$KEYS
|
||||||
|
}
|
||||||
|
|
||||||
|
function _zle_line_init() {
|
||||||
|
# Tell terminal to send escape codes around pastes.
|
||||||
|
[[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004h'
|
||||||
|
}
|
||||||
|
|
||||||
|
function _zle_line_finish() {
|
||||||
|
# Tell it to stop when we leave zle, so pasting in other programs
|
||||||
|
# doesn't get the ^[[200~ codes around the pasted text.
|
||||||
|
[[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004l'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Sublime Text 2 Aliases
|
# Sublime Text 2 Aliases
|
||||||
|
|
||||||
local _sublime_darwin_paths
|
local _sublime_darwin_paths > /dev/null 2>&1
|
||||||
_sublime_darwin_paths=(
|
_sublime_darwin_paths=(
|
||||||
"$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
"$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
||||||
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ compdef _symfony2 app/console
|
||||||
compdef _symfony2 sf
|
compdef _symfony2 sf
|
||||||
|
|
||||||
#Alias
|
#Alias
|
||||||
alias sf2='php app/console'
|
alias sf='php app/console'
|
||||||
alias sf2clear='php app/console cache:clear'
|
alias sfcl='php app/console cache:clear'
|
||||||
|
alias sfroute='php app/console router:debug'
|
||||||
|
alias sfgb='php app/console generate:bundle'
|
||||||
|
|
||||||
|
|
|
||||||
2
plugins/tmux/tmux.extra.conf
Normal file
2
plugins/tmux/tmux.extra.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
set -g default-terminal $ZSH_TMUX_TERM
|
||||||
|
source $HOME/.tmux.conf
|
||||||
1
plugins/tmux/tmux.only.conf
Normal file
1
plugins/tmux/tmux.only.conf
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
set -g default-terminal $ZSH_TMUX_TERM
|
||||||
85
plugins/tmux/tmux.plugin.zsh
Normal file
85
plugins/tmux/tmux.plugin.zsh
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
# Only run if tmux is actually installed
|
||||||
|
if which tmux &> /dev/null
|
||||||
|
then
|
||||||
|
# Configuration variables
|
||||||
|
#
|
||||||
|
# Automatically start tmux
|
||||||
|
[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false
|
||||||
|
# Only autostart once. If set to false, tmux will attempt to
|
||||||
|
# autostart every time your zsh configs are reloaded.
|
||||||
|
[[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true
|
||||||
|
# Automatically connect to a previous session if it exists
|
||||||
|
[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true
|
||||||
|
# Automatically close the terminal when tmux exits
|
||||||
|
[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART
|
||||||
|
# Set term to screen or screen-256color based on current terminal support
|
||||||
|
[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true
|
||||||
|
# The TERM to use for non-256 color terminals.
|
||||||
|
# Tmux states this should be screen, but you may need to change it on
|
||||||
|
# systems without the proper terminfo
|
||||||
|
[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen"
|
||||||
|
# The TERM to use for 256 color terminals.
|
||||||
|
# Tmux states this should be screen-256color, but you may need to change it on
|
||||||
|
# systems without the proper terminfo
|
||||||
|
[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color"
|
||||||
|
|
||||||
|
|
||||||
|
# Get the absolute path to the current directory
|
||||||
|
local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
|
# Determine if the terminal supports 256 colors
|
||||||
|
if [[ `tput colors` == "256" ]]
|
||||||
|
then
|
||||||
|
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
|
||||||
|
else
|
||||||
|
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the correct local config file to use.
|
||||||
|
if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
|
||||||
|
then
|
||||||
|
#use this when they have a ~/.tmux.conf
|
||||||
|
export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf"
|
||||||
|
else
|
||||||
|
#use this when they don't have a ~/.tmux.conf
|
||||||
|
export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wrapper function for tmux.
|
||||||
|
function _zsh_tmux_plugin_run()
|
||||||
|
{
|
||||||
|
# We have other arguments, just run them
|
||||||
|
if [[ -n "$@" ]]
|
||||||
|
then
|
||||||
|
\tmux $@
|
||||||
|
# Try to connect to an existing session.
|
||||||
|
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
||||||
|
then
|
||||||
|
\tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session
|
||||||
|
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||||
|
# Just run tmux, fixing the TERM variable if requested.
|
||||||
|
else
|
||||||
|
\tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
|
||||||
|
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use the completions for tmux for our function
|
||||||
|
compdef _tmux _zsh_tmux_plugin_run
|
||||||
|
|
||||||
|
# Alias tmux to our wrapper function.
|
||||||
|
alias tmux=_zsh_tmux_plugin_run
|
||||||
|
|
||||||
|
# Autostart if not already in tmux and enabled.
|
||||||
|
if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]
|
||||||
|
then
|
||||||
|
# Actually don't autostart if we already did and multiple autostarts are disabled.
|
||||||
|
if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]
|
||||||
|
then
|
||||||
|
export ZSH_TMUX_AUTOSTARTED=true
|
||||||
|
_zsh_tmux_plugin_run
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin."
|
||||||
|
fi
|
||||||
36
plugins/tmuxinator/_tmuxinator
Normal file
36
plugins/tmuxinator/_tmuxinator
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
#compdef tmuxinator
|
||||||
|
#autoload
|
||||||
|
|
||||||
|
local curcontext="$curcontext" state line ret=1
|
||||||
|
local -a _configs
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
'1: :->cmds' \
|
||||||
|
'2:: :->args' && ret=0
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
cmds)
|
||||||
|
_values "tmuxinator command" \
|
||||||
|
"start[start a tmux session using project's tmuxinator config]" \
|
||||||
|
"open[create a new project file and open it in your editor]" \
|
||||||
|
"copy[copy source_project project file to a new project called new_project]" \
|
||||||
|
"delete[deletes the project called project_name]" \
|
||||||
|
"implode[deletes all existing projects!]" \
|
||||||
|
"list[list all existing projects]" \
|
||||||
|
"doctor[look for problems in your configuration]" \
|
||||||
|
"help[shows this help document]" \
|
||||||
|
"version[shows tmuxinator version number]"
|
||||||
|
ret=0
|
||||||
|
;;
|
||||||
|
args)
|
||||||
|
case $line[1] in
|
||||||
|
start|open|copy|delete)
|
||||||
|
_configs=(`tmuxinator list | sed -n 's/^[ \t]\+//p'`)
|
||||||
|
_values 'configs' $_configs
|
||||||
|
ret=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
@ -8,18 +8,19 @@ _1st_arguments=(
|
||||||
'box:Box commands'
|
'box:Box commands'
|
||||||
'destroy:Destroys the vagrant environment'
|
'destroy:Destroys the vagrant environment'
|
||||||
'halt:Halts the currently running vagrant environment'
|
'halt:Halts the currently running vagrant environment'
|
||||||
'help:[TASK] Describe available tasks or one specific task'
|
|
||||||
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
|
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
|
||||||
'package:Packages a vagrant environment for distribution'
|
'package:Packages a vagrant environment for distribution'
|
||||||
|
'plugin:Plugin commands'
|
||||||
'provision:Run the provisioner'
|
'provision:Run the provisioner'
|
||||||
'reload:Reload the vagrant environment'
|
'reload:Reload the vagrant environment'
|
||||||
'resume:Resumes a suspend vagrant environment'
|
'resume:Resumes a suspend vagrant environment'
|
||||||
'ssh:SSH into the currently running environment'
|
'ssh:SSH into the currently running environment'
|
||||||
'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
|
'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
|
||||||
'status:Shows the status of the current Vagrant environment.'
|
'status:Shows the status of the current Vagrant environment.'
|
||||||
'suspend:Suspends the currently running vagrant environment'
|
'suspend:Suspends the currently running vagrant environment'
|
||||||
'up:Creates the vagrant environment'
|
'up:Creates the vagrant environment'
|
||||||
'version:Prints the Vagrant version information'
|
'--help:[TASK] Describe available tasks or one specific task'
|
||||||
|
'--version:Prints the Vagrant version information'
|
||||||
)
|
)
|
||||||
|
|
||||||
local -a _box_arguments
|
local -a _box_arguments
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,6 @@
|
||||||
# Zeus preloads your Rails environment and forks that process whenever
|
# Zeus preloads your Rails environment and forks that process whenever
|
||||||
# needed. This effectively speeds up Rails' boot process to under 1 sec.
|
# needed. This effectively speeds up Rails' boot process to under 1 sec.
|
||||||
|
|
||||||
# Always use bundler.
|
|
||||||
# Rails depends on bundler, so we can be pretty sure, that there are no
|
|
||||||
# problems with this command. For all the other aliases I provided an
|
|
||||||
# alternative, in case people have conflicts with other plugins (e.g. suse).
|
|
||||||
alias zeus='bundle exec zeus'
|
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
alias zi='zeus init'
|
alias zi='zeus init'
|
||||||
alias zinit='zeus init'
|
alias zinit='zeus init'
|
||||||
|
|
|
||||||
11
themes/gianu.zsh-theme
Normal file
11
themes/gianu.zsh-theme
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Oh-my-Zsh prompt created by gianu
|
||||||
|
#
|
||||||
|
# github.com/gianu
|
||||||
|
# sgianazza@gmail.com
|
||||||
|
|
||||||
|
PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ '
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[green]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}"
|
||||||
19
themes/itchy.zsh-theme
Normal file
19
themes/itchy.zsh-theme
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Created by Daniel Bayerlein https://github.com/danielbayerlein
|
||||||
|
# Inspired by http://peepcode.com/blog/2012/my-command-line-prompt
|
||||||
|
|
||||||
|
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
|
||||||
|
|
||||||
|
local user="%{$fg[cyan]%}%n%{$reset_color%}"
|
||||||
|
local host="%{$fg[cyan]%}@%m%{$reset_color%}"
|
||||||
|
local pwd="%{$fg[yellow]%}%~%{$reset_color%}"
|
||||||
|
|
||||||
|
PROMPT='${user}${host} ${pwd}
|
||||||
|
${smiley} '
|
||||||
|
|
||||||
|
RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔%{$reset_color%}"
|
||||||
|
|
||||||
23
themes/jaischeema.zsh-theme
Normal file
23
themes/jaischeema.zsh-theme
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# FILE: jaischeema.zsh-theme
|
||||||
|
# DESCRIPTION: oh-my-zsh theme file.
|
||||||
|
# AUTHOR: Jais Cheema
|
||||||
|
# VERSION: 0.0.1
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} '
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="±(%{$fg[red]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%} "
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) "
|
||||||
|
|
||||||
|
if which rbenv &> /dev/null; then
|
||||||
|
RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}'
|
||||||
|
else
|
||||||
|
if which rvm-prompt &> /dev/null; then
|
||||||
|
RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
12
themes/kiwi.zsh-theme
Normal file
12
themes/kiwi.zsh-theme
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#
|
||||||
|
# Kiwi ZSH Theme
|
||||||
|
#
|
||||||
|
|
||||||
|
PROMPT='%{$fg_bold[green]%}┌[%{$fg_bold[cyan]%}kiwish-4.2%{$fg_bold[green]%}]-(%{$fg_bold[white]%}%2~%{$fg_bold[green]%})-$(git_prompt_info)$(svn_prompt_info)$(battery_pct_prompt)
|
||||||
|
└> % %{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}git:%{$fg_bold[white]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[green]%}]-"
|
||||||
|
|
||||||
|
ZSH_THEME_SVN_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}svn:%{$fg_bold[white]%}/"
|
||||||
|
ZSH_THEME_SVN_PROMPT_SUFFIX="%{$fg_bold[green]%}]-"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue