Skip to content
Browse files

rbenv

put this into $path

$HOME/.rbenv/bin
$HOME/.rbenv/shims
  • Loading branch information...
1 parent 27314c9 commit 665a63736877b1de9e68c633ecfc245a595400ae @thomasritz committed Sep 19, 2011
Showing with 6 additions and 112 deletions.
  1. +0 −85 dot/zsh.d/Completion/_rvm
  2. +2 −16 dot/zsh.d/S20_environment.zsh
  3. +1 −0 dot/zsh.d/S50_aliases.zsh
  4. +3 −8 dot/zsh.d/S60_prompt.zsh
  5. +0 −3 dot/zshrc
View
85 dot/zsh.d/Completion/_rvm
@@ -1,85 +0,0 @@
-#compdef rvm
-
-local curcontext="$curcontext" state line cmds ret=1
-
-_arguments -C \
- '(- 1 *)'{-v,--version}'[display version information]' \
- '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
- '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
- '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
- '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
- '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
- '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
- '-e[Execute code from the command line]:code' \
- '(-G)-G[root gem path to use]:path:_files' \
- '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
- '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
- '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
- '(-C|--configure)'{-C,--configure}'=[custom configure options]' \
- '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
- '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
- '(--head)--head[with update, updates rvm to git head version]' \
- '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
- '(--default)--default[with ruby select, sets a default ruby for new shells]' \
- '(--debug)--debug[Toggle debug mode on for very verbose output]' \
- '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
- '(--force)--force[Force install, removes old install & source before install]' \
- '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
- '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
- '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
- '(--docs)--docs[with install, attempt to generate ri after installation]' \
- '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
- '1: :->cmds' \
- '*: :->args' && ret=0
-
-case $state in
- cmds)
- cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^Action/,/^Implementation/!d; / - /!d; s/^[ *]*\([^ ]*\) *\- *\(.*\)/\1:\2/')"} )
- cmds+=( $(rvm list strings) )
- _describe -t commands 'rvm command' cmds && ret=0
- ;;
- args)
- case $line[1] in
- (use|uninstall|remove|list)
- if (( CURRENT == 3 )); then
- # See if we’ve made it to the ‘@’; eg, 1.9.2@
- if ! \grep -q '@' <<< "${line[CURRENT-1]}" ; then
- _values -S , 'rubies' \
- $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
- default system $(rvm alias list | cut -d' ' -f1) && ret=0
- else
- # Construct a full version string for each of the gemsets.
- # Eg, 1.9.2@min 1.9.2@rail3 …
- _values -S , 'gemsets' \
- $(rvm ${line[CURRENT-1]%%@*} gemset list | awk '/^[-_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}')
- fi
- fi
- ;;
- (install|fetch)
- _values -S , 'rubies' $(rvm list known_strings) && ret=0
- ;;
- gemset)
- if (( CURRENT == 3 )); then
- _values 'gemset_commands' $(rvm gemset | sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g')
- else
- #_values -S , 'gemsets' $(rvm gemset list | \grep -v gemset 2>/dev/null)
- _values -S , 'gemsets' $(rvm gemset list | \grep -Ev '(gemset|info)' 2>/dev/null)
- fi
- ret=0
- ;;
- package)
- if (( CURRENT == 3 )); then
- _values 'package_commands' $(rvm package | sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g')
- else
- _values 'packages' $(rvm package | sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g')
- fi
- ret=0
- ;;
- *)
- (( ret )) && _message 'no more arguments'
- ;;
- esac
- ;;
-esac
-
-return ret
View
18 dot/zsh.d/S20_environment.zsh
@@ -1,32 +1,18 @@
#! /bin/zsh
if [ x"$HOME" = x ] ; then
- export HOME=$(cd ~ ; pwd)
+ export HOME=$(cd ~ ; pwd)
fi
if [ x"$HOSTNAME" = x ] ; then
- export HOSTNAME=$(hostname)
+ export HOSTNAME=$(hostname)
fi
export GREP_OPTIONS="--color"
export EDITOR=vim
export VISUAL=vim
export LESS="-R -M --shift 5"
-if [ $UID -eq 0 ]; then
- PATH=~root/bin:$PATH
-else
- path=(
- $HOME/bin
- $HOME/.gem/ruby/1.8/bin
- /usr/local/bin
- /usr/local/sbin
- "$path[@]"
- )
- typeset -U path
-fi
-export PATH
-
# this makes man pages look nicer...
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
View
1 dot/zsh.d/S50_aliases.zsh
@@ -32,6 +32,7 @@ alias j=jobs
alias git='nocorrect git'
alias gst='nocorrect git st'
alias gs='nocorrect git show'
+alias b='nocorrect bundle exec'
wt() {
while true ; do ( $@ ) ; sleep 1 ; clear ; done
View
11 dot/zsh.d/S60_prompt.zsh
@@ -12,13 +12,8 @@ function git_prompt_info() {
echo
}
-function rvm_prompt() {
- local rvm_info
- rvm_info=$(~/.rvm/bin/rvm-prompt 2> /dev/null)
- if [ -z "$rvm_info" ]; then
- rvm_info="system ruby"
- fi
- echo " ‹%{$fg[green]%}${rvm_info}%{$reset_color%}›"
+function ruby_prompt() {
+ echo " ‹%{$fg[green]%}ruby $(rbenv version-name 2>/dev/null)%{$reset_color%}›"
}
prompt_precmd() {
@@ -36,7 +31,7 @@ prompt_precmd() {
PROMPT=
PROMPT+="%{$fg[cyan]%}%(2~.%~.%/)%{$reset_color%}"
PROMPT+="\$(git_prompt_info)"
-PROMPT+="\$(rvm_prompt)"
+PROMPT+="\$(ruby_prompt)"
PROMPT+="
"
PROMPT+="%{$fg[yellow]%}%(!.#.∴)%{$reset_color%} "
View
3 dot/zshrc
@@ -16,6 +16,3 @@ setopt extended_glob
for zshrc_snipplet in ~/.zsh.d/S[0-9][0-9]*.zsh ; do
source $zshrc_snipplet
done
-
-[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
-fpath=(~/.zsh.d/Completion $fpath)

0 comments on commit 665a637

Please sign in to comment.
Something went wrong with that request. Please try again.