Skip to content

Commit

Permalink
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo Curiel committed Jun 20, 2016
2 parents cf88037 + d012402 commit 1c8c7bb
Show file tree
Hide file tree
Showing 75 changed files with 2,278 additions and 334 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
locals.zsh
log/.zsh_history
projects.zsh
custom
# custom files
custom/
!custom/plugins/example
!custom/example.zsh
*.swp
!custom/example.zshcache

# temp files directories
cache/
log/
File renamed without changes.
2 changes: 1 addition & 1 deletion README.markdown → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-

## License

Oh My Zsh is released under the [MIT license](MIT-LICENSE.txt).
Oh My Zsh is released under the [MIT license](LICENSE.txt).
4 changes: 0 additions & 4 deletions cache/.easter-egg

This file was deleted.

Empty file added cache/.gitkeep
Empty file.
13 changes: 9 additions & 4 deletions custom/example.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Add yourself some shortcuts to projects you often work on
# Example:
# You can put files here to add functionality separated per file, which
# will be ignored by git.
# Files on the custom/ directory will be automatically loaded by the init
# script, in alphabetical order.

# For example: add yourself some shortcuts to projects you often work on.
#
# brainstormr=~/Projects/development/planetargon/brainstormr
# cd $brainstormr
#
# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
#
8 changes: 3 additions & 5 deletions lib/theme-and-appearance.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ then
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
elif [[ "$(uname -s)" == "OpenBSD" ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
Expand All @@ -22,10 +22,8 @@ then
fi
fi

#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevars

if [[ x$WINDOW != x ]]
then
Expand Down
4 changes: 0 additions & 4 deletions log/.easter-egg

This file was deleted.

Empty file added log/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions plugins/arcanist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## arcanist

**Maintainer:** [@emzar](https://github.com/emzar)

This plugin adds many useful aliases.
21 changes: 21 additions & 0 deletions plugins/arcanist/arcanist.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Aliases
# (sorted alphabetically)
#

alias ara='arc amend'
alias arb='arc branch'
alias arco='arc cover'
alias arci='arc commit'

alias ard='arc diff'
alias ardnu='arc diff --nounit'
alias ardnupc='arc diff --nounit --plan-changes'
alias ardpc='arc diff --plan-changes'

alias are='arc export'
alias arh='arc help'
alias arl='arc land'
alias arli='arc lint'
alias arls='arc list'
alias arpa='arc patch'
1 change: 1 addition & 0 deletions plugins/bower/bower.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ _bower ()
compadd "$@" $(echo $bower_package_list)
;;
*)
_arguments \
$_no_color \
;;
esac
Expand Down
7 changes: 6 additions & 1 deletion plugins/branch/branch.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ function branch_prompt_info() {
# Mercurial repository
if [[ -d "${current_dir}/.hg" ]]
then
echo '' $(<"$current_dir/.hg/branch")
if [[ -f "$current_dir/.hg/branch" ]]
then
echo '' $(<"$current_dir/.hg/branch")
else
echo '☿ default'
fi
return;
fi
# Defines path as parent directory and keeps looking for :)
Expand Down
27 changes: 23 additions & 4 deletions plugins/cakephp3/cakephp3.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# CakePHP 3 basic command completion
_cakephp3_get_command_list () {
cakephp3commands=($(bin/cake completion commands));printf "%s\n" "${cakephp3commands[@]}"
bin/cake Completion commands
}

_cakephp3_get_sub_command_list () {
bin/cake Completion subcommands ${words[2]}
}

_cakephp3_get_3rd_argument () {
bin/cake ${words[2]} ${words[3]} | \grep '\-\ '| \awk '{print $2}'
}

_cakephp3 () {
if [ -f bin/cake ]; then
compadd `_cakephp3_get_command_list`
local -a has3rdargument
has3rdargument=("all" "controller" "fixture" "model" "template")
if [ -f bin/cake ]; then
if (( CURRENT == 2 )); then
compadd $(_cakephp3_get_command_list)
fi
if (( CURRENT == 3 )); then
compadd $(_cakephp3_get_sub_command_list)
fi
if (( CURRENT == 4 )); then
if [[ ${has3rdargument[(i)${words[3]}]} -le ${#has3rdargument} ]]; then
compadd $(_cakephp3_get_3rd_argument)
fi
fi
fi
}

Expand All @@ -14,6 +34,5 @@ compdef _cakephp3 cake

#Alias
alias c3='bin/cake'

alias c3cache='bin/cake orm_cache clear'
alias c3migrate='bin/cake migrations migrate'
29 changes: 22 additions & 7 deletions plugins/emacs/emacsclient.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
#!/bin/sh

# get list of available X windows.
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
function _emacsfun
{
# get list of available X windows.
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`

if [ -z "$x" ] || [ "$x" = "nil" ] ;then
# Create one if there is no X window yet.
emacsclient --alternate-editor "" --create-frame "$@"
if [ -z "$x" ] || [ "$x" = "nil" ] ;then
# Create one if there is no X window yet.
emacsclient --alternate-editor "" --create-frame "$@"
else
# prevent creating another X frame if there is at least one present.
emacsclient --alternate-editor "" "$@"
fi
}


# adopted from https://github.com/davidshepherd7/emacs-read-stdin/blob/master/emacs-read-stdin.sh
# If the second argument is - then write stdin to a tempfile and open the
# tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh)
if [[ $# -ge 2 ]] && [[ "$2" == - ]]; then
tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)"
cat - > "$tempfile"
_emacsfun --no-wait $tempfile
else
# prevent creating another X frame if there is at least one present.
emacsclient --alternate-editor "" "$@"
_emacsfun "$@"
fi
2 changes: 1 addition & 1 deletion plugins/fasd/fasd.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ if [ $commands[fasd] ]; then # check if fasd is installed
source "$fasd_cache"
unset fasd_cache

alias v='f -e vim'
alias v="f -e $EDITOR"
alias o='a -e open_command'
fi
7 changes: 7 additions & 0 deletions plugins/fossil/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Fossil Plugin

This plugin adds completion support and prompt for fossil repositories.
The prompt will display the current branch and status been dirty or clean.

### CONTRIBUTOR
- Jefferson González ([jgmdev](https://github.com/jgmdev))
89 changes: 89 additions & 0 deletions plugins/fossil/fossil.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
_FOSSIL_PROMPT=""

# Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}"

# At the very end of the prompt
ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})"

# Text to display if the branch is dirty
ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"

# Text to display if the branch is clean
ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"

function fossil_prompt_info () {
local _OUTPUT=`fossil branch 2>&1`
local _STATUS=`echo $_OUTPUT | grep "use --repo"`
if [ "$_STATUS" = "" ]; then
local _EDITED=`fossil changes`
local _EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
local _BRANCH=`echo $_OUTPUT | grep "* " | sed 's/* //g'`

if [ "$_EDITED" != "" ]; then
_EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_DIRTY"
fi

echo "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \
"$_BRANCH" \
"$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \
"$_EDITED_SYM"\
"%{$reset_color%}"
fi
}

function _fossil_get_command_list () {
fossil help -a | grep -v "Usage|Common|This is"
}

function _fossil () {
local context state state_descr line
typeset -A opt_args

_arguments \
'1: :->command'\
'2: :->subcommand'

case $state in
command)
local _OUTPUT=`fossil branch 2>&1 | grep "use --repo"`
if [ "$_OUTPUT" = "" ]; then
compadd `_fossil_get_command_list`
else
compadd clone init import help version
fi
;;
subcommand)
if [ "$words[2]" = "help" ]; then
compadd `_fossil_get_command_list`
else
compcall -D
fi
;;
esac
}

function _fossil_prompt () {
local current=`echo $PROMPT $RPROMPT | grep fossil`

if [ "$_FOSSIL_PROMPT" = "" -o "$current" = "" ]; then
local _prompt=${PROMPT}
local _rprompt=${RPROMPT}

local is_prompt=`echo $PROMPT | grep git`

if [ "$is_prompt" = "" ]; then
export RPROMPT="$_rprompt"'$(fossil_prompt_info)'
else
export PROMPT="$_prompt"'$(fossil_prompt_info) '
fi

_FOSSIL_PROMPT="1"
fi
}

compdef _fossil fossil

autoload -U add-zsh-hook

add-zsh-hook precmd _fossil_prompt
7 changes: 5 additions & 2 deletions plugins/git/git.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ alias gbss='git bisect start'

alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a -s --no-edit --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
Expand Down Expand Up @@ -155,6 +157,7 @@ alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
compdef _git glp=git-log

Expand Down Expand Up @@ -196,7 +199,7 @@ alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
alias gsta='git stash'
alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstd='git stash drop'
alias gstl='git stash list'
Expand Down
5 changes: 4 additions & 1 deletion plugins/gitfast/_git
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ __git_zsh_bash_func ()

local expansion=$(__git_aliased_command "$command")
if [ -n "$expansion" ]; then
words[1]=$expansion
completion_func="_git_${expansion//-/_}"
declare -f $completion_func >/dev/null && $completion_func
fi
Expand Down Expand Up @@ -213,8 +214,10 @@ _git ()

if (( $+functions[__${service}_zsh_main] )); then
__${service}_zsh_main
else
elif (( $+functions[__${service}_main] )); then
emulate ksh -c __${service}_main
elif (( $+functions[_${service}] )); then
emulate ksh -c _${service}
fi

let _ret && _default && _ret=0
Expand Down

0 comments on commit 1c8c7bb

Please sign in to comment.