Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/robbyrussell/oh-my-zsh: (94 commits)
  Fixing a few quirks in the latest installer updates (quoting /Users/robbyrussell/.oh-my-zsh and such). Also mentioining our twitter account after install
  Update license year
  Updating README to show the new install URL, which redirects to the raw files on github.
  Fixes ohmyzsh#2467 tab completion scrolls back in terminal when using bureau theme
  Add github url shortener
  Fix typo in autocomplete arguments
  Removed unsolicited aliases.
  Fix hgsl alias.
  Document alternate install paths via ZSH variable
  Abort installer on errors
  Write install path into .zshrc
  Reference default install path from ZSH variable
  Remove all copyright information in themes. Closes ohmyzsh#2587
  added mvnjetty alias
  added aliases for tomcat:run tomcat7:run
  added mvn-update
  Updated wd plugin to v0.3.0
  Integrate changes from ohmyzsh#1841.
  Fixed sublime plugin behaviors.
  🐼 Added simulator alias for Xcode plugin
  ...
  • Loading branch information
Xuyuanp committed Mar 14, 2014
2 parents 1ffe9cb + ee21fe9 commit 02c1e02
Show file tree
Hide file tree
Showing 72 changed files with 1,261 additions and 916 deletions.
2 changes: 1 addition & 1 deletion MIT-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 15 additions & 4 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,25 @@ You can install this via the command line with either `curl` or `wget`.

h4. via `curl`

@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
@curl -L http://install.ohmyz.sh | sh@

h4. via `wget`

@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@

h3. The manual way
h4. Optional: change the install 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
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@


h3. The manual way

1. Clone the repository

@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
Expand All @@ -35,7 +45,6 @@ h3. The manual way

@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@


4. Set zsh as your default shell:

@chsh -s /bin/zsh@
Expand All @@ -46,6 +55,8 @@ 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_.

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

h2. Usage

* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
Expand Down
6 changes: 3 additions & 3 deletions lib/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ else
fi
# List direcory contents
alias lsa='ls -lah'
alias l='ls -la'
alias ll='ls -l'
alias la='ls -lA'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
alias sl=ls # often screw this up

alias afind='ack-grep -il'
Expand Down
71 changes: 40 additions & 31 deletions lib/key-bindings.zsh
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
# TODO: Explain what some of this does..

bindkey -e
bindkey '\ew' kill-region
bindkey -s '\el' "ls\n"
bindkey '^r' history-incremental-search-backward
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history

# make search up and down work, so partially type and hit up/down to find relevant stuff
bindkey '^[[A' up-line-or-search
bindkey '^[[B' down-line-or-search

bindkey "^[[H" beginning-of-line
bindkey "^[[1~" beginning-of-line
bindkey "^[OH" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[4~" end-of-line
bindkey "^[OF" end-of-line
bindkey ' ' magic-space # also do history expansion on space

bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word

bindkey '^[[Z' reverse-menu-complete

# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
bindkey '^?' backward-delete-char
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets

# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi

bindkey -e # Use emacs key bindings

bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history

bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward

bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line

bindkey ' ' magic-space # [Space] - do history expansion

bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word

bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards

bindkey '^?' backward-delete-char # [Backspace] - delete backward
bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward

# Edit the current command line in $EDITOR
autoload -U edit-command-line
Expand Down
33 changes: 33 additions & 0 deletions lib/prompt_info_functions.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# *_prompt_info functions for usage in your prompt
#
# Plugin creators, please add your *_prompt_info function to the list
# of dummy implementations to help theme creators not receiving errors
# without the need of implementing conditional clauses.
#
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
# git_prompt_info, bzr_prompt_info and nvm_prompt_info

# Dummy implementations that return false to prevent command_not_found
# errors with themes, that implement these functions
# Real implementations will be used when the respective plugins are loaded
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
virtualenv_prompt_info {
return 1
}

# oh-my-zsh supports an rvm prompt by default
# get the name of the rvm ruby version
function rvm_prompt_info() {
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
[[ "${rvm_prompt}x" == "x" ]] && return 1
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}

# use this to enable users to see their ruby version, no matter which
# version management system they use
function ruby_prompt_info() {
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
}
2 changes: 0 additions & 2 deletions lib/rbenv.zsh

This file was deleted.

8 changes: 0 additions & 8 deletions lib/rvm.zsh

This file was deleted.

5 changes: 2 additions & 3 deletions lib/termsupport.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
local LINE="${2:gs/$/\\$}"
LINE="${LINE:gs/%/%%}"
title "$CMD" "%100>...>$LINE%<<"
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'
}

