Skip to content

Commit

Permalink
Merge remote-tracking branch 'robby/master'
Browse files Browse the repository at this point in the history
* robby/master: (72 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  Adding compression to rsync commands
  ...
  • Loading branch information
Vincent Debergue committed Jul 1, 2014
2 parents d5bcaeb + 4131a59 commit 1e6abe5
Show file tree
Hide file tree
Showing 53 changed files with 451 additions and 244 deletions.
22 changes: 11 additions & 11 deletions README.textile
Expand Up @@ -10,22 +10,22 @@ h2. Setup

h3. The automatic installer... (do you trust me?)

You can install this via the command line with either `curl` or `wget`.
You can install this via the command line with either @curl@ or @wget@.

h4. via `curl`
h4. via @curl@

@curl -L http://install.ohmyz.sh | sh@

h4. via `wget`
h4. via @wget@

@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@

h4. Optional: change the install directory

The default location is `~/.oh-my-zsh` (hidden in your home directory).
The default location is @~/.oh-my-zsh@ (hidden in your home directory).

You can change the install directory with the ZSH environment variable, either
by running `export ZSH=/your/path` before installing, or setting it before the
by running @export ZSH=/your/path@ before installing, or setting it before the
end of the install pipeline like this:

@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
Expand All @@ -37,7 +37,7 @@ h3. The manual way

@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@

2. *OPTIONAL* Backup your existing ~/.zshrc file
2. *OPTIONAL* Backup your existing @~/.zshrc@ file

@cp ~/.zshrc ~/.zshrc.orig@

Expand All @@ -53,9 +53,9 @@ h3. The manual way

h3. Problems?

You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to _Oh My Zsh_.

If you installed manually or changed the install location, check ZSH in ~/.zshrc
If you installed manually or changed the install location, check ZSH in @~/.zshrc@

h2. Usage

Expand All @@ -72,16 +72,16 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization

If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
If you have many functions which go well together you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.

h3. Updates

By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your @~/.zshrc@

@DISABLE_UPDATE_PROMPT=true@

To disable updates entirely, put this in your ~/.zshrc
To disable updates entirely, put this in your @~/.zshrc@

@DISABLE_AUTO_UPDATE=true@

Expand Down
2 changes: 1 addition & 1 deletion lib/completion.zsh
Expand Up @@ -44,7 +44,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
usbmux uucp vcsa wwwrun xfs
usbmux uucp vcsa wwwrun xfs '_*'

# ... unless we really want to.
zstyle '*' single-ignored show
Expand Down
20 changes: 10 additions & 10 deletions lib/correction.zsh
@@ -1,13 +1,13 @@
alias man='nocorrect man'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias mkdir='nocorrect mkdir'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias ebuild='nocorrect ebuild'
alias hpodder='nocorrect hpodder'
alias sudo='nocorrect sudo'

if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias sudo='nocorrect sudo'

setopt correct_all
fi
2 changes: 1 addition & 1 deletion lib/functions.zsh
@@ -1,5 +1,5 @@
function zsh_stats() {
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}

function uninstall_oh_my_zsh() {
Expand Down
4 changes: 2 additions & 2 deletions lib/git.zsh
@@ -1,8 +1,8 @@
# get the name of the branch we are on
function git_prompt_info() {
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
Expand Down
23 changes: 17 additions & 6 deletions lib/grep.zsh
Expand Up @@ -3,11 +3,22 @@
# Examples: http://rubyurl.com/ZXv
#

# avoid VCS folders
GREP_OPTIONS=
for PATTERN in .cvs .git .hg .svn; do
GREP_OPTIONS+="--exclude-dir=$PATTERN "
done
GREP_OPTIONS+="--color=auto"
GREP_OPTIONS="--color=auto"

# avoid VCS folders (if the necessary grep flags are available)
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
if grep-flag-available --exclude-dir=.cvs; then
for PATTERN in .cvs .git .hg .svn; do
GREP_OPTIONS+=" --exclude-dir=$PATTERN"
done
elif grep-flag-available --exclude=.cvs; then
for PATTERN in .cvs .git .hg .svn; do
GREP_OPTIONS+=" --exclude=$PATTERN"
done
fi
unfunction grep-flag-available

export GREP_OPTIONS="$GREP_OPTIONS"
export GREP_COLOR='1;32'
4 changes: 3 additions & 1 deletion oh-my-zsh.sh
Expand Up @@ -46,7 +46,9 @@ else
fi

# Save the location of the current completion dump file.
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi

# Load and run compinit
autoload -U compinit
Expand Down
6 changes: 3 additions & 3 deletions plugins/autojump/autojump.plugin.zsh
@@ -1,14 +1,14 @@
if [ $commands[autojump] ]; then # check if autojump is installed
if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
. $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
. /etc/profile.d/autojump.sh
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
. /usr/local/share/autojump/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
. /opt/local/etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
Expand Down
Empty file modified plugins/bower/_bower 100755 → 100644
Empty file.
84 changes: 84 additions & 0 deletions plugins/brew-cask/brew-cask.plugin.zsh
@@ -0,0 +1,84 @@
# Autocompletion for homebrew-cask.
#
# This script intercepts calls to the brew plugin and adds autocompletion
# for the cask subcommand.
#
# Author: https://github.com/pstadler

compdef _brew-cask brew

_brew-cask()
{
local curcontext="$curcontext" state line
typeset -A opt_args

_arguments -C \
':command:->command' \
':subcmd:->subcmd' \
'*::options:->options'

case $state in
(command)
__call_original_brew
cask_commands=(
'cask:manage casks'
)
_describe -t commands 'brew cask command' cask_commands ;;

(subcmd)
case "$line[1]" in
cask)
if (( CURRENT == 3 )); then
local -a subcommands
subcommands=(
"alfred:used to modify Alfred's scope to include the Caskroom"
'audit:verifies installability of casks'
'checklinks:checks for bad cask links'
'cleanup:cleans up cached downloads'
'create:creates a cask of the given name and opens it in an editor'
'doctor:checks for configuration issues'
'edit:edits the cask of the given name'
'fetch:downloads Cask resources to local cache'
'home:opens the homepage of the cask of the given name'
'info:displays information about the cask of the given name'
'install:installs the cask of the given name'
'list:with no args, lists installed casks; given installed casks, lists installed files'
'search:searches all known casks'
'uninstall:uninstalls the cask of the given name'
"update:a synonym for 'brew update'"
)
_describe -t commands "brew cask subcommand" subcommands
fi ;;

*)
__call_original_brew ;;
esac ;;

(options)
local -a casks installed_casks
local expl
case "$line[2]" in
list|uninstall)
__brew_installed_casks
_wanted installed_casks expl 'installed casks' compadd -a installed_casks ;;
audit|edit|home|info|install)
__brew_all_casks
_wanted casks expl 'all casks' compadd -a casks ;;
esac ;;
esac
}

__brew_all_casks() {
casks=(`brew cask search`)
}

__brew_installed_casks() {
installed_casks=(`brew cask list`)
}

__call_original_brew()
{
local ret=1
_call_function ret _brew
compdef _brew-cask brew
}
9 changes: 5 additions & 4 deletions plugins/bundler/bundler.plugin.zsh
Expand Up @@ -3,10 +3,11 @@ alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
alias bu="bundle update"
alias bi="bundle_install"

# The following is based on https://github.com/gma/bundler-exec

bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife mailcatcher middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails)
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork spring strainer tailor taps thin thor unicorn unicorn_rails)

# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do
Expand All @@ -15,7 +16,7 @@ done

## Functions

bi() {
bundle_install() {
if _bundler-installed && _within-bundled-project; then
local bundler_version=`bundle version | cut -d' ' -f3`
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
Expand All @@ -39,8 +40,8 @@ _bundler-installed() {
}

_within-bundled-project() {
local check_dir=$PWD
while [ $check_dir != "/" ]; do
local check_dir="$PWD"
while [ "$check_dir" != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)"
done
Expand Down
2 changes: 1 addition & 1 deletion plugins/colemak/colemak.plugin.zsh
Expand Up @@ -19,4 +19,4 @@ bindkey -a 'N' vi-join
bindkey -a 'j' vi-forward-word-end
bindkey -a 'J' vi-forward-blank-word-end

lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less
lesskey $ZSH/plugins/colemak/colemak-less
10 changes: 5 additions & 5 deletions plugins/colorize/colorize.plugin.zsh
@@ -1,14 +1,14 @@
# Plugin for highligthing file content
# Plugin for highlighting file content
# Plugin highlights file content based on the filename extension.
# If no highlighting method supported for given extension then it tries
# guess it by looking for file content.

alias colorize='colorize_via_pygmentize'

colorize_via_pygmentize() {
if [ ! -x $(which pygmentize) ]; then
echo package \'pygmentize\' is not installed!
exit -1
if [ ! -x "$(which pygmentize)" ]; then
echo "package \'pygmentize\' is not installed!"
return -1
fi

if [ $# -eq 0 ]; then
Expand All @@ -25,4 +25,4 @@ colorize_via_pygmentize() {
pygmentize -g "$FNAME"
fi
done
}
}
3 changes: 1 addition & 2 deletions plugins/common-aliases/common-aliases.plugin.zsh
Expand Up @@ -3,7 +3,6 @@
#

# ls, the common ones I use a lot shortened for rapid fire usage
alias ls='ls --color' #I like color
alias l='ls -lFh' #size,show type,human readable
alias la='ls -lAFh' #long list,show almost all,show type,human readable
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
Expand Down Expand Up @@ -39,7 +38,7 @@ alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
alias -g P="2>&1| pygmentize -l pytb"

alias dud='du --max-depth=1 -h'
alias dud='du -d 1 -h'
alias duf='du -sh *'
alias fd='find . -type d -name'
alias ff='find . -type f -name'
Expand Down
3 changes: 3 additions & 0 deletions plugins/composer/composer.plugin.zsh
Expand Up @@ -46,3 +46,6 @@ alias cdu='composer dump-autoload'

# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'

# Add Composer's global binaries to PATH
export PATH=$PATH:~/.composer/vendor/bin
2 changes: 2 additions & 0 deletions plugins/django/django.plugin.zsh
Expand Up @@ -141,6 +141,7 @@ _managepy-sqlinitialdata(){}
_managepy-sqlreset(){}
_managepy-sqlsequencereset(){}
_managepy-startapp(){}
_managepy-startproject(){}

_managepy-syncdb() {
_arguments -s : \
Expand Down Expand Up @@ -198,6 +199,7 @@ _managepy-commands() {
'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
"startapp:Creates a Django app directory structure for the given app name in this project's directory."
"startproject:Creates a Django project directory structure for the given project name in this current directory."
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
'testserver:Runs a development server with data from the given fixture(s).'
Expand Down
2 changes: 1 addition & 1 deletion plugins/docker/_docker
Expand Up @@ -166,7 +166,7 @@ __rm() {

__rmi() {
_arguments \
'(-f,--force=)'{-f,--force=}'[Force]' \
'(-f,--force=)'{-f,--force=}'[Force]'
__docker_images
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/extract/extract.plugin.zsh
Expand Up @@ -52,7 +52,7 @@ function extract() {
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
(*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;;
(*.zip|*.war|*.jar|*.sublime-package) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
Expand Down

0 comments on commit 1e6abe5

Please sign in to comment.