Commit e8639c70 authored by Tim O'Brien's avatar Tim O'Brien
Browse files

Update to current robbyrussell/oh-my-zsh master

parents 797e1f9a 9c08641d
...@@ -18,8 +18,6 @@ if [[ -x `which curl` ]]; then ...@@ -18,8 +18,6 @@ if [[ -x `which curl` ]]; then
W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g') W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
if [ "$W" -a "$TXT" ]; then if [ "$W" -a "$TXT" ]; then
echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}${TXT}${END_COLOR}" echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}${TXT}${END_COLOR}"
else
quote
fi fi
} }
#quote #quote
......
...@@ -2,14 +2,11 @@ _homebrew-installed() { ...@@ -2,14 +2,11 @@ _homebrew-installed() {
type brew &> /dev/null type brew &> /dev/null
} }
_rbenv-from-homebrew-installed() {
brew --prefix rbenv &> /dev/null
}
FOUND_RBENV=0 FOUND_RBENV=0
rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv") rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv")
if _homebrew-installed && _rbenv-from-homebrew-installed ; then if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then
rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}")
unset rbenv_homebrew_path
fi fi
for rbenvdir in "${rbenvdirs[@]}" ; do for rbenvdir in "${rbenvdirs[@]}" ; do
......
...@@ -61,11 +61,11 @@ function gems { ...@@ -61,11 +61,11 @@ function gems {
local current_ruby=`rvm-prompt i v p` local current_ruby=`rvm-prompt i v p`
local current_gemset=`rvm-prompt g` local current_gemset=`rvm-prompt g`
gem list $@ | sed \ gem list $@ | sed -E \
-Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ -e "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \
-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ -e "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ -e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" -e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
} }
function _rvm_completion { function _rvm_completion {
......
# Spring Boot oh-my-zsh plugin
oh-my-zsh Spring Boot plugin
## Spring Boot autocomplete plugin
- Adds autocomplete options for all spring boot commands.
## Manual Install
$ cd ~/.oh-my-zsh/plugins
$ git clone git@github.com:linux-china/oh-my-zsh-spring-boot-plugin.git spring
Adjust your .zshrc file and add spring to plugins=(...)
## Tips
* Install Spring Cloud plugin: spring install org.springframework.cloud:spring-cloud-cli:1.0.2.RELEASE
## Reference
* Spring Boot: http://projects.spring.io/spring-boot/
* Spring Boot CLI: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli
Maintainer : linux_china ([@linux_china](https://twitter.com/linux_china))
#compdef spring 'spring'
#autoload
_spring() {
local cword
let cword=CURRENT-1
local hints
hints=()
local reply
while read -r line; do
reply=`echo "$line" | awk '{printf $1 ":"; for (i=2; i<NF; i++) printf $i " "; print $NF}'`
hints+=("$reply")
done < <(spring hint ${cword} ${words[*]})
if ((cword == 1)) {
_describe -t commands 'commands' hints
return 0
}
_describe -t options 'options' hints
_files
return 0
}
_spring "$@"
\ No newline at end of file
...@@ -5,7 +5,7 @@ _symfony_console () { ...@@ -5,7 +5,7 @@ _symfony_console () {
} }
_symfony2_get_command_list () { _symfony2_get_command_list () {
`_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }' `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
} }
_symfony2 () { _symfony2 () {
......
...@@ -140,12 +140,16 @@ d0() { ...@@ -140,12 +140,16 @@ d0() {
# gather external ip address # gather external ip address
geteip() { geteip() {
curl http://ifconfig.me curl -s -S https://icanhazip.com
} }
# determine local IP address # determine local IP address
getip() { getip() {
if (( ${+commands[ip]} )); then
ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
else
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
fi
} }
# Clear zombie processes # Clear zombie processes
......
# The Fuck
[The Fuck](https://github.com/nvbn/thefuck) plugin — magnificent app which corrects your previous console command.
## Usage
Press `ESC` twice to correct previous console command.
## Notes
`Esc`-`Esc` key binding conflicts with [sudo](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo) plugin.
if [[ -z $commands[thefuck] ]]; then
echo 'thefuck is not installed, you should "pip install thefuck" first'
return -1
fi
# Register alias
eval "$(thefuck --alias)"
fuck-command-line() {
local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"
[[ -z $FUCK ]] && echo -n -e "\a" && return
BUFFER=$FUCK
zle end-of-line
}
zle -N fuck-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey "\e\e" fuck-command-line
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# https://github.com/dbb # https://github.com/dbb
# https://github.com/Mappleconfusers # https://github.com/Mappleconfusers
# Nicolas Jonas nextgenthemes.com # Nicolas Jonas nextgenthemes.com
# https://github.com/loctauxphilippe
# #
# Debian, Ubuntu and friends related zsh aliases and functions for zsh # Debian, Ubuntu and friends related zsh aliases and functions for zsh
...@@ -28,6 +29,7 @@ compdef _ppap ppap='sudo ppa-purge' ...@@ -28,6 +29,7 @@ compdef _ppap ppap='sudo ppa-purge'
alias ag='sudo apt-get' # age - but without sudo alias ag='sudo apt-get' # age - but without sudo
alias aga='sudo apt-get autoclean' # aac alias aga='sudo apt-get autoclean' # aac
alias agar='sudo apt-get autoremove'
alias agb='sudo apt-get build-dep' # abd alias agb='sudo apt-get build-dep' # abd
alias agc='sudo apt-get clean' # adc alias agc='sudo apt-get clean' # adc
alias agd='sudo apt-get dselect-upgrade' # ads alias agd='sudo apt-get dselect-upgrade' # ads
...@@ -38,9 +40,11 @@ alias agu='sudo apt-get update' # ad ...@@ -38,9 +40,11 @@ alias agu='sudo apt-get update' # ad
alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
alias agug='sudo apt-get upgrade' # ag alias agug='sudo apt-get upgrade' # ag
alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg
alias agar='sudo apt-get autoremove'
compdef _ag ag='sudo apt-get' compdef _ag ag='sudo apt-get'
compdef _aga aga='sudo apt-get autoclean' compdef _aga aga='sudo apt-get autoclean'
compdef _agar agar='sudo apt-get autoremove'
compdef _agb agb='sudo apt-get build-dep' compdef _agb agb='sudo apt-get build-dep'
compdef _agc agc='sudo apt-get clean' compdef _agc agc='sudo apt-get clean'
compdef _agd agd='sudo apt-get dselect-upgrade' compdef _agd agd='sudo apt-get dselect-upgrade'
...@@ -51,6 +55,7 @@ compdef _agu agu='sudo apt-get update' ...@@ -51,6 +55,7 @@ compdef _agu agu='sudo apt-get update'
compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade' compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
compdef _agug agug='sudo apt-get upgrade' compdef _agug agug='sudo apt-get upgrade'
compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade' compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
compdef _agar agar='sudo apt-get autoremove'
# Remove ALL kernel images and headers EXCEPT the one in use # Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
...@@ -65,7 +70,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' ...@@ -65,7 +70,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
# apt-add-repository with automatic install/upgrade of the desired package # apt-add-repository with automatic install/upgrade of the desired package
# Usage: aar ppa:xxxxxx/xxxxxx [packagename] # Usage: aar ppa:xxxxxx/xxxxxx [packagename]
# If packagename is not given as 2nd arument the function will ask for it and guess the defaupt by taking # If packagename is not given as 2nd argument the function will ask for it and guess the default by taking
# the part after the / from the ppa name wich is sometimes the right name for the package you want to install # the part after the / from the ppa name wich is sometimes the right name for the package you want to install
aar() { aar() {
if [ -n "$2" ]; then if [ -n "$2" ]; then
......
function vundle-init () { function vundle-init () {
if [ ! -d ~/.vim/bundle/vundle/ ] if [ ! -d ~/.vim/bundle/Vundle.vim/ ]
then then
mkdir -p ~/.vim/bundle/vundle/ mkdir -p ~/.vim/bundle/Vundle.vim/
fi fi
if [ ! -d ~/.vim/bundle/vundle/.git ] && [ ! -f ~/.vim/bundle/vundle/.git ] if [ ! -d ~/.vim/bundle/Vundle.vim/.git ] && [ ! -f ~/.vim/bundle/Vundle.vim/.git ]
then then
git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle git clone git://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" echo "\n\tRead about vim configuration for vundle at https://github.com/VundleVim/Vundle.vim\n"
fi fi
} }
......
set -e set -e
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
echo "\033[0;33m Zsh is not installed!\033[0m Please install zsh first!"
exit
fi
unset CHECK_ZSH_INSTALLED
if [ ! -n "$ZSH" ]; then if [ ! -n "$ZSH" ]; then
ZSH=~/.oh-my-zsh ZSH=~/.oh-my-zsh
fi fi
...@@ -23,14 +30,16 @@ fi ...@@ -23,14 +30,16 @@ fi
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
cp $ZSH/templates/zshrc.zsh-template ~/.zshrc cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
sed -i -e "/^export ZSH=/ c\\ sed "/^export ZSH=/ c\\
export ZSH=$ZSH export ZSH=$ZSH
" ~/.zshrc " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
sed -i -e "/export PATH=/ c\\ sed "/export PATH=/ c\\
export PATH=\"$PATH\" export PATH=\"$PATH\"
" ~/.zshrc " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
......
...@@ -9,7 +9,7 @@ then ...@@ -9,7 +9,7 @@ then
printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
printf '\033[0;32m%s\033[0m\n' ' /____/ ' printf '\033[0;32m%s\033[0m\n' ' /____/ '
printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.'
printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest news and updates, follow us on twitter: ' 'http://twitter.com/ohmyzsh' printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest news and updates, follow us on twitter: ' 'https://twitter.com/ohmyzsh'
printf '\033[0;34m%s\033[1m%s\033[0m\n' 'Get your Oh My Zsh swag at: ' 'http://shop.planetargon.com/' printf '\033[0;34m%s\033[1m%s\033[0m\n' 'Get your Oh My Zsh swag at: ' 'http://shop.planetargon.com/'
else else
printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment