Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh

This commit is contained in:
Joey Lomanto 2013-10-15 10:02:57 -04:00
commit 67c43d9b22
19 changed files with 165 additions and 24 deletions

5
.gitignore vendored
View file

@ -1,9 +1,8 @@
locals.zsh locals.zsh
log/.zsh_history log/.zsh_history
projects.zsh projects.zsh
custom/* custom/example
!custom/example custom/example.zsh
!custom/example.zsh
*.swp *.swp
!custom/example.zshcache !custom/example.zshcache
cache/ cache/

View file

@ -0,0 +1,12 @@
function gi() { curl http://gitignore.io/api/$@ ;}
_gitignireio_get_command_list() {
curl -s http://gitignore.io/api/list | tr "," "\n"
}
_gitignireio () {
compset -P '*,'
compadd -S '' `_gitignireio_get_command_list`
}
compdef _gitignireio gi

View file

@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# FILE: sfffe.plugin.zsh
# DESCRIPTION: search file for FE
# AUTHOR: yleo77 (ylep77@gmail.com)
# VERSION: 0.1
# REQUIRE: ack
# ------------------------------------------------------------------------------
if [ ! -x $(which ack) ]; then
echo \'ack\' is not installed!
exit -1
fi
ajs() {
ack "$@" --type js
}
acss() {
ack "$@" --type css
}
fjs() {
find ./ -name "$@*" -type f | grep '\.js'
}
fcss() {
find ./ -name "$@*" -type f | grep '\.css'
}

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 # 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 ## Functions

View file

@ -52,7 +52,7 @@ function extract() {
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;; (*.Z) uncompress "$1" ;;
(*.zip) unzip "$1" -d $extract_dir ;; (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;; (*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;
(*.deb) (*.deb)

View file

@ -1,5 +1,6 @@
# Open folder in ForkLift.app from console # Open folder in ForkLift.app of ForkLift2.app from console
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift2 by Johan Kaving
# #
# Usage: # Usage:
# fl [<folder>] # fl [<folder>]
@ -22,9 +23,33 @@ function fl {
fi fi
fi fi
osascript 2>&1 1>/dev/null <<END osascript 2>&1 1>/dev/null <<END
tell application "ForkLift"
try
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift2"
end tell
on error err_msg number err_num
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift"
end tell
end try
if application appName is running
tell application appName
activate activate
end tell end tell
else
tell application appName
activate
end tell
repeat until application appName is running
delay 1
end repeat
tell application appName
activate
end tell
end if
tell application "System Events" tell application "System Events"
tell application process "ForkLift" tell application process "ForkLift"
try try

View file

@ -20,6 +20,12 @@
# c. Or, use this file as a oh-my-zsh plugin. # 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 () _git-flow ()
{ {
local curcontext="$curcontext" state line local curcontext="$curcontext" state line

View file

@ -5,6 +5,8 @@ alias gst='git status'
compdef _git gst=git-status compdef _git gst=git-status
alias gd='git diff' alias gd='git diff'
compdef _git gd=git-diff compdef _git gd=git-diff
alias gdc='git diff --cached'
compdef _git gdc=git-diff
alias gl='git pull' alias gl='git pull'
compdef _git gl=git-pull compdef _git gl=git-pull
alias gup='git pull --rebase' alias gup='git pull --rebase'
@ -54,9 +56,9 @@ compdef gcount=git
alias gcl='git config --list' 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=10'
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=10'
compdef _git glgg=git-log compdef _git glgg=git-log
alias gplg="git log --no-merges --graph --pretty=format:'%C()%h%Creset - %C(green)%aN%Creset -%C(blue)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" alias gplg="git log --no-merges --graph --pretty=format:'%C()%h%Creset - %C(green)%aN%Creset -%C(blue)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
compdef _git gplg=git-log compdef _git gplg=git-log
@ -74,7 +76,10 @@ alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard' alias grhh='git reset HEAD --hard'
alias gclean='git reset --hard && git clean -dfx' alias gclean='git reset --hard && git clean -dfx'
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
alias gf='git ls-files | grep'
#remove the gf alias
#alias gf='git ls-files | grep'
alias gpoat='git push origin --all && git push origin --tags' alias gpoat='git push origin --all && git push origin --tags'
alias gmt='git mergetool --no-prompt' alias gmt='git mergetool --no-prompt'
compdef _git gm=git-mergetool compdef _git gm=git-mergetool
@ -128,3 +133,17 @@ function _git_log_prettily(){
} }
alias glp="_git_log_prettily" alias glp="_git_log_prettily"
compdef _git glp=git-log 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

@ -38,7 +38,13 @@ marks() {
} }
_completemarks() { _completemarks() {
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) 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 compctl -K _completemarks jump
compctl -K _completemarks unmark compctl -K _completemarks unmark

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. # 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#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

@ -62,6 +62,11 @@ case "$words[1]" in
'(--no-install)--no-install[only download packages]' \ '(--no-install)--no-install[only download packages]' \
'(--no-download)--no-download[only install downloaded packages]' \ '(--no-download)--no-download[only install downloaded packages]' \
'(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \ '(--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 '1: :->packages' && return 0
if [[ "$state" == packages ]]; then if [[ "$state" == packages ]]; then

View file

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

View file

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

View file

@ -14,7 +14,7 @@ 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 bi-weekly auto-update checks # Uncomment this to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true" # DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days) # Uncomment to change how often before auto-updates occur? (in days)

View file

@ -7,7 +7,7 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
git_custom_status() { git_custom_status() {
local cb=$(current_branch) local cb=$(current_branch)
if [ -n "$cb" ]; then if [ -n "$cb" ]; then
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi fi
} }

View file

@ -24,7 +24,8 @@ function theme_preview() {
THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//`
print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color" print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color"
source "$THEMES_DIR/$THEME" source "$THEMES_DIR/$THEME"
print -P $PROMPT cols=$(tput cols)
print -P "$PROMPT $RPROMPT"
} }
function banner() { function banner() {