diff --git a/lib/aliases.zsh b/lib/aliases.zsh index b47de5bde..295624bd5 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -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' diff --git a/lib/rvm.zsh b/lib/rvm.zsh index 597be1b33..5c354cd88 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -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 diff --git a/plugins/gem/_gem b/plugins/gem/_gem index 83cba40d1..8ba88d440 100644 --- a/plugins/gem/_gem +++ b/plugins/gem/_gem @@ -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 diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 81eed5e92..a4389b8b4 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -55,3 +55,7 @@ end do_submenu do_submenu("iTerm", "Shell", "New Tab") EOF } + +function lock() { + open -a ScreenSaverEngine +} diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh new file mode 100644 index 000000000..161ff1559 --- /dev/null +++ b/plugins/rvm/rvm.plugin.zsh @@ -0,0 +1 @@ +alias rvms='rvm gemset' diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 576d45eaa..b4df284cb 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -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... diff --git a/themes/tinogomes.zsh-theme b/themes/tinogomes.zsh-theme new file mode 100644 index 000000000..9a7c42e80 --- /dev/null +++ b/themes/tinogomes.zsh-theme @@ -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) '