From d2ccf055e417980f79cea1434f4be1e17c5628af Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:19:45 -0300 Subject: [PATCH 1/7] Bugfix: prompt display the current directory as "~rvm_rvmrc_cwd" --- lib/rvm.zsh | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 08f8ab7a23291de0b2fe25f7ea7d19d8f6c13c6f Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:21:14 -0300 Subject: [PATCH 2/7] Reload the .rvmrc on current directory after open new tabs/windows and "Reuse Previuos Tab Directory" --- templates/zshrc.zsh-template | 5 +++++ 1 file changed, 5 insertions(+) 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... From 69b6bd9ffe624712b1df736e5fc854565e5979d4 Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:24:34 -0300 Subject: [PATCH 3/7] New plugin: rvm --- plugins/rvm/rvm.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 24621fe0b..868f12278 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -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' From d40ddb5757dda68268eac0518dca4dc32a453830 Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:24:50 -0300 Subject: [PATCH 4/7] Added support for gem-open on gem plugin --- plugins/gem/_gem | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From aea94507c58da196914d573bcf62b6a37941e878 Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:25:09 -0300 Subject: [PATCH 5/7] Lock function on osx plugin --- plugins/osx/osx.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index a65ca642a..baa03d563 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -61,3 +61,7 @@ end do_submenu do_submenu("iTerm", "Shell", "New Tab") EOF } + +function lock() { + open -a ScreenSaverEngine +} From ef4417c05799120d1d692999314125b84eca3325 Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:26:32 -0300 Subject: [PATCH 6/7] Some new aliases, for reload .zshrc and `netstat` --- lib/aliases.zsh | 6 ++++++ 1 file changed, 6 insertions(+) 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' From 882a0b625b4ad373f05e3d9c525a867147a6d4cc Mon Sep 17 00:00:00 2001 From: tinogomes Date: Thu, 12 May 2011 08:26:51 -0300 Subject: [PATCH 7/7] New template: tinogomes --- themes/tinogomes.zsh-theme | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 themes/tinogomes.zsh-theme 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) '