Merge remote-tracking branch 'upstream/master'

Conflicts:
	.gitignore
	plugins/git/git.plugin.zsh
	plugins/jump/jump.plugin.zsh
	templates/zshrc.zsh-template
This commit is contained in:
Gaetan Semet 2013-09-24 14:30:27 +02:00
commit bd32698531
15 changed files with 119 additions and 13 deletions

View file

@ -14,7 +14,7 @@ eval "alias bi='bundle install --jobs=$cores_num'"
# The following is based on https://github.com/gma/bundler-exec
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor thin thor unicorn unicorn_rails puma)
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
## Functions

View file

@ -20,6 +20,12 @@
# c. Or, use this file as a oh-my-zsh plugin.
#
#Alias
alias gf='git flow'
alias gcd='git checkout develop'
alias gch='git checkout hotfix'
alias gcr='git checkout release'
_git-flow ()
{
local curcontext="$curcontext" state line

View file

@ -5,6 +5,8 @@ alias gst='git status'
compdef _git gst=git-status
alias gd='git diff'
compdef _git gd=git-diff
alias gdc='git diff --cached'
compdef _git gdc=git-diff
alias gl='git pull'
compdef _git gl=git-pull
alias gch='git fetch'
@ -69,9 +71,11 @@ alias gcl='git config --list'
compdef _git gcl=git-config
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=5 --color'
alias glg='git log --stat --max-count=10'
compdef _git glg=git-log
alias glgp='git log --stat --color -p'
alias glgg='git log --graph --max-count=10'
compdef _git glgg=git-log
alias glgg='git log --graph --max-count=10 -p'
compdef _git glgp=git-log
alias glgg='git log --graph --color'
compdef _git glgg=git-log
@ -93,6 +97,7 @@ alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
compdef _git gwc=git-whatchanged
alias gls='git ls-files | grep'
compdef _git gls=git-ls-files
alias gpoat='git push origin --all && git push origin --tags'
compdef _git gpoat=git-push
alias gmt='git mergetool --no-prompt'
@ -171,3 +176,16 @@ function _git_log_prettily(){
alias glp="_git_log_prettily"
compdef _git glp=git-log
# Work In Progress (wip)
# These features allow to pause a branch development and switch to another one (wip)
# When you want to go back to work, just unwip it
#
# This function return a warning if the current branch is a wip
function work_in_progress() {
if $(git log -n 1 | grep -q -c wip); then
echo "WIP!!"
fi
}
# these alias commit and uncomit wip branches
alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"'
alias gunwip='git log -n 1 | grep -q -c wip && git reset HEAD~1'

View file

@ -63,7 +63,13 @@ function marks()
function _completemarks()
{
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
else
if readlink -e "${MARKPATH}"/* &>/dev/null; then
reply=($(ls "${MARKPATH}"))
fi
fi
}
compctl -K _completemarks jump

View file

@ -0,0 +1,2 @@
# Allow SSH tab completion for mosh hostnames
compdef mosh=ssh

View file

@ -1,5 +1,13 @@
# Open the node api for your current version to the optional section.
# TODO: Make the section part easier to use.
function node-docs {
open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
# get the open command
local open_cmd
if [[ $(uname -s) == 'Darwin' ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
fi
$open_cmd "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
}

26
plugins/nvm/_nvm Normal file
View file

@ -0,0 +1,26 @@
#compdef nvm
#autoload
[[ -s ~/.nvm/nvm.sh ]] || return 0
local -a _1st_arguments
_1st_arguments=(
'help:show help'
'install:download and install a version'
'uninstall:uninstall a version'
'use:modify PATH to use version'
'run:run version with given arguments'
'ls:list installed versions or versions matching a given description'
'ls-remote:list remote versions available for install'
'deactivate:undo effects of NVM on current shell'
'alias:show or set aliases'
'unalias:deletes an alias'
'copy-packages:install global NPM packages to current version'
)
_arguments -C '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "nvm subcommand" _1st_arguments
return
fi

View file

@ -0,0 +1,3 @@
# The addition 'nvm install' attempts in ~/.profile
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh

View file

@ -6,8 +6,8 @@
_pip_all() {
# we cache the list of packages (originally from the macports plugin)
if (( ! $+piplist )); then
echo -n " (caching package index...)"
piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
echo -n " (caching package index...)"
piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
fi
}
@ -62,8 +62,13 @@ case "$words[1]" in
'(--no-install)--no-install[only download packages]' \
'(--no-download)--no-download[only install downloaded packages]' \
'(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
'(--single-version-externally-managed)--single-version-externally-managed[do not download/install dependencies. requires --record or --root]'\
'(--root)--root[treat this path as a fake chroot, installing into it. implies --single-version-externally-managed]'\
'(--record)--record[file to record all installed files to.]'\
'(-r --requirement)'{-r,--requirement}'[requirements file]: :_files'\
'(-e --editable)'{-e,--editable}'[path of or url to source to link to instead of installing.]: :_files -/'\
'1: :->packages' && return 0
if [[ "$state" == packages ]]; then
_pip_all
_wanted piplist expl 'packages' compadd -a piplist

View file

@ -31,7 +31,7 @@ compdef _rb19 rb19
function rb20 {
if [ -z "$1" ]; then
rvm use "$ruby"
rvm use "$ruby20"
else
rvm use "$ruby20@$1"
fi

View file

@ -21,7 +21,8 @@ elif [[ $('uname') == 'Darwin' ]]; then
for _sublime_path in $_sublime_darwin_paths; do
if [[ -a $_sublime_path ]]; then
alias st="'$_sublime_path'"
alias subl="'$_sublime_path'"
alias st=subl
break
fi
done