autoload -U add-zsh-hook
Expand Down
17 changes: 17 additions & 0 deletions plugins/aws/aws.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export AWS_HOME=~/.aws

function agp {
echo $AWS_DEFAULT_PROFILE

}
function asp {
export AWS_DEFAULT_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"

}
function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
}

compctl -K aws_profiles asp
source `which aws_zsh_completer.sh`
10 changes: 7 additions & 3 deletions plugins/battery/battery.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ if [[ $(uname) == "Darwin" ]] ; then
integer i=$(((currentcapacity/maxcapacity) * 100))
echo $i
}

function plugged_in() {
[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
}

function battery_pct_remaining() {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
battery_pct
else
if plugged_in ; then
echo "External Power"
else
battery_pct
fi
}

Expand Down
75 changes: 59 additions & 16 deletions plugins/brew/_brew
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,64 @@ _brew_installed_formulae() {
installed_formulae=(`brew list`)
}

_brew_installed_taps() {
installed_taps=(`brew tap`)
}

_brew_outdated_formulae() {
outdated_formulae=(`brew outdated`)
}

_brew_running_services() {
running_services=(`brew services list | awk '{print $1}'`)
}

local -a _1st_arguments
_1st_arguments=(
'audit:check formulae for Homebrew coding style'
'bundle:look for a Brewfile and run each line as a brew command'
'cat:display formula file for a formula'
'cleanup:uninstall unused and old versions of packages'
'commands:show a list of commands'
'create:create a new formula'
'deps:list dependencies and dependants of a formula'
'doctor:audits your installation for common issues'
'edit:edit a formula'
'home:visit the homepage of a formula or the brew project'
'info:information about a formula'
'install:install a formula'
'reinstall:install a formula anew; re-using its current options'
'link:link a formula'
'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula'
'missing:check all installed formuale for missing dependencies.'
'options:display install options specific to formula.'
'outdated:list formulas for which a newer version is available'
'outdated:list formulae for which a newer version is available'
'pin:pin specified formulae'
'prune:remove dead links'
'reinstall:reinstall a formula'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
'server:start a local web app that lets you browse formulae (requires Sinatra)'
'services:manage background services via launchctl'
'services:small wrapper around `launchctl` for supported formulae'
'tap:tap a new formula repository from GitHub, or list existing taps'
'unlink:unlink a formula'
'unpin:unpin specified formulae'
'untap:remove a tapped repository'
'update:freshen up links'
'upgrade:upgrade outdated formulae'
'uses:show formulas which depend on a formula'
'versions:show all available formula versions'
'uses:show formulae which depend on a formula'
)

local -a _service_arguments
_service_arguments=(
'cleanup:get rid of stale services and unused plists'
'list:list all services managed by `brew services`'
'restart:gracefully restart selected service'
'start:start selected service'
'stop:stop selected service'
)

local expl
local -a formulae installed_formulae
local -a formulae installed_formulae installed_taps outdated_formulae running_services

_arguments \
'(-v)-v[verbose]' \
Expand All @@ -61,24 +87,41 @@ if (( CURRENT == 1 )); then
fi

case "$words[1]" in
search|-S)
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
list|ls)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
'(--pinned)--pinned[list all versions of pinned formulae]' \
'(--versions)--versions[list all installed versions of a formula]' \
'1: :->forms' && return 0
'1: :->forms' && return 0

if [[ "$state" == forms ]]; then
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
fi ;;
install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
search|-S)
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
services)
if [[ -n "$words[2]" ]]; then
case "$words[2]" in
restart|start|stop)
_brew_running_services
_wanted running_services expl 'running services' compadd -a running_services ;;
esac
else
_describe -t commands "brew services subcommand" _service_arguments
fi ;;
untap)
_brew_installed_taps
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
esac
17 changes: 17 additions & 0 deletions plugins/catimg/catimg.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# http://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #
# Github: https://github.com/posva/catimg #
################################################################################


function catimg() {
if [[ -x `which convert` ]]; then
zsh $ZSH/plugins/catimg/catimg.sh $@
else
echo "catimg need convert (ImageMagick) to work)"
fi
}
Loading

0 comments on commit 02c1e02

Please sign in to comment.