From bdb042f483e4ef283c6bbce56a1a6fd7549928fe Mon Sep 17 00:00:00 2001 From: Kristjan Rang Date: Wed, 20 Mar 2013 18:37:36 +0200 Subject: [PATCH] Switch back back to prezto --- .aliases | 4 +++ .gemrc | 13 ++++---- .zpreztorc | 3 +- .zshrc | 80 +++++++++++++++++++++++++++++--------------------- .zshrc.ohmyzsh | 58 ++++++++++++++++++++++++++++++++++++ bootstrap.sh | 40 ++++++++++++------------- 6 files changed, 136 insertions(+), 62 deletions(-) mode change 100755 => 100644 .zshrc create mode 100755 .zshrc.ohmyzsh diff --git a/.aliases b/.aliases index b829958ae8a..33d346a2fee 100755 --- a/.aliases +++ b/.aliases @@ -1,3 +1,7 @@ +unalias rm + +alias rm="nocorrect rm" + # Shortcuts alias c="cd ~/Code" alias g="git" diff --git a/.gemrc b/.gemrc index 6ae2a477b74..bc7ec94c940 100755 --- a/.gemrc +++ b/.gemrc @@ -1,6 +1,7 @@ ---- -:benchmark: false -:update_sources: true -:backtrace: false -:bulk_threshold: 1000 -:verbose: true \ No newline at end of file +benchmark: false +update_sources: true +backtrace: false +bulk_threshold: 1000 +verbose: true +install: --no-rdoc --no-ri +update: --no-rdoc --no-ri diff --git a/.zpreztorc b/.zpreztorc index 8ffcf1ad7ad..36d5c7d8031 100644 --- a/.zpreztorc +++ b/.zpreztorc @@ -21,5 +21,4 @@ zstyle ':prezto:load' pmodule \ 'history-substring-search' \ 'prompt' -zstyle ':prezto:module:prompt' theme 'peepcode' - +zstyle ':prezto:module:prompt' theme 'steeef' diff --git a/.zshrc b/.zshrc old mode 100755 new mode 100644 index 0678ffd6708..230e4ad0e76 --- a/.zshrc +++ b/.zshrc @@ -1,39 +1,16 @@ -# Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh +# +# Executes commands at the start of an interactive session. +# +# Authors: +# Sorin Ionescu +# -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. -ZSH_THEME="norm" - -# Set to this to use case-sensitive completion -# CASE_SENSITIVE="true" - -# Comment this out to disable bi-weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" - -# Uncomment to change how many often would you like to wait before auto-updates occur? (in days) -# export UPDATE_ZSH_DAYS=13 - -# Uncomment following line if you want to disable colors in ls -# DISABLE_LS_COLORS="true" - -# Uncomment following line if you want to disable autosetting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment following line if you want red dots to be displayed while waiting for completion -COMPLETION_WAITING_DOTS="true" - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(autojump brew bundler encode64 extract git github heroku knife nyan osx pow powder rbenv rake screen vagrant history-substring-search) - -source $ZSH/oh-my-zsh.sh - -unsetopt correct_all +# Source Prezto. +if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" +fi +# Determine platform platform='unknown' unamestr=`uname` if [[ "$unamestr" == 'Linux' ]]; then @@ -56,3 +33,38 @@ elif [[ $platform == 'darwin' ]]; then source ~/.aliases.darwin source ~/.exports.darwin fi + +# Set up bundler integration +bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus knife) + +_bundler-installed() { + which bundle > /dev/null 2>&1 +} + +_within-bundled-project() { + local check_dir=$PWD + while [ $check_dir != "/" ]; do + [ -f "$check_dir/Gemfile" ] && return + check_dir="$(dirname $check_dir)" + done + false +} + +_run-with-bundler() { + if _bundler-installed && _within-bundled-project; then + bundle exec $@ + else + $@ + fi +} + +## Main program +for cmd in $bundled_commands; do + eval "function unbundled_$cmd () { $cmd \$@ }" + eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}" + alias $cmd=bundled_$cmd + + if which _$cmd > /dev/null 2>&1; then + compdef _$cmd bundled_$cmd=$cmd + fi +done diff --git a/.zshrc.ohmyzsh b/.zshrc.ohmyzsh new file mode 100755 index 00000000000..0678ffd6708 --- /dev/null +++ b/.zshrc.ohmyzsh @@ -0,0 +1,58 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="norm" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable bi-weekly auto-update checks +# DISABLE_AUTO_UPDATE="true" + +# Uncomment to change how many often would you like to wait before auto-updates occur? (in days) +# export UPDATE_ZSH_DAYS=13 + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# Uncomment following line if you want to disable autosetting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment following line if you want red dots to be displayed while waiting for completion +COMPLETION_WAITING_DOTS="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(autojump brew bundler encode64 extract git github heroku knife nyan osx pow powder rbenv rake screen vagrant history-substring-search) + +source $ZSH/oh-my-zsh.sh + +unsetopt correct_all + +platform='unknown' +unamestr=`uname` +if [[ "$unamestr" == 'Linux' ]]; then + platform='linux' +elif [[ "$unamestr" == 'Darwin' ]]; then + platform='darwin' +fi + +export PATH=/usr/local/sbin:/usr/local/bin:$PATH + +# Load general files +source ~/.aliases +source ~/.exports +source ~/.functions + +# Load platform specific files +if [[ $platform == 'linux' ]]; then + source ~/.aliases.linux +elif [[ $platform == 'darwin' ]]; then + source ~/.aliases.darwin + source ~/.exports.darwin +fi diff --git a/bootstrap.sh b/bootstrap.sh index 8e4531c3983..b62f5b276bf 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -50,31 +50,31 @@ function install { } function externals { - # if [ ! -d "${ZDOTDIR:-$HOME}/.zprezto" ]; then - # notice "Installing zprezto" - # git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" - - # setopt EXTENDED_GLOB - # for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - # ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" - # done - # else - # notice "Updating zprezto" - # cd "${ZDOTDIR:-$HOME}/.zprezto" - # git pull - # cd ~ - # fi - - if [ ! -d "${ZDOTDIR:-$HOME}/.oh-my-zsh" ]; then - notice "Installing oh-my-zsh" - git clone --recursive git://github.com/robbyrussell/oh-my-zsh.git "${ZDOTDIR:-$HOME}/.oh-my-zsh" + if [ ! -d "${ZDOTDIR:-$HOME}/.zprezto" ]; then + notice "Installing zprezto" + git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" + + setopt EXTENDED_GLOB + for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do + ln -nsf "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" + done else - notice "Updating oh-my-zsh" - cd "${ZDOTDIR:-$HOME}/.oh-my-zsh" + notice "Updating zprezto" + cd "${ZDOTDIR:-$HOME}/.zprezto" git pull cd ~ fi + # if [ ! -d "${ZDOTDIR:-$HOME}/.oh-my-zsh" ]; then + # notice "Installing oh-my-zsh" + # git clone --recursive git://github.com/robbyrussell/oh-my-zsh.git "${ZDOTDIR:-$HOME}/.oh-my-zsh" + # else + # notice "Updating oh-my-zsh" + # cd "${ZDOTDIR:-$HOME}/.oh-my-zsh" + # git pull + # cd ~ + # fi + notice "Updating externals" fetch_external ~/.rbenv "git://github.com/sstephenson/rbenv.git" fetch_external ~/.rbenv/plugins/ruby-build "git://github.com/sstephenson/ruby-build.git"