This commit is contained in:
GitHub Merge Button 2011-06-01 14:35:45 -07:00
commit 40baf645e1
7 changed files with 51 additions and 0 deletions

View file

@ -23,3 +23,9 @@ alias sl=ls # often screw this up
alias afind='ack-grep -il'
alias x=extract
alias reload="source ~/.zshrc"
alias netr='netstat -rn '
alias nets='netstat -an -f inet '
alias netl='netstat -an -f inet | grep LISTEN'

View file

@ -4,4 +4,10 @@ function rvm_prompt_info() {
echo "($ruby_version)"
}
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
# Bugfix: prompt displays the current directory as "~rvm_rvmrc_cwd"
# http://beginrescueend.com/integration/zsh/
unsetopt auto_name_dirs
source $HOME/.rvm/scripts/rvm
fi

View file

@ -7,6 +7,10 @@ _gem_installed() {
installed_gems=(`gem list --local --no-versions`)
}
_gem_installed_for_open() {
installed_gems=(`ruby -rubygems -e 'puts Dir["{#{Gem::SourceIndex.installed_spec_directories.join(",")}}/*.gemspec"].collect {|s| File.basename(s).gsub(/\.gemspec$/, "")}'`)
}
local -a _1st_arguments
_1st_arguments=(
'cert:Manage RubyGems certificates and signing settings'
@ -22,6 +26,7 @@ _1st_arguments=(
'list:Display gems whose name starts with STRING'
'lock:Generate a lockdown list of gems'
'mirror:Mirror a gem repository'
'open:Open a gem into your favorite editor (install gem-open before: "[sudo] gem install gem-open")'
'outdated:Display all gems that need updates'
'owner:Manage gem owners on RubyGems.org.'
'pristine:Restores installed gems to pristine condition from files located in the gem cache'
@ -61,4 +66,7 @@ case "$words[1]" in
uninstall|update)
_gem_installed
_wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
open)
_gem_installed_for_open
_wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
esac

View file

@ -61,3 +61,7 @@ end do_submenu
do_submenu("iTerm", "Shell", "New Tab")
EOF
}
function lock() {
open -a ScreenSaverEngine
}

View file

@ -1,5 +1,6 @@
alias rubies='rvm list rubies'
alias gemsets='rvm gemset list'
alias rvms='rvm gemset'
local ruby18='ruby-1.8.7-p334'
local ruby19='ruby-1.9.2-p180'

View file

@ -25,4 +25,9 @@ plugins=(git)
source $ZSH/oh-my-zsh.sh
# After open new tabs / windows and "Reuse Previous Tab's Directory"
# reload the .rvmrc file on current directory
# http://beginrescueend.com/integration/zsh/
[[ -s $HOME/.rvm/scripts/rvm ]] && __rvm_project_rvmrc
# Customize to your needs...

View file

@ -0,0 +1,21 @@
# tinogomes theme: based over dst
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[green]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
function prompt_char {
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
}
#RVM settings
local RVM_PROMPT=''
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RVM_PROMPT='%{$fg[cyan]%}$(rvm_prompt_info)%{$reset_color%}'
fi
PROMPT='
%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[cyan]%}%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%} '$RVM_PROMPT' $(git_prompt_info)
%_$(prompt_char) '