From f294eeb57175f5ef86f903d41c84ecacd96fe00c Mon Sep 17 00:00:00 2001 From: Roman Kamyk Date: Sat, 2 Oct 2010 19:49:16 +0200 Subject: [PATCH 001/220] added rkj theme - xion-chiamiov-plus + hg from thomasjbradley --- themes/rkj.zsh-theme | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 themes/rkj.zsh-theme diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme new file mode 100644 index 000000000..fa950b255 --- /dev/null +++ b/themes/rkj.zsh-theme @@ -0,0 +1,15 @@ +# user, host, full path, and time/date +# on two lines for easier vgrepping +# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 + +function hg_prompt_info { + hg prompt --angle-brackets "\ +%{$reset_color%}>\ +%{$reset_color%}>\ +%{$fg[green]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)$(hg_prompt_info)>%{\e[0m%}%b ' +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' From 57e0b57434eb7f3b7d0fe0ca4849478477404e43 Mon Sep 17 00:00:00 2001 From: Roman Kamyk Date: Fri, 19 Nov 2010 20:25:19 +0100 Subject: [PATCH 002/220] changes --- themes/rkj.zsh-theme | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme index fa950b255..af178b2b9 100644 --- a/themes/rkj.zsh-theme +++ b/themes/rkj.zsh-theme @@ -6,10 +6,24 @@ function hg_prompt_info { hg prompt --angle-brackets "\ %{$reset_color%}>\ %{$reset_color%}>\ -%{$fg[green]%}%{$reset_color%}< +%{$fg[red]%}%{$reset_color%}< patches: >" 2>/dev/null } +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" + +function mygit() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)$(hg_prompt_info)>%{\e[0m%}%b ' +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' +RPROMPT='$(mygit)' + From d02a3912cfd52636ad547fe0b1357303b77584a8 Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Wed, 1 Dec 2010 09:56:54 +0100 Subject: [PATCH 003/220] maven plugin --- plugins/mvn/mvn.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/mvn/mvn.plugin.zsh diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh new file mode 100644 index 000000000..abd0da185 --- /dev/null +++ b/plugins/mvn/mvn.plugin.zsh @@ -0,0 +1,6 @@ +function listMavenCompletions { + reply=( + cli:execute cli:execute-phase archetype:generate compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`); +} + +compctl -K listMavenCompletions mvn \ No newline at end of file From 792e50c917b7c854fbcadbce10a895ab7fbaa7ec Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Wed, 16 Feb 2011 10:40:51 +0100 Subject: [PATCH 004/220] mvn plugin --- plugins/mvn/mvn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index abd0da185..e8af2f49d 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,6 +1,6 @@ function listMavenCompletions { reply=( - cli:execute cli:execute-phase archetype:generate compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`); + cli:execute cli:execute-phase archetype:generate generate-sources compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`); } compctl -K listMavenCompletions mvn \ No newline at end of file From 48ab2ad6e261fc30caa7fe17bd4d3435100c7f3d Mon Sep 17 00:00:00 2001 From: Roman Kamyk Date: Tue, 22 Feb 2011 09:53:02 +0100 Subject: [PATCH 005/220] no hg & git status (sloooow) --- themes/rkj.zsh-theme | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme index af178b2b9..4b49a2a09 100644 --- a/themes/rkj.zsh-theme +++ b/themes/rkj.zsh-theme @@ -23,7 +23,9 @@ function mygit() { } PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' +#PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +#%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' -RPROMPT='$(mygit)' +#RPROMPT='$(mygit)' From 4144f4beea4e56231adeb3574d3516b35c3331cf Mon Sep 17 00:00:00 2001 From: Christopher Chow Date: Wed, 23 Feb 2011 03:05:25 +1100 Subject: [PATCH 006/220] Add tab completion to bundler plugin. --- plugins/bundler/_bundler | 82 ++++++++++++++++++++++++++++++ plugins/bundler/bundler.plugin.zsh | 4 ++ 2 files changed, 86 insertions(+) create mode 100644 plugins/bundler/_bundler diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler new file mode 100644 index 000000000..5d22cac9a --- /dev/null +++ b/plugins/bundler/_bundler @@ -0,0 +1,82 @@ +#compdef bundle + +local curcontext="$curcontext" state line _gems _opts ret=1 + +_arguments -C -A "-v" -A "--version" \ + '(- 1 *)'{-v,--version}'[display version information]' \ + '1: :->cmds' \ + '*:: :->args' && ret=0 + +case $state in + cmds) + _values "bundle command" \ + "install[Install the gems specified by the Gemfile or Gemfile.lock]" \ + "update[Update dependencies to their latest versions]" \ + "package[Package the .gem files required by your application]" \ + "exec[Execute a script in the context of the current bundle]" \ + "config[Specify and read configuration options for bundler]" \ + "check[Determine whether the requirements for your application are installed]" \ + "list[Show all of the gems in the current bundle]" \ + "show[Show the source location of a particular gem in the bundle]" \ + "console[Start an IRB session in the context of the current bundle]" \ + "open[Open an installed gem in the editor]" \ + "viz[Generate a visual representation of your dependencies]" \ + "init[Generate a simple Gemfile, placed in the current directory]" \ + "gem[Create a simple gem, suitable for development with bundler]" \ + "help[Describe available tasks or one specific task]" + ret=0 + ;; + args) + case $line[1] in + help) + _values 'commands' \ + 'install' \ + 'update' \ + 'package' \ + 'exec' \ + 'config' \ + 'check' \ + 'list' \ + 'show' \ + 'console' \ + 'open' \ + 'viz' \ + 'init' \ + 'gem' \ + 'help' && ret=0 + ;; + install) + _arguments \ + '(--no-color)--no-color[disable colorization in output]' \ + '(--local)--local[do not attempt to connect to rubygems.org]' \ + '(--quiet)--quiet[only output warnings and errors]' \ + '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ + '(--system)--system[install to the system location]' \ + '(--deployment)--deployment[install using defaults tuned for deployment environments]' \ + '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ + '(--path)--path=-[specify a different path than the system default]:path:_files' \ + '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ + '(--without)--without=-[exclude gems that are part of the specified named group]:groups' + ret=0 + ;; + exec) + _normal && ret=0 + ;; + (open|show) + _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) + if [[ $_gems != "" ]]; then + _values 'gems' $_gems && ret=0 + fi + ;; + *) + _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) + _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) + if [[ $_opts != "" ]]; then + _values 'options' $_opts && ret=0 + fi + ;; + esac + ;; +esac + +return ret diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index fb40e2cec..caa2f6771 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,3 +1,7 @@ +fpath=($ZSH/plugins/bundler $fpath) +autoload -U compinit +compinit -i + alias be="bundle exec" alias bi="bundle install" alias bu="bundle update" From fadd5f74ce205ddb14735354170150745ae42ca6 Mon Sep 17 00:00:00 2001 From: Stephen Eley Date: Tue, 22 Feb 2011 14:03:48 -0500 Subject: [PATCH 007/220] Crunch theme (by Stephen Eley) --- themes/crunch.zsh-theme | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 themes/crunch.zsh-theme diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme new file mode 100644 index 000000000..7dd5816ee --- /dev/null +++ b/themes/crunch.zsh-theme @@ -0,0 +1,37 @@ +# CRUNCH - created from Steve Eley's cat waxing. +# Initially hacked from the Dallas theme. Thanks, Dallas Reedy. +# +# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, +# and eschews the standard space-consuming user and hostname info. Instead, only the +# things that vary in my own workflow are shown: +# +# * The time (not the date) +# * The RVM version (omitting the interpreter name if it's just 'ruby') +# * The current directory +# * The Git branch and its 'dirty' state +# +# Colors are at the top so you can mess with those separately if you like. +# For the most part I stuck with Dallas's. + +CRUNCH_BRACKET_COLOR="%{$fg[white]%}" +CRUNCH_TIME_COLOR="%{$fg[yellow]%}" +CRUNCH_RVM_COLOR="%{$fg[magenta]%}" +CRUNCH_DIR_COLOR="%{$fg[cyan]%}" +CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" +CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" +CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" + +# These Git variables are used by the oh-my-zsh git_prompt_info helper: +ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓" +ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" + +# Our elements: +CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" +CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\$(~/.rvm/bin/rvm-prompt v g)$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" +CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " +CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " + +# Put it all together! +PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" From d926a55872b5a12ab8b987e9d86c02358d0c825e Mon Sep 17 00:00:00 2001 From: Stephen Eley Date: Tue, 22 Feb 2011 14:38:37 -0500 Subject: [PATCH 008/220] Refined RVM prompt in Crunch theme --- themes/crunch.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme index 7dd5816ee..2473cd230 100644 --- a/themes/crunch.zsh-theme +++ b/themes/crunch.zsh-theme @@ -6,7 +6,7 @@ # things that vary in my own workflow are shown: # # * The time (not the date) -# * The RVM version (omitting the interpreter name if it's just 'ruby') +# * The RVM version and gemset (omitting the 'ruby' name if it's MRI) # * The current directory # * The Git branch and its 'dirty' state # @@ -29,7 +29,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" # Our elements: CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\$(~/.rvm/bin/rvm-prompt v g)$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" +CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " From 0504a01012b88e6eb74040ed599bddf29163fd69 Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Mon, 7 Mar 2011 13:49:30 +0100 Subject: [PATCH 009/220] .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8d19d100c..2cf593269 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ locals.zsh log/.zsh_history projects.zsh custom/* -!custom/example.zsh \ No newline at end of file +!custom/example.zshcache +cache/ From c2e8bed253d25699f826fd7b65d965944b42a21c Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Mon, 7 Mar 2011 14:22:06 +0100 Subject: [PATCH 010/220] Added a plugin for GNU Screen. --- plugins/screen/screen.plugin.zsh | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/screen/screen.plugin.zsh diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh new file mode 100644 index 000000000..ba7ac67e7 --- /dev/null +++ b/plugins/screen/screen.plugin.zsh @@ -0,0 +1,54 @@ +# if using GNU screen, let the zsh tell screen what the title and hardstatus +# of the tab window should be. +if [[ $TERM == "screen" ]]; then + if [[ $_GET_PATH == '' ]]; then + _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^~$USER/~/"' + fi + if [[ $_GET_HOST == '' ]]; then + _GET_HOST='echo $HOST | sed "s/\..*//"' + fi + + # use the current user as the prefix of the current tab title + TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"' + # when at the shell prompt, show a truncated version of the current path (with + # standard ~ replacement) as the rest of the title. + TAB_TITLE_PROMPT='$SHELL:t' + # when running a command, show the title of the command as the rest of the + # title (truncate to drop the path to the command) + TAB_TITLE_EXEC='$cmd[1]:t' + + # use the current path (with standard ~ replacement) in square brackets as the + # prefix of the tab window hardstatus. + TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "' + # when at the shell prompt, use the shell name (truncated to remove the path to + # the shell) as the rest of the title + TAB_HARDSTATUS_PROMPT='$SHELL:t' + # when running a command, show the command name and arguments as the rest of + # the title + TAB_HARDSTATUS_EXEC='$cmd' + + # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be + function screen_set() + { + # set the tab window title (%t) for screen + print -nR $'\033k'$1$'\033'\\\ + + # set hardstatus of tab window (%h) for screen + print -nR $'\033]0;'$2$'\a' + } + # called by zsh before executing a command + function preexec() + { + local -a cmd; cmd=(${(z)1}) # the command string + eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC" + eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC" + screen_set $tab_title $tab_hardstatus + } + # called by zsh before showing the prompt + function precmd() + { + eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT" + eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT" + screen_set $tab_title $tab_hardstatus + } +fi \ No newline at end of file From d807221f607cc7ef02e17a9aa60b1f5f18a886ab Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Mon, 7 Mar 2011 14:36:12 +0100 Subject: [PATCH 011/220] fix to avoid parse errors if $TERM is empty --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index e1e536690..d7c2b9def 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -5,7 +5,7 @@ function title { if [[ "$TERM" == "screen" ]]; then print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars - elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + elif [[ ("$TERM" =~ "^xterm") ]] || [[ ("$TERM" == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2\a" #set window name print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal) fi From f1af41589960f7fc98d270c70a80b351b703e53e Mon Sep 17 00:00:00 2001 From: Fredrik Appelberg Date: Wed, 9 Mar 2011 12:19:01 +0100 Subject: [PATCH 012/220] figuring out home dir on unix systems as well --- plugins/screen/screen.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh index ba7ac67e7..98178e807 100644 --- a/plugins/screen/screen.plugin.zsh +++ b/plugins/screen/screen.plugin.zsh @@ -2,7 +2,7 @@ # of the tab window should be. if [[ $TERM == "screen" ]]; then if [[ $_GET_PATH == '' ]]; then - _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^~$USER/~/"' + _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"' fi if [[ $_GET_HOST == '' ]]; then _GET_HOST='echo $HOST | sed "s/\..*//"' From 911837c48fc6387daa341b3cc5be21b1b1cade57 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 13 Apr 2011 00:30:45 +0200 Subject: [PATCH 013/220] github plugin: check for `ruby`. I've run into the issue where a stripped down container had no Ruby installed, which caused `hub` to fail. Therefore I've added an extra check to verify that `ruby` is in the commands list before setting up this alias/function. --- plugins/github/github.plugin.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 8d4580654..18fff1755 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,6 +1,5 @@ -# hub alias from defunkt -# https://github.com/defunkt/hub -if [ "$commands[(I)hub]" ]; then +# Setup hub function for git, if it is available; http://github.com/defunkt/hub +if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then # eval `hub alias -s zsh` function git(){hub "$@"} fi From 14a1877311bd0a9cf9c4db0e44e55da0fba77c5c Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 16:48:47 +0200 Subject: [PATCH 014/220] New plugin git-svn installing git project git-svn-clone-externals --- plugins/git-svn/.gitignore | 1 + plugins/git-svn/git-svn.plugin.zsh | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 plugins/git-svn/.gitignore create mode 100644 plugins/git-svn/git-svn.plugin.zsh diff --git a/plugins/git-svn/.gitignore b/plugins/git-svn/.gitignore new file mode 100644 index 000000000..bf5e1a14f --- /dev/null +++ b/plugins/git-svn/.gitignore @@ -0,0 +1 @@ +git-svn-clone-externals diff --git a/plugins/git-svn/git-svn.plugin.zsh b/plugins/git-svn/git-svn.plugin.zsh new file mode 100644 index 000000000..062d63e05 --- /dev/null +++ b/plugins/git-svn/git-svn.plugin.zsh @@ -0,0 +1,10 @@ + +if ! [ -d "$ZSH/plugins/git-svn/git-svn-clone-externals" ] ;then + git clone https://github.com/andrep/git-svn-clone-externals.git +fi +export PATH="$ZSH/plugins/git-svn/git-svn-clone-externals:$PATH" + +function git_svn_update { + (cd "$ZSH/plugins/git-svn/git-svn-clone-externals" && \ + git pull origin master) +} From d6c150decca10ba2a3566fe1dc1144f7e37f1c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=B3genes?= Date: Wed, 13 Apr 2011 11:55:24 -0300 Subject: [PATCH 015/220] adding python plugin with some aliases --- plugins/python/python.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/python/python.plugin.zsh diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh new file mode 100644 index 000000000..fde54fa88 --- /dev/null +++ b/plugins/python/python.plugin.zsh @@ -0,0 +1,5 @@ +# Find python file +alias pyfind='find . -name "*.py"' + +# Remove python compiled byte-code +alias pycrm='rm `find . | grep -E "*.(pyc|pyo)$"`' From ca4dabb45e14d8cd38e07c4ffadf9473ceb2193b Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 17:23:25 +0200 Subject: [PATCH 016/220] New tool require_tool.sh --- tools/require_tool.sh | 161 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100755 tools/require_tool.sh diff --git a/tools/require_tool.sh b/tools/require_tool.sh new file mode 100755 index 000000000..42da2ccf9 --- /dev/null +++ b/tools/require_tool.sh @@ -0,0 +1,161 @@ +__require_tool_version_compare () +{ + ( + # Locally ignore failures, otherwise we'll exit whenever $1 and $2 + # are not equal! + set +e + +awk_strverscmp=' + # Use only awk features that work with 7th edition Unix awk (1978). + # My, what an old awk you have, Mr. Solaris! + END { + while (length(v1) || length(v2)) { + # Set d1 to be the next thing to compare from v1, and likewise for d2. + # Normally this is a single character, but if v1 and v2 contain digits, + # compare them as integers and fractions as strverscmp does. + if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { + # Split v1 and v2 into their leading digit string components d1 and d2, + # and advance v1 and v2 past the leading digit strings. + for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue + for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue + d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) + d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) + if (d1 ~ /^0/) { + if (d2 ~ /^0/) { + # Compare two fractions. + while (d1 ~ /^0/ && d2 ~ /^0/) { + d1 = substr(d1, 2); len1-- + d2 = substr(d2, 2); len2-- + } + if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { + # The two components differ in length, and the common prefix + # contains only leading zeros. Consider the longer to be less. + d1 = -len1 + d2 = -len2 + } else { + # Otherwise, compare as strings. + d1 = "x" d1 + d2 = "x" d2 + } + } else { + # A fraction is less than an integer. + exit 1 + } + } else { + if (d2 ~ /^0/) { + # An integer is greater than a fraction. + exit 2 + } else { + # Compare two integers. + d1 += 0 + d2 += 0 + } + } + } else { + # The normal case, without worrying about digits. + if (v1 == "") d1 = v1; else { d1 = substr(v1, 1, 1); v1 = substr(v1,2) } + if (v2 == "") d2 = v2; else { d2 = substr(v2, 1, 1); v2 = substr(v2,2) } + } + if (d1 < d2) exit 1 + if (d1 > d2) exit 2 + } + } +' + awk "$awk_strverscmp" v1="$1" v2="$2" /dev/null + case $? in + 1) echo '<';; + 0) echo '=';; + 2) echo '>';; + esac + ) +} + + +__require_tool_fatal () +{ + echo $@ >/dev/stderr + return 1 +} + +# Usage: require_tool program version +# Returns: 0 if $1 version if greater equals than $2, 1 otherwise. +# In case of error, message is written on error output. +# +# Example: require_tool gcc 4.6 +# Use GCC environment variable if defined instead of lookup for the tool +# in the environment. +require_tool () +{ + envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') + tool=$(printenv $envvar_name || echo $1) + local version=$($tool --version 2>/dev/null| \ + sed -n 's/.*[^0-9.]\([0-9][0-9.]*\).*/\1/p;q') + if test x"$version" = x ; then + echo "$tool is required" >/dev/stderr + return 1 + fi + case $(__require_tool_version_compare "$2" "$version") in + '>') + echo "$1 $2 or better is required: this is $tool $version" >/dev/stderr + return 1 + ;; + esac +} + +usage() { + cat < Date: Wed, 13 Apr 2011 17:24:44 +0200 Subject: [PATCH 017/220] Fix version parsing. Now working with command $ zsh --version --- tools/require_tool.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/require_tool.sh b/tools/require_tool.sh index 42da2ccf9..1fa77f77a 100755 --- a/tools/require_tool.sh +++ b/tools/require_tool.sh @@ -89,7 +89,7 @@ require_tool () envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') tool=$(printenv $envvar_name || echo $1) local version=$($tool --version 2>/dev/null| \ - sed -n 's/.*[^0-9.]\([0-9][0-9.]*\).*/\1/p;q') + sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q') if test x"$version" = x ; then echo "$tool is required" >/dev/stderr return 1 From 2fba4486bfa63cf2a4a11a34c94ce123127ef4c9 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 17:34:51 +0200 Subject: [PATCH 018/220] Add new plugin emacs, to take benefit of daemon capabilities of emacs >=23 --- plugins/emacs/emacs.plugin.zsh | 11 +++++++++++ plugins/emacs/emacsclient.sh | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 plugins/emacs/emacs.plugin.zsh create mode 100755 plugins/emacs/emacsclient.sh diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh new file mode 100644 index 000000000..bca79e70e --- /dev/null +++ b/plugins/emacs/emacs.plugin.zsh @@ -0,0 +1,11 @@ +# Use daemon capabilities of emacs 23 +if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then + export EDITOR="$ZSH/plugins/emacs/emacsclient.sh" + alias emacs="$EDITOR --no-wait" + alias e=emacs + + alias emasc=emacs + alias emcas=emacs + # create a new X frame + alias emacs_frame='emacsclient --alternate-editor "" --create-frame' +fi diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh new file mode 100755 index 000000000..3475926a6 --- /dev/null +++ b/plugins/emacs/emacsclient.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Starts emacs daemon if not already started. + +x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` +if [ -z "$x" ] ;then + emacsclient --alternate-editor "" --create-frame $@ +else + emacsclient --alternate-editor "" $@ +fi From df0b37f9db3f8a1d445bebf30d04039eb247ab71 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 17:45:04 +0200 Subject: [PATCH 019/220] Merge branch 'master'; commit 'ca4dabb45e14d8cd38e07c4ffadf9473ceb2193b' into require_tool From 0c032aaf81afcb134668a462a9ea028e6fc64eeb Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 17:46:36 +0200 Subject: [PATCH 020/220] Removing master stuff --- plugins/emacs/emacs.plugin.zsh | 11 ----------- plugins/emacs/emacsclient.sh | 10 ---------- plugins/git-svn/.gitignore | 1 - plugins/git-svn/git-svn.plugin.zsh | 10 ---------- 4 files changed, 32 deletions(-) delete mode 100644 plugins/emacs/emacs.plugin.zsh delete mode 100755 plugins/emacs/emacsclient.sh delete mode 100644 plugins/git-svn/.gitignore delete mode 100644 plugins/git-svn/git-svn.plugin.zsh diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh deleted file mode 100644 index bca79e70e..000000000 --- a/plugins/emacs/emacs.plugin.zsh +++ /dev/null @@ -1,11 +0,0 @@ -# Use daemon capabilities of emacs 23 -if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then - export EDITOR="$ZSH/plugins/emacs/emacsclient.sh" - alias emacs="$EDITOR --no-wait" - alias e=emacs - - alias emasc=emacs - alias emcas=emacs - # create a new X frame - alias emacs_frame='emacsclient --alternate-editor "" --create-frame' -fi diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh deleted file mode 100755 index 3475926a6..000000000 --- a/plugins/emacs/emacsclient.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Starts emacs daemon if not already started. - -x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` -if [ -z "$x" ] ;then - emacsclient --alternate-editor "" --create-frame $@ -else - emacsclient --alternate-editor "" $@ -fi diff --git a/plugins/git-svn/.gitignore b/plugins/git-svn/.gitignore deleted file mode 100644 index bf5e1a14f..000000000 --- a/plugins/git-svn/.gitignore +++ /dev/null @@ -1 +0,0 @@ -git-svn-clone-externals diff --git a/plugins/git-svn/git-svn.plugin.zsh b/plugins/git-svn/git-svn.plugin.zsh deleted file mode 100644 index 062d63e05..000000000 --- a/plugins/git-svn/git-svn.plugin.zsh +++ /dev/null @@ -1,10 +0,0 @@ - -if ! [ -d "$ZSH/plugins/git-svn/git-svn-clone-externals" ] ;then - git clone https://github.com/andrep/git-svn-clone-externals.git -fi -export PATH="$ZSH/plugins/git-svn/git-svn-clone-externals:$PATH" - -function git_svn_update { - (cd "$ZSH/plugins/git-svn/git-svn-clone-externals" && \ - git pull origin master) -} From b2d5b4365019a466fb8481598de87159704ded7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=B3genes?= Date: Thu, 14 Apr 2011 12:15:26 -0300 Subject: [PATCH 021/220] refactored pycrm command --- plugins/python/python.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index fde54fa88..3ea34d718 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -2,4 +2,4 @@ alias pyfind='find . -name "*.py"' # Remove python compiled byte-code -alias pycrm='rm `find . | grep -E "*.(pyc|pyo)$"`' +alias pyclean='find . -type f -name "*.py[co]" -exec rm -f \{\} \;' From e199e1dae8f43e3de3bfd59696226497a7c3c3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurri=C3=ABn=20Stutterheim?= Date: Sun, 15 May 2011 15:02:46 +0200 Subject: [PATCH 022/220] Add norm theme --- themes/norm.zsh-theme | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 themes/norm.zsh-theme diff --git a/themes/norm.zsh-theme b/themes/norm.zsh-theme new file mode 100644 index 000000000..933fad2ad --- /dev/null +++ b/themes/norm.zsh-theme @@ -0,0 +1,4 @@ +PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}${PWD/#$HOME/~} %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" From 1d9eacb34f59f3bf82a9de0d7b474cb4c501e3fd Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Thu, 19 May 2011 10:55:19 +0100 Subject: [PATCH 023/220] Plugin to make WOL nice & easy --- plugins/wakeonlan/wakeonlan.plugin.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/wakeonlan/wakeonlan.plugin.zsh diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh new file mode 100644 index 000000000..08db1bdea --- /dev/null +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -0,0 +1,15 @@ +function wake() { + local config_file=~/.wakeonlan/$1 + if [[ ! -f $config_file ]]; then + echo "ERROR: There is no configuration file at \"$config_file\"." + return + fi + + which wakeonlan > /dev/null + if [[ ! $? == 0 ]]; then + echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" + return + fi + + wakeonlan -f $config_file +} From 8454542ddc33c4907bb864054b9adb0cf61d9002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurri=C3=ABn=20Stutterheim?= Date: Fri, 20 May 2011 13:21:04 +0200 Subject: [PATCH 024/220] Update, no more full path --- themes/norm.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/norm.zsh-theme b/themes/norm.zsh-theme index 933fad2ad..5f0ad03ee 100644 --- a/themes/norm.zsh-theme +++ b/themes/norm.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}${PWD/#$HOME/~} %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' +PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" From 5aa6b0fae5f1fa82c90003c2020849b4bb87c9e8 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 1 May 2011 11:46:11 -0400 Subject: [PATCH 025/220] Replaced npm 0.x completion with 1.0 completion. --- plugins/npm/_npm | 19 ------------------- plugins/npm/npm.plugin.zsh | 1 + 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 plugins/npm/_npm create mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/npm/_npm b/plugins/npm/_npm deleted file mode 100644 index 24b536188..000000000 --- a/plugins/npm/_npm +++ /dev/null @@ -1,19 +0,0 @@ -#compdef npm - -# Node Package Manager 0.3.15 completion, letting npm do all the completion work - -_npm() { - compadd -- $(_npm_complete $words) -} - -# We want to show all errors of any substance, but never the "npm (not )ok" one. -# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) -_npm_complete() { - local ask_npm - ask_npm=(npm completion --color false --loglevel error -- $@) - { _call_program npm $ask_npm 2>&1 >&3 \ - | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ - } 3>&1 -} - -_npm "$@" diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh new file mode 100644 index 000000000..c3eb91d31 --- /dev/null +++ b/plugins/npm/npm.plugin.zsh @@ -0,0 +1 @@ +eval "$(npm completion 2>/dev/null)" From bf86502b6940d938c488254befdf9461cb50591b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 3 Feb 2011 17:25:45 -0500 Subject: [PATCH 026/220] Added gnu-utils plugin. --- plugins/gnu-utils/gnu-utils.plugin.zsh | 80 ++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 plugins/gnu-utils/gnu-utils.plugin.zsh diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh new file mode 100644 index 000000000..e59265d66 --- /dev/null +++ b/plugins/gnu-utils/gnu-utils.plugin.zsh @@ -0,0 +1,80 @@ +# ------------------------------------------------------------------------------ +# FILE: gnu-utils.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) +# VERSION: 1.0.0 +# ------------------------------------------------------------------------------ + + +if [[ -x "${commands[gwhoami]}" ]]; then + __gnu_utils() { + emulate -L zsh + local gcmds + local gcmd + local cmd + local prefix + + # coreutils + gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod' + 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate' + 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand' + 'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid' + 'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum' + 'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc' + 'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd' + 'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum' + 'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort' + 'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest' + 'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname' + 'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho' + 'gwhoami' 'gyes') + + # Not part of coreutils, installed separately. + gcmds+=('gsed' 'gtar' 'gtime') + + for gcmd in "${gcmds[@]}"; do + # + # This method allows for builtin commands to be primary but it's + # lost if hash -r or rehash -f is executed. Thus, those two + # functions have to be wrapped. + # + (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]} + + # + # This method generates wrapper functions. + # It will override shell builtins. + # + # (( ${+commands[$gcmd]} )) && \ + # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }" + + # + # This method is inflexible since the aliases are at risk of being + # overriden resulting in the BSD coreutils being called. + # + # (( ${+commands[$gcmd]} )) && \ + # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}" + done + + return 0 + } + __gnu_utils; + + function hash() { + if [[ "$*" =~ "-(r|f)" ]]; then + builtin hash "$@" + __gnu_utils + else + builtin hash "$@" + fi + } + + function rehash() { + if [[ "$*" =~ "-f" ]]; then + builtin rehash "$@" + __gnu_utils + else + builtin rehash "$@" + fi + } +fi + From 5444d2088c97dc776dcbd17acf55dd54b9d7060a Mon Sep 17 00:00:00 2001 From: thunfischbrot Date: Sun, 5 Jun 2011 15:19:46 -0700 Subject: [PATCH 027/220] Included some essential aliases, inspired by http://lolcode.com/ --- plugins/lol/lol.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index a7153bb57..e455527e7 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -8,19 +8,30 @@ alias rtfm='man' alias visible='echo' alias invisible='cat' alias moar='more' +alias tldr='less' +alias alwayz='tail -f' alias icanhas='mkdir' +alias gimmeh='touch' alias donotwant='rm' alias dowant='cp' alias gtfo='mv' +alias nowai='chmod' alias hai='cd' +alias iz='ls' alias plz='pwd' +alias ihasbucket='df -h' alias inur='locate' +alias iminurbase='finger' + +alias btw='nice' +alias obtw='nohup' alias nomz='ps -aux' alias nomnom='killall' +alias byes='exit' alias cya='reboot' alias kthxbai='halt' From 55eda0c48b42e3ccd1b12579cd46d20332b828c1 Mon Sep 17 00:00:00 2001 From: ptrv Date: Fri, 10 Jun 2011 15:38:59 +0200 Subject: [PATCH 028/220] Added mercurial plugin with aliases. --- plugins/mercurial/mercurial.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/mercurial/mercurial.plugin.zsh diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh new file mode 100644 index 000000000..2988f0a46 --- /dev/null +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -0,0 +1,14 @@ + +# Mercurial +alias hgc='hg commit -v' +alias hgb='hg branch -v' +alias hgba='hg branches' +alias hgco='hg checkout' +alias hgd='hg diff' +alias hged='hg diffmerge' +# pull and update +alias hgl='hg pull -u -v' +alias hgp='hg push -v' +alias hgs='hg status -v' +# this is the 'git commit --amend' equivalent +alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' From 929c64e4c6f53e926757b7d9d89ab7da4f9a0d0d Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Tue, 21 Jun 2011 12:09:57 +0300 Subject: [PATCH 029/220] Create gnzh theme --- themes/gnzh.zsh-theme | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 themes/gnzh.zsh-theme diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme new file mode 100644 index 000000000..a984d25fa --- /dev/null +++ b/themes/gnzh.zsh-theme @@ -0,0 +1,47 @@ +# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png +# Based on bira theme + +# load some modules +autoload -U colors zsh/terminfo # Used in the colour alias below +colors +setopt prompt_subst + +# make some aliases for the colours: (coud use normal escap.seq's too) +for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do + eval PR_$color='%{$fg[${(L)color}]%}' +done +eval PR_NO_COLOR="%{$terminfo[sgr0]%}" +eval PR_BOLD="%{$terminfo[bold]%}" + +# Check the UID +if [[ $UID -ge 1000 ]]; then # normal user + eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' + eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' + local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' +elif [[ $UID -eq 0 ]]; then # root + eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' + eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' + local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' +fi + +# Check if we are on SSH or not +if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then + eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH +else + eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH +fi + +local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" + +local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' +local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' +local rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' +local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' + +#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " +PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +╰─$PR_PROMPT " +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" From a335e9df9f13a5caa2b83cad9ebcfaa25b748202 Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Tue, 21 Jun 2011 13:50:39 +0300 Subject: [PATCH 030/220] plugin for vundle (vim plugins managment system) that provide vundle, vundle-update and vundle-init aliases --- plugins/vundle/vundle.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/vundle/vundle.plugin.zsh diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh new file mode 100644 index 000000000..7caed4715 --- /dev/null +++ b/plugins/vundle/vundle.plugin.zsh @@ -0,0 +1,3 @@ +alias vundle-init='git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle' +alias vundle='vim -c "execute \"BundleInstall\" | q"' +alias vundle-update='vim -c "execute \"BundleInstall!\" | q"' From 7ef7ffc5ebd21bff4ab8e42989c63ba8204c0e5b Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Tue, 21 Jun 2011 14:53:11 +0300 Subject: [PATCH 031/220] removing useless line --- themes/gnzh.zsh-theme | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index a984d25fa..357798cf6 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -38,7 +38,6 @@ local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' local rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' -#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} ╰─$PR_PROMPT " RPS1="${return_code}" From 499819ced108aa4b0d90dd0ac922a174c965d814 Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Wed, 29 Jun 2011 10:26:42 +0300 Subject: [PATCH 032/220] vundle plugin refactored first it checks existens of vundle plugin, if plugin dont exist run git clone --- plugins/vundle/vundle.plugin.zsh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh index 7caed4715..39c36ac59 100644 --- a/plugins/vundle/vundle.plugin.zsh +++ b/plugins/vundle/vundle.plugin.zsh @@ -1,3 +1,22 @@ -alias vundle-init='git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle' -alias vundle='vim -c "execute \"BundleInstall\" | q"' -alias vundle-update='vim -c "execute \"BundleInstall!\" | q"' +function vundle-init () { + if [ ! -d ~/.vim/bundle/vundle/ ] + then + mkdir -p ~/.vim/bundle/vundle/ + fi + + if [ ! -d ~/.vim/bundle/vundle/.git/ ] + then + git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + fi +} + +function vundle () { + vundle-init + vim -c "execute \"BundleInstall\" | q" +} + + +function vundle-update () { + vundle-init + vim -c "execute \"BundleInstall!\" | q" +} From 053cb24d3160d69cb6c9579a3f154f45a72f065c Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Thu, 30 Jun 2011 11:45:24 +0300 Subject: [PATCH 033/220] added tip about vundle configutarion after git clone --- plugins/vundle/vundle.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh index 39c36ac59..1e2e1f088 100644 --- a/plugins/vundle/vundle.plugin.zsh +++ b/plugins/vundle/vundle.plugin.zsh @@ -7,6 +7,7 @@ function vundle-init () { if [ ! -d ~/.vim/bundle/vundle/.git/ ] then git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" fi } From fea4e54b1053764df10f507c233286281133fe90 Mon Sep 17 00:00:00 2001 From: fox Date: Tue, 19 Jul 2011 21:47:26 +0200 Subject: [PATCH 034/220] added theme chooser --- tools/theme_chooser.sh | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tools/theme_chooser.sh diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh new file mode 100755 index 000000000..2413bfee8 --- /dev/null +++ b/tools/theme_chooser.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Zsh Theme Chooser by fox (fox91 at anche dot no) +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. + +THEMES_DIR="$ZSH/themes" +FAVLIST="~/.zsh_favlist" + +function noyes() { + read -p "$1 [y/N]" a + if [[ $a == "N" || $a == "n" || $a = "" ]]; then + return 0 + fi + return 1 +} + +function theme_preview() { + THEME=$1 + export ZDOTDIR="$(mktemp -d)" + +cat <<-EOF >"$ZDOTDIR/.zshrc" + source ~/.zshrc + source "$THEMES_DIR/$THEME" +EOF + zsh + rm -rf "$ZDOTDIR" + + echo + noyes "Do you want to add it to your favourite list?" && \ + echo $THEME >> $FAVLIST + echo +} + +echo +echo "╺━┓┏━┓╻ ╻ ╺┳╸╻ ╻┏━╸┏┳┓┏━╸ ┏━╸╻ ╻┏━┓┏━┓┏━┓┏━╸┏━┓" +echo "┏━┛┗━┓┣━┫ ┃ ┣━┫┣╸ ┃┃┃┣╸ ┃ ┣━┫┃ ┃┃ ┃┗━┓┣╸ ┣┳┛" +echo "┗━╸┗━┛╹ ╹ ╹ ╹ ╹┗━╸╹ ╹┗━╸ ┗━╸╹ ╹┗━┛┗━┛┗━┛┗━╸╹┗╸" +echo + +for i in $(ls $THEMES_DIR); do + echo "Now showing theme $i" + theme_preview $i +done From 5d5d2f94be7a13c3a5069bed6bfc2070fa7f014c Mon Sep 17 00:00:00 2001 From: fox Date: Tue, 19 Jul 2011 22:02:34 +0200 Subject: [PATCH 035/220] fox's theme + theme chooser fixes --- themes/fox.zsh-theme | 8 ++++++++ tools/theme_chooser.sh | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 themes/fox.zsh-theme diff --git a/themes/fox.zsh-theme b/themes/fox.zsh-theme new file mode 100644 index 000000000..1959853cf --- /dev/null +++ b/themes/fox.zsh-theme @@ -0,0 +1,8 @@ +#fox theme +PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) +└> % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="-[%{$reset_color%}%{$fg[white]%}git://%{$fg_bold[white]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[cyan]%}]-" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 2413bfee8..50f80f092 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -8,10 +8,10 @@ # http://sam.zoy.org/wtfpl/COPYING for more details. THEMES_DIR="$ZSH/themes" -FAVLIST="~/.zsh_favlist" +FAVLIST="${HOME}/.zsh_favlist" function noyes() { - read -p "$1 [y/N]" a + read -p "$1 [y/N] " a if [[ $a == "N" || $a == "n" || $a = "" ]]; then return 0 fi @@ -30,7 +30,7 @@ EOF rm -rf "$ZDOTDIR" echo - noyes "Do you want to add it to your favourite list?" && \ + noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ echo $THEME >> $FAVLIST echo } From 428f18cf428fd86bd6e99c4363e5f25d0e392506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Sat, 23 Jul 2011 23:09:03 +0200 Subject: [PATCH 036/220] Add key bindings for gnome-terminal on Fedora --- lib/key-bindings.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 9c2dda35a..5c1b90bfa 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -14,10 +14,15 @@ bindkey '^[[B' down-line-or-search bindkey "^[[H" beginning-of-line bindkey "^[[1~" beginning-of-line +bindkey "^[OH" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[4~" end-of-line +bindkey "^[OF" end-of-line bindkey ' ' magic-space # also do history expansion on space +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word + bindkey '^[[Z' reverse-menu-complete # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ From 76dd2d8b05cb1b8d34653732e8b3939f68e8a67a Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 24 Jul 2011 11:58:41 +0200 Subject: [PATCH 037/220] mac os fix --- tools/theme_chooser.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 50f80f092..af861a15b 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -20,7 +20,7 @@ function noyes() { function theme_preview() { THEME=$1 - export ZDOTDIR="$(mktemp -d)" + export ZDOTDIR="$(mktemp -d tmp.zshXXXX)" cat <<-EOF >"$ZDOTDIR/.zshrc" source ~/.zshrc From d15d3a5b01a527d8642cc0b173a2f8d1b92332c0 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 24 Jul 2011 20:51:27 +0200 Subject: [PATCH 038/220] global zsh config --- tools/theme_chooser.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index af861a15b..ea5191afe 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -20,18 +20,19 @@ function noyes() { function theme_preview() { THEME=$1 + THEME_NAME=`echo $THEME | sed s/\.zsh-theme//` export ZDOTDIR="$(mktemp -d tmp.zshXXXX)" cat <<-EOF >"$ZDOTDIR/.zshrc" - source ~/.zshrc - source "$THEMES_DIR/$THEME" + ZSH_THEME="$THEME_NAME" + source $ZSH/oh-my-zsh.sh EOF zsh rm -rf "$ZDOTDIR" echo noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - echo $THEME >> $FAVLIST + echo $THEME_NAME >> $FAVLIST echo } From 0848acfb25b6601adcabc406089b6c7788df5749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Sat, 23 Jul 2011 23:34:02 +0200 Subject: [PATCH 039/220] Display red dots during completion process (disabled by default) --- lib/completion.zsh | 9 +++++++++ templates/zshrc.zsh-template | 3 +++ 2 files changed, 12 insertions(+) diff --git a/lib/completion.zsh b/lib/completion.zsh index fdd0a8536..b3cc91822 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show +if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then + expand-or-complete-with-dots() { + echo -n "\e[31m......\e[0m" + zle expand-or-complete + zle redisplay + } + zle -N expand-or-complete-with-dots + bindkey "^I" expand-or-complete-with-dots +fi diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 77f866d52..1ab40aba6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell" # 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/*) # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) From fc49b4a4ded376cd82b813dcb6d72fdc050b7bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Thu, 28 Jul 2011 19:52:35 +0200 Subject: [PATCH 040/220] Enable red dots during completion by default --- lib/completion.zsh | 2 +- templates/zshrc.zsh-template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc91822..2a457402a 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,7 +59,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then +if [ "$DISABLE_COMPLETION_WAITING_DOTS" != "true" ]; then expand-or-complete-with-dots() { echo -n "\e[31m......\e[0m" zle expand-or-complete diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..4de1fa4e9 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,8 +19,8 @@ ZSH_THEME="robbyrussell" # 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" +# Uncomment following line if you want disable red dots displayed while waiting for completion +# DISABLE_COMPLETION_WAITING_DOTS="true" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) From f35bfd9c4b2a3924975b936d2ca946dbca48c51f Mon Sep 17 00:00:00 2001 From: Max Masnick Date: Fri, 29 Jul 2011 15:17:22 -0400 Subject: [PATCH 041/220] Add fino.zsh-theme Add my brand new oh-my-zsh theme called Fino. It borrows from some other themes (see comments at the beginning). I only have/can tested on OS X 10.7, so there might be some compatibility problems with other platforms. --- themes/fino.zsh-theme | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 themes/fino.zsh-theme diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme new file mode 100644 index 000000000..17cf59708 --- /dev/null +++ b/themes/fino.zsh-theme @@ -0,0 +1,39 @@ +# Fino theme by Max Masnick (http://max.masnick.me) + +# Use with a dark background and 256-color terminal! +# Meant for people with RVM and git. Tested only on OS X 10.7. + +# You can set your computer name in the ~/.box-name file if you want. + +# Borrowing shamelessly from these oh-my-zsh themes: +# bira +# robbyrussell +# +# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + echo '○' +} + +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + + +local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' +local current_dir='${PWD/#$HOME/~}' +local git_info='$(git_prompt_info)' + + +PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} +╰─$(virtualenv_info)$(prompt_char) " + +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" \ No newline at end of file From b160ee6512f58a3a7f2c18f12feab3e32884003b Mon Sep 17 00:00:00 2001 From: Ilya Chesnokov Date: Mon, 1 Aug 2011 10:58:05 +0400 Subject: [PATCH 042/220] 'echo' did not show colors without -e in upgrade.sh --- tools/upgrade.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 2b75e5541..52a8cc4da 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,12 @@ current_path=`pwd` -echo "\033[0;34mUpgrading Oh My Zsh\033[0m" +echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" ( cd $ZSH && git pull origin master ) -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" -echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" +echo -e "\033[0;32m"' __ __ '"\033[0m" +echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" +echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" +echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" +echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" +echo -e "\033[0;32m"' /____/ '"\033[0m" +echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" +echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" cd "$current_path" From 68b5ef2aabddc1049738a80f6cbfa470fd538e95 Mon Sep 17 00:00:00 2001 From: Rahul Trikha Date: Tue, 2 Aug 2011 11:24:09 +0930 Subject: [PATCH 043/220] Added auto complete plugin for powder gem https://github.com/Rodreegez/powder --- plugins/powder/_powder | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/powder/_powder diff --git a/plugins/powder/_powder b/plugins/powder/_powder new file mode 100644 index 000000000..84e260a15 --- /dev/null +++ b/plugins/powder/_powder @@ -0,0 +1,4 @@ +#compdef powder +#autoload + +compadd `powder help | grep powder | cut -d " " -f 4` From cbf662744ffcf998829cabbd7b2550861c13d1d8 Mon Sep 17 00:00:00 2001 From: fox Date: Wed, 3 Aug 2011 09:42:16 +0200 Subject: [PATCH 044/220] fixed theme chooser + options + list available themes + show all themes --- tools/theme_chooser.sh | 90 ++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 21 deletions(-) diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index ea5191afe..4d7047444 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh # Zsh Theme Chooser by fox (fox91 at anche dot no) # This program is free software. It comes without any warranty, to @@ -9,9 +9,10 @@ THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" +source $ZSH/oh-my-zsh.sh function noyes() { - read -p "$1 [y/N] " a + read "a?$1 [y/N] " if [[ $a == "N" || $a == "n" || $a = "" ]]; then return 0 fi @@ -20,29 +21,76 @@ function noyes() { function theme_preview() { THEME=$1 - THEME_NAME=`echo $THEME | sed s/\.zsh-theme//` - export ZDOTDIR="$(mktemp -d tmp.zshXXXX)" - -cat <<-EOF >"$ZDOTDIR/.zshrc" - ZSH_THEME="$THEME_NAME" - source $ZSH/oh-my-zsh.sh -EOF - zsh - rm -rf "$ZDOTDIR" + THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` + print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color" + source "$THEMES_DIR/$THEME" + print -P $PROMPT +} +function banner() { echo - noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - echo $THEME_NAME >> $FAVLIST + echo "╺━┓┏━┓╻ ╻ ╺┳╸╻ ╻┏━╸┏┳┓┏━╸ ┏━╸╻ ╻┏━┓┏━┓┏━┓┏━╸┏━┓" + echo "┏━┛┗━┓┣━┫ ┃ ┣━┫┣╸ ┃┃┃┣╸ ┃ ┣━┫┃ ┃┃ ┃┗━┓┣╸ ┣┳┛" + echo "┗━╸┗━┛╹ ╹ ╹ ╹ ╹┗━╸╹ ╹┗━╸ ┗━╸╹ ╹┗━┛┗━┛┗━┛┗━╸╹┗╸" echo } -echo -echo "╺━┓┏━┓╻ ╻ ╺┳╸╻ ╻┏━╸┏┳┓┏━╸ ┏━╸╻ ╻┏━┓┏━┓┏━┓┏━╸┏━┓" -echo "┏━┛┗━┓┣━┫ ┃ ┣━┫┣╸ ┃┃┃┣╸ ┃ ┣━┫┃ ┃┃ ┃┗━┓┣╸ ┣┳┛" -echo "┗━╸┗━┛╹ ╹ ╹ ╹ ╹┗━╸╹ ╹┗━╸ ┗━╸╹ ╹┗━┛┗━┛┗━┛┗━╸╹┗╸" -echo +function usage() { + echo "Usage: $0 [options] [theme]" + echo + echo "Options" + echo " -l List available themes" + echo " -s Show all themes" + echo " -h Get this help message" + exit 1 +} -for i in $(ls $THEMES_DIR); do - echo "Now showing theme $i" - theme_preview $i +function list_themes() { + for THEME in $(ls $THEMES_DIR); do + THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` + echo $THEME_NAME + done +} + +function insert_favlist() { + if grep -q "$THEME_NAME" $FAVLIST 2> /dev/null ; then + echo "Already in favlist" + else + echo $THEME_NAME >> $FAVLIST + echo "Saved to favlist" + fi + +} + +function theme_chooser() { + for THEME in $(ls $THEMES_DIR); do + echo + theme_preview $THEME + echo + if [[ -z $1 ]]; then + noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ + insert_favlist $THEME_NAME + echo + fi + done +} + +while getopts ":lhs" Option +do + case $Option in + l ) list_themes ;; + s ) theme_chooser 0 ;; + h ) usage ;; + * ) usage ;; # Default. + esac done + +if [[ -z $Option ]]; then + if [[ -z $1 ]]; then + banner + echo + theme_chooser + else + theme_preview $1".zsh-theme" + fi +fi From 3780247f633d99b6870e39ea77c540ebb5125095 Mon Sep 17 00:00:00 2001 From: Sune Kibsgaard Pedersen Date: Thu, 4 Aug 2011 12:37:33 +0200 Subject: [PATCH 045/220] added option of setting another path to custom plugins and files just set ZSH_CUSTOM in your .zshrc, if not set oh-my-zsh.sh will use the default custom dir in the repository --- oh-my-zsh.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c4522491b..3865abe17 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -21,17 +21,24 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) autoload -U compinit compinit -i +# Set ZSH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom/ +if [ "$ZSH_CUSTOM" = "" ] +then + ZSH_CUSTOM="$ZSH/custom" +fi + # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do - if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh + if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then + source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi done # Load all of your custom configurations from custom/ -for config_file ($ZSH/custom/*.zsh) source $config_file +for config_file ($ZSH_CUSTOM/*.zsh) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] From 749feb2720948a4ac9a981286654962e699d8d94 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sat, 6 Aug 2011 15:22:55 -0400 Subject: [PATCH 046/220] Merge "deb" and "debian" plugins. --- plugins/deb/deb.plugin.zsh | 13 ------------- plugins/debian/debian.plugin.zsh | 30 +++++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 16 deletions(-) delete mode 100644 plugins/deb/deb.plugin.zsh diff --git a/plugins/deb/deb.plugin.zsh b/plugins/deb/deb.plugin.zsh deleted file mode 100644 index 1b35a0646..000000000 --- a/plugins/deb/deb.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -# Aliases -alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ - --no-gui --disable-columns search" # search package -alias ad="sudo apt-get update" # update packages lists -alias au="sudo apt-get update && \ - sudo apt-get dselect-upgrade" # upgrade packages -alias ai="sudo apt-get install" # install package -alias ar="sudo apt-get remove --purge && \ - sudo apt-get autoremove --purge" # remove package -alias ap="apt-cache policy" # apt policy -alias av="apt-cache show" # show package info -alias acs="apt-cache search" # search package -alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index f8865a412..6feb6973d 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -1,4 +1,4 @@ -# https://github.com/dbbolton/ +# https://github.com/dbb/ # # Debian-related zsh aliases and functions for zsh @@ -6,14 +6,29 @@ # Aliases ################################################################### # Some self-explanatory aliases +alias acs="apt-cache search" alias afs='apt-file search --regexp' alias aps='aptitude search' +alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ + --no-gui --disable-columns search" # search package alias apsrc='apt-get source' alias apv='apt-cache policy' +# aliases that use su -c ############## alias apdg='su -c "aptitude update && aptitude safe-upgrade"' alias apud='su -c "aptitude update"' alias apug='su -c "aptitude safe-upgrade"' +# end aliases that use su -c ########## + +# aliases that use sudo ############### +alias ad="sudo apt-get update" # update packages lists +alias au="sudo apt-get update && \ + sudo apt-get dselect-upgrade" # upgrade packages +alias ai="sudo apt-get install" # install package +alias ar="sudo apt-get remove --purge && \ + sudo apt-get autoremove --purge" # remove package +alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache +# end aliases that use sudo ########### # print all installed packages alias allpkgs='aptitude search -F "%p" --disable-columns ~i' @@ -33,6 +48,13 @@ alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`unam # Functions ################################################################# +# install packages without sudo +apin() { + cmd="su -lc 'aptitude -P install $@' root" + print "$cmd" + eval "$cmd" +} + # create a simple script that can be used to 'duplicate' a system apt-copy() { print '#!/bin/sh'"\n" > apt-copy.sh @@ -46,8 +68,10 @@ apt-copy() { # Kernel-package building shortcut -dbb-build () { - MAKEFLAGS='' # temporarily unset MAKEFLAGS ( '-j3' will fail ) +kerndeb () { + # temporarily unset MAKEFLAGS ( '-j3' will fail ) + MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) + print '$MAKEFLAGS set to '"'$MAKEFLAGS'" appendage='-custom' # this shows up in $ (uname -r ) revision=$(date +"%Y%m%d") # this shows up in the .deb file name From fd55d53eb22856883953bb6efc89bb2d643ef296 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sat, 6 Aug 2011 15:41:52 -0400 Subject: [PATCH 047/220] Fix su commands --- plugins/debian/debian.plugin.zsh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 6feb6973d..0c487cf70 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -15,9 +15,9 @@ alias apsrc='apt-get source' alias apv='apt-cache policy' # aliases that use su -c ############## -alias apdg='su -c "aptitude update && aptitude safe-upgrade"' -alias apud='su -c "aptitude update"' -alias apug='su -c "aptitude safe-upgrade"' +alias apdg='su -lc "aptitude update && aptitude safe-upgrade" root' +alias apud='su -lc "aptitude update" root' +alias apug='su -lc "aptitude safe-upgrade" root' # end aliases that use su -c ########## # aliases that use sudo ############### @@ -36,13 +36,13 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i' # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: # glob_subst -alias di='su -c "dpkg -i ./*.deb"' +alias di='su -lc "dpkg -i ./*.deb" root' # Create a basic .deb package alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' # Remove ALL kernel images and headers EXCEPT the one in use -alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root' +alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root' @@ -81,4 +81,3 @@ kerndeb () { "$revision" kernel_image kernel_headers } - From 8ed6dd5fc4c5e9b28d0f8a87f72c0bbe5f628580 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sat, 6 Aug 2011 15:58:40 -0400 Subject: [PATCH 048/220] Add functions for new GH repos. --- plugins/github/github.plugin.zsh | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 1eb338113..e5f59097d 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -4,3 +4,44 @@ if [ "$commands[(I)hub]" ]; then # eval `hub alias -s zsh` function git(){hub "$@"} fi + +# Functions ################################################################# + +# https://github.com/dbb + +# These are taken directly from the instructions you see after you create a new +# repo. As the names imply, new_gh() assumes you're starting from scratch in a +# directory named after the repo (this name is the only argument it takes), and +# exist_gh() assumes that you've already initialized git in the given directory +# (again, the only argument). +# set up a new repo + +new_gh() { # [NAME_OF_REPO] + repo = $1 + + name=$( igit config user.name ) + email=$( git config user.email ) + user=$( git config github.user ) + + mkdir "$repo" + cd "$repo" + git init + touch README + git add README + git commit -m 'Initial commit.' + git remote add origin git@github.com:${user}/${name}.git + git push -u origin master +} + +exist_gh() { # [DIRECTORY] + cd "$1" + name=$( git config user.name ) + email=$( git config user.email ) + user=$( git config github.user ) + + git remote add origin git@github.com:${user}/${name}.git + git push -u origin master +} + +# End Functions ############################################################# + From 8c48f10a04ce8e6c789cead457e062602cc89931 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sat, 6 Aug 2011 16:15:09 -0400 Subject: [PATCH 049/220] Add functions for new GH repos. --- plugins/github/github.plugin.zsh | 44 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index e5f59097d..fc51b173c 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -9,19 +9,13 @@ fi # https://github.com/dbb -# These are taken directly from the instructions you see after you create a new -# repo. As the names imply, new_gh() assumes you're starting from scratch in a -# directory named after the repo (this name is the only argument it takes), and -# exist_gh() assumes that you've already initialized git in the given directory -# (again, the only argument). -# set up a new repo -new_gh() { # [NAME_OF_REPO] +# empty_gh [NAME_OF_REPO] +# +# Use this when creating a new repo from scratch. +empty_gh() { # [NAME_OF_REPO] repo = $1 - - name=$( igit config user.name ) - email=$( git config user.email ) - user=$( git config github.user ) + ghuser=$( git config github.user ) mkdir "$repo" cd "$repo" @@ -29,17 +23,37 @@ new_gh() { # [NAME_OF_REPO] touch README git add README git commit -m 'Initial commit.' - git remote add origin git@github.com:${user}/${name}.git + git remote add origin git@github.com:${ghuser}/${repo}.git git push -u origin master } +# new_gh [DIRECTORY] +# +# Use this when you have a directory that is not yet set up for git. +# This function will add all non-hidden files to git. +new_gh() { # [DIRECTORY] + cd "$1" + ghuser=$( git config github.user ) + + git init + # add all non-dot files + print '.*'"\n"'*~' >> .gitignore + git add ^.* + git commit -m 'Initial commit.' + git remote add origin git@github.com:${ghuser}/${repo}.git + git push -u origin master +} + +# exist_gh [DIRECTORY] +# +# Use this when you have a git repo that's ready to go and you want to add it +# to your GitHub. exist_gh() { # [DIRECTORY] cd "$1" name=$( git config user.name ) - email=$( git config user.email ) - user=$( git config github.user ) + ghuser=$( git config github.user ) - git remote add origin git@github.com:${user}/${name}.git + git remote add origin git@github.com:${ghuser}/${repo}.git git push -u origin master } From fac74012f81fc99eb2ba7a85e94a2cd74c352271 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sun, 7 Aug 2011 15:30:55 -0400 Subject: [PATCH 050/220] Add options for su(do) and apt(itude|-get) --- plugins/debian/debian.plugin.zsh | 76 ++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 0c487cf70..1df91dc4a 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -1,48 +1,76 @@ -# https://github.com/dbb/ +# Authors: +# https://github.com/AlexBio +# https://github.com/dbb # # Debian-related zsh aliases and functions for zsh +# Set to 'apt-get' or 'aptitude' +apt_pref='aptitude' + +# Use sudo by default if it's installed +if [[ -e $( which sudo ) ]]; then + use_sudo=1 +fi # Aliases ################################################################### # Some self-explanatory aliases alias acs="apt-cache search" -alias afs='apt-file search --regexp' alias aps='aptitude search' alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ --no-gui --disable-columns search" # search package -alias apsrc='apt-get source' -alias apv='apt-cache policy' -# aliases that use su -c ############## -alias apdg='su -lc "aptitude update && aptitude safe-upgrade" root' -alias apud='su -lc "aptitude update" root' -alias apug='su -lc "aptitude safe-upgrade" root' -# end aliases that use su -c ########## +# apt-file +alias afs='apt-file search --regexp' + + +# These are apt-get only +alias asrc='apt-get source' +alias ap='apt-cache policy' + +# superuser operations ################ +if [[ $use_sudo -eq 1 ]]; then + alias ai="sudo $apt_pref install" + alias ad="sudo $apt_pref update" + alias afu='sudo apt-file update' + alias ag="sudo $apt_pref upgrade" + alias adg="sudo $apt_pref update && sudo $apt_pref upgrade" + alias ap="sudo $apt_pref purge" + alias ar="sudo $apt_pref remove" + + if [[ $apt_pref -eq 'apt-get' ]]; then + alias ads="sudo $apt_pref dselect-upgrade" + fi + + # Install all .deb files in the current directory. + # Warning: you will need to put the glob in single quotes if you use: + # glob_subst + alias di='sudo dpkg -i ./*.deb' + + # Remove ALL kernel images and headers EXCEPT the one in use + alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))' +else + alias ai='apin' + alias ad='su -lc "'"$apt_pref"' update" root' + alias afu='su -lc "apt-file update"' + alias ag='su -lc "'"$apt_pref"' safe-upgrade" root' + alias adg='su -lc "'"$apt_pref"' update && aptitude safe-upgrade" root' + alias di='su -lc "dpkg -i ./*.deb" root' + # Remove ALL kernel images and headers EXCEPT the one in use + alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root' +fi +# end superuser operations ########## -# aliases that use sudo ############### -alias ad="sudo apt-get update" # update packages lists -alias au="sudo apt-get update && \ - sudo apt-get dselect-upgrade" # upgrade packages -alias ai="sudo apt-get install" # install package -alias ar="sudo apt-get remove --purge && \ - sudo apt-get autoremove --purge" # remove package -alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache -# end aliases that use sudo ########### # print all installed packages alias allpkgs='aptitude search -F "%p" --disable-columns ~i' -# Install all .deb files in the current directory. -# Warning: you will need to put the glob in single quotes if you use: -# glob_subst -alias di='su -lc "dpkg -i ./*.deb" root' + # Create a basic .deb package alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' -# Remove ALL kernel images and headers EXCEPT the one in use -alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root' + From 65393b4bb10de841edbe2026dba29b73625b33d7 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sun, 7 Aug 2011 16:51:14 -0400 Subject: [PATCH 051/220] Extend root ops, switch apt-copy to plain zsh --- plugins/debian/debian.plugin.zsh | 92 ++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 1df91dc4a..23cb98f93 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -4,8 +4,13 @@ # # Debian-related zsh aliases and functions for zsh -# Set to 'apt-get' or 'aptitude' -apt_pref='aptitude' +# Use aptitude if installed, or apt-get if not. +# You can just set apt_pref='apt-get' to override it. +if [[ -e $( which aptitude ) ]]; then + apt_pref='aptitude' +else + apt_pref='apt-get' +fi # Use sudo by default if it's installed if [[ -e $( which sudo ) ]]; then @@ -13,6 +18,10 @@ if [[ -e $( which sudo ) ]]; then fi # Aliases ################################################################### +# These are for more obscure uses of apt-get and aptitude that aren't covered +# below. +alias ag='apt-get' +alias at='aptitude' # Some self-explanatory aliases alias acs="apt-cache search" @@ -28,19 +37,23 @@ alias afs='apt-file search --regexp' alias asrc='apt-get source' alias ap='apt-cache policy' -# superuser operations ################ +# superuser operations ###################################################### if [[ $use_sudo -eq 1 ]]; then - alias ai="sudo $apt_pref install" +# commands using sudo ####### + alias aac="sudo $apt_pref autoclean" + alias abd="sudo $apt_pref build-dep" + alias ac="sudo $apt_pref clean" alias ad="sudo $apt_pref update" + alias adg="sudo $apt_pref update && sudo $apt_pref upgrade" + alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" alias afu='sudo apt-file update' alias ag="sudo $apt_pref upgrade" - alias adg="sudo $apt_pref update && sudo $apt_pref upgrade" + alias ai="sudo $apt_pref install" alias ap="sudo $apt_pref purge" alias ar="sudo $apt_pref remove" - if [[ $apt_pref -eq 'apt-get' ]]; then - alias ads="sudo $apt_pref dselect-upgrade" - fi + # apt-get only + alias ads="sudo $apt_pref dselect-upgrade" # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: @@ -48,25 +61,54 @@ if [[ $use_sudo -eq 1 ]]; then alias di='sudo dpkg -i ./*.deb' # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))' + alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ + ?not(~n`uname -r`))' + + +# commands using su ######### else - alias ai='apin' + alias aac='su -ls "'"$apt_pref"' autoclean" root' + abd() { + cmd="su -lc '$apt_pref build-dep $@' root" + print "$cmd" + eval "$cmd" + } + alias ac='su -ls "'"$apt_pref"' clean" root' alias ad='su -lc "'"$apt_pref"' update" root' + alias adg='su -lc "'"$apt_pref"' update && aptitude safe-upgrade" root' + alias adu='su -lc "'"$apt_pref"' update && aptitude dist-upgrade" root' alias afu='su -lc "apt-file update"' alias ag='su -lc "'"$apt_pref"' safe-upgrade" root' - alias adg='su -lc "'"$apt_pref"' update && aptitude safe-upgrade" root' + ai() { + cmd="su -lc 'aptitude -P install $@' root" + print "$cmd" + eval "$cmd" + } + ap() { + cmd="su -lc '$apt_pref -P purge $@' root" + print "$cmd" + eval "$cmd" + } + ar() { + cmd="su -lc '$apt_pref -P remove $@' root" + print "$cmd" + eval "$cmd" + } + + # Install all .deb files in the current directory + # Assumes glob_subst is off alias di='su -lc "dpkg -i ./*.deb" root' + # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root' + alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \ + ?not(~n`uname -r`))'\'' root' fi -# end superuser operations ########## +# Misc. ##################################################################### # print all installed packages alias allpkgs='aptitude search -F "%p" --disable-columns ~i' - - # Create a basic .deb package alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' @@ -75,23 +117,19 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' # Functions ################################################################# - -# install packages without sudo -apin() { - cmd="su -lc 'aptitude -P install $@' root" - print "$cmd" - eval "$cmd" -} - # create a simple script that can be used to 'duplicate' a system apt-copy() { - print '#!/bin/sh'"\n" > apt-copy.sh + print '#!/bin/sh'"\n" > apt-copy.sh - list=$(perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;') + cmd="$apt_pref install -s " - print 'aptitude install '"$list\n" >> apt-copy.sh + for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; { + cmd="${cmd} ${p}" + } - chmod +x apt-copy.sh + print $cmd "\n" >> apt-copy.sh + + chmod +x apt-copy.sh } From d5333e8efc0f6669d64bba1b2aa6e80bc2e7c8e8 Mon Sep 17 00:00:00 2001 From: Ali B Date: Fri, 12 Aug 2011 00:40:35 +1000 Subject: [PATCH 052/220] Heroku completion plugin --- plugins/heroku/_heroku | 158 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 plugins/heroku/_heroku diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku new file mode 100644 index 000000000..dc899e2b2 --- /dev/null +++ b/plugins/heroku/_heroku @@ -0,0 +1,158 @@ +#compdef heroku + +# Heroku Autocomplete plugin for Oh-My-Zsh +# Requires: The Heroku client gem (https://github.com/heroku/heroku) +# Author: Ali B. (http://awhitebox.com) + +local -a _1st_arguments +_1st_arguments=( + "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" + "addons":"list installed addons" + "addons\:list":"list all available addons" + "addons\:add":"install an addon" + "addons\:upgrade":"upgrade an existing addon" + "addons\:downgrade":"downgrade an existing addon" + "addons\:remove":"uninstall an addon" + "addons\:open":"open an addon's dashboard in your browser" + "apps":"list your apps" + "apps\:info":"show detailed app information" + "apps\:create":"create a new app" + "apps\:rename":"rename the app" + "apps\:open":"open the app in a web browser" + "apps\:destroy":"permanently destroy an app" + "auth\:login":"log in with your heroku credentials" + "auth\:logout":"clear local authentication credentials" + "config":"display the config vars for an app" + "config\:add":"add one or more config vars" + "config\:remove":"remove a config var" + "db\:push":"push local data up to your app" + "db\:pull":"pull heroku data down into your local database" + "domains":"list custom domains for an app" + "domains\:add":"add a custom domain to an app" + "domains\:remove":"remove a custom domain from an app" + "domains\:clear":"remove all custom domains from an app" + "help":"list available commands or display help for a specific command" + "keys":"display keys for the current user" + "keys\:add":"add a key for the current user" + "keys\:remove":"remove a key from the current user" + "keys\:clear":"remove all authentication keys from the current user" + "logs":"display recent log output" + "logs\:cron":"DEPRECATED: display cron logs from legacy logging" + "logs\:drains":"manage syslog drains" + "maintenance\:on":"put the app into maintenance mode" + "maintenance\:off":"take the app out of maintenance mode" + "pg\:info":"display database information" + "pg\:ingress":"allow direct connections to the database from this IP for one minute" + "pg\:promote":"sets DATABASE as your DATABASE_URL" + "pg\:psql":"open a psql shell to the database" + "pg\:reset":"delete all data in DATABASE" + "pg\:unfollow":"stop a replica from following and make it a read/write database" + "pg\:wait":"monitor database creation, exit when complete" + "pgbackups":"list captured backups" + "pgbackups\:url":"get a temporary URL for a backup" + "pgbackups\:capture":"capture a backup from a database id" + "pgbackups\:restore":"restore a backup to a database" + "pgbackups\:destroy":"destroys a backup" + "plugins":"list installed plugins" + "plugins\:install":"install a plugin" + "plugins\:uninstall":"uninstall a plugin" + "ps\:dynos":"scale to QTY web processes" + "ps\:workers":"scale to QTY background processes" + "ps":"list processes for an app" + "ps\:restart":"restart an app process" + "ps\:scale":"scale processes by the given amount" + "releases":"list releases" + "releases\:info":"view detailed information for a release" + "rollback":"roll back to an older release" + "run":"run an attached process" + "run\:rake":"remotely execute a rake command" + "run\:console":"open a remote console session" + "sharing":"list collaborators on an app" + "sharing\:add":"add a collaborator to an app" + "sharing\:remove":"remove a collaborator from an app" + "sharing\:transfer":"transfer an app to a new owner" + "ssl":"list certificates for an app" + "ssl\:add":"add an ssl certificate to an app" + "ssl\:remove":"remove an ssl certificate from an app" + "ssl\:clear":"remove all ssl certificates from an app" + "stack":"show the list of available stacks" + "stack\:migrate":"prepare migration of this app to a new stack" + "version":"show heroku client version" +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "heroku command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + apps:info) + _command_args=( + '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ + ) + ;; + apps:create) + _command_args=( + '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ + '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ + '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ + ) + ;; + config) + _command_args=( + '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ + ) + ;; + db:push) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \ + '(-f|--filter)'{-f,--filter}'[only push certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \ + ) + ;; + db:pull) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \ + '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \ + ) + ;; + keys) + _command_args=( + '(-l|--long)'{-l,--long}'[display extended information for each key]' \ + ) + ;; + logs) + _command_args=( + '(-n|--num)'{-n,--num}'[the number of lines to display]' \ + '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ + '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ + '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ + ) + ;; + pgbackups:capture) + _command_args=( + '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ + ) + ;; + stack) + _command_args=( + '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + '(--app)--app[the app name]' \ + && return 0 + From c2a95b796b79b4ce4e36b8cb879cb9b0162bc438 Mon Sep 17 00:00:00 2001 From: Matthew Git McCullough Date: Tue, 14 Jun 2011 15:01:28 -0600 Subject: [PATCH 053/220] Added a gradle build tool plugin * Enhanced gradle plugin to parse tasks from a quick execution of the tool * Added a duplicated function for gradlew completion that uses gradlew internally. Builds like Gradle itself (built with Gradle) are sensitive to being run with a matching gradlew version. * Fixed broken caching of gradle task names. Added - and -- argument completions. --- plugins/gradle/gradle.plugin.zsh | 119 +++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 plugins/gradle/gradle.plugin.zsh diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh new file mode 100644 index 000000000..fc4c78c50 --- /dev/null +++ b/plugins/gradle/gradle.plugin.zsh @@ -0,0 +1,119 @@ +#!zsh +############################################################################## +# A descriptive listing of core Gradle commands +############################################################################ +function _gradle_core_commands() { + local ret=1 state + _arguments ':subcommand:->subcommand' && ret=0 + + case $state in + subcommand) + subcommands=( + "properties:Display all project properties" + "tasks:Calculate and display all tasks" + "dependencies:Calculate and display all dependencies" + "projects:Discover and display all sub-projects" + "build:Build the project" + "help:Display help" + ) + _describe -t subcommands 'gradle subcommands' subcommands && ret=0 + esac + + return ret +} + +function _gradle_arguments() { + _arguments -C \ + '-a[Do not rebuild project dependencies]' \ + '-h[Help]' \ + '-D[System property]' \ + '-d[Log at the debug level]' \ + '--gui[Launches the Gradle GUI app]' \ + '--stop[Stop the Gradle daemon]' \ + '--daemon[Use the Gradle daemon]' \ + '--no-daemon[Do not use the Gradle daemon]' \ + '--no-opt[Do not perform any task optimization]' \ + '-i[Log at the info level]' \ + '-m[Dry run]' \ + '-P[Set a project property]' \ + '--profile[Profile the build time]' \ + '-q[Log at the quiet level (only show errors)]' \ + '-v[Print the Gradle version info]' \ + '-x[Specify a task to be excluded]' \ + '*::command:->command' \ + && return 0 +} + + +############################################################################## +# Are we in a directory containing a build.gradle file? +############################################################################ +function in_gradle() { + if [[ -f build.gradle ]]; then + echo 1 + fi +} + +############################################################################ +# Define the stat_cmd command based on platform behavior +########################################################################## +stat -f%m . > /dev/null 2>&1 +if [ "$?" = 0 ]; then + stat_cmd=(stat -f%m) +else + stat_cmd=(stat -L --format=%Y) +fi + +############################################################################## Examine the build.gradle file to see if its +# timestamp has changed, and if so, regen +# the .gradle_tasks cache file +############################################################################ +_gradle_does_task_list_need_generating () { + if [ ! -f .gradletasknamecache ]; then return 0; + else + accurate=$($stat_cmd .gradletasknamecache) + changed=$($stat_cmd build.gradle) + return $(expr $accurate '>=' $changed) + fi +} + + +############################################################################## +# Discover the gradle tasks by running "gradle tasks --all" +############################################################################ +_gradle_tasks () { + if [ in_gradle ]; then + _gradle_arguments + if _gradle_does_task_list_need_generating; then + gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache + fi + compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache` + fi +} + +_gradlew_tasks () { + if [ in_gradle ]; then + _gradle_arguments + if _gradle_does_task_list_need_generating; then + gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache + fi + compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache` + fi +} + + +############################################################################## +# Register the completions against the gradle and gradlew commands +############################################################################ +compdef _gradle_tasks gradle +compdef _gradlew_tasks gradlew + + +############################################################################## +# Open questions for future improvements: +# 1) Should 'gradle tasks' use --all or just the regular set? +# 2) Should gradlew use the same approach as gradle? +# 3) Should only the " - " be replaced with a colon so it can work +# with the richer descriptive method of _arguments? +# gradle tasks | grep "^[a-zA-Z0-9]*\ -\ " | sed "s/ - /\:/" +############################################################################# From 11fcdb844d67492080befd8dcd1f995deb26b8ee Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Sat, 13 Aug 2011 04:53:23 +0700 Subject: [PATCH 054/220] Add guard to bundler plugin's wrapped commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index f005700ff..a6c116407 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bp="bundle package" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber guard heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From 4dc11fee35f21b295deb1a61503031c8e17f83a1 Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Sat, 13 Aug 2011 13:29:13 +0300 Subject: [PATCH 055/220] detect rvm or rbenv and show ruby version --- themes/gnzh.zsh-theme | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 357798cf6..7765efbf2 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png +# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png # Based on bira theme # load some modules @@ -35,9 +35,17 @@ local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' -local rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' +local rvm_ruby='' +if which rvm-prompt &> /dev/null; then + rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' +else + if which rbenv &> /dev/null; then + rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' + fi +fi local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' +#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} ╰─$PR_PROMPT " RPS1="${return_code}" From 7a89786139bcfd83e0e9caa9974f66a423c6ed48 Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Sat, 13 Aug 2011 13:32:37 +0300 Subject: [PATCH 056/220] oops, restore broken theme preview --- themes/gnzh.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 7765efbf2..3c6b8a409 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png # Based on bira theme # load some modules From d3116d4f0b499bb76e371f7d60eed48b81068932 Mon Sep 17 00:00:00 2001 From: Daniel Bolton Date: Sat, 13 Aug 2011 10:53:24 -0400 Subject: [PATCH 057/220] Remove -s switch from apt-copy --- plugins/debian/debian.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 23cb98f93..09771881d 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -121,7 +121,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' apt-copy() { print '#!/bin/sh'"\n" > apt-copy.sh - cmd="$apt_pref install -s " + cmd="$apt_pref install " for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; { cmd="${cmd} ${p}" From 85f388fabf657360960c3fcf55b52f2fb3c4e142 Mon Sep 17 00:00:00 2001 From: David Aaron Fendley Date: Tue, 16 Aug 2011 11:18:23 -0500 Subject: [PATCH 058/220] Added nifty purple Apple theme. --- themes/apple.zsh-theme | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 themes/apple.zsh-theme diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme new file mode 100644 index 000000000..350548e36 --- /dev/null +++ b/themes/apple.zsh-theme @@ -0,0 +1,5 @@ +function toon { + echo -n "" +} + +PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}' From bf2c55ac5a789d8874e6d8e06360608b4234e872 Mon Sep 17 00:00:00 2001 From: Ben Lumley Date: Tue, 16 Aug 2011 17:23:33 +0100 Subject: [PATCH 059/220] Gallois theme - made the git branch/status show for those of us without rvm --- themes/gallois.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 259640ba4..f9406dd96 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -14,6 +14,8 @@ git_custom_status() { #RVM and git settings if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' +else + RPS1='$(git_custom_status) $EPS1' fi PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' From c113e88c454cf759078f06c95f4b35db90acb9d7 Mon Sep 17 00:00:00 2001 From: Tim Taylor Date: Wed, 17 Aug 2011 00:17:21 -0400 Subject: [PATCH 060/220] Fix auto upgrade failure from non-exported ZSH env var Fixes #549. Specify ZSH=$ZSH explicitly when invoking the auto update scripts. --- oh-my-zsh.sh | 2 +- tools/check_for_upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c4522491b..f77762815 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,7 +1,7 @@ # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ] then - /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh + /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index e1e4eb99f..aeaa0e415 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -24,7 +24,7 @@ then read line if [ "$line" = Y ] || [ "$line" = y ] then - /bin/sh $ZSH/tools/upgrade.sh + /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh # update the zsh file _update_zsh_update fi From 1fb141cfb51f753fe997d17c12ac810ad321f36f Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Aug 2011 16:16:51 -0500 Subject: [PATCH 061/220] Add gss alias for git status -s --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5132b639a..37bfd383a 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -29,6 +29,8 @@ alias glg='git log --stat --max-count=5' compdef _git glg=git-log alias glgg='git log --graph --max-count=5' compdef _git glgg=git-log +alias gss='git status -s' +compdef _git gss=git-status # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From bd6aba9c68db06758593e9ef707839c2f0271235 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Aug 2011 16:23:49 -0500 Subject: [PATCH 062/220] Add an alias for ga --> git add, too --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 37bfd383a..4fcf9425d 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -31,6 +31,8 @@ alias glgg='git log --graph --max-count=5' compdef _git glgg=git-log alias gss='git status -s' compdef _git gss=git-status +alias ga='git add' +compdef _git ga=git-add # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 9d67d75b0ad62242e60db1bd6d22ae7ea252c7bc Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 30 Aug 2011 20:56:13 -0700 Subject: [PATCH 063/220] Revert "Enable red dots during completion by default". After a few weeks of using this, I'd prefer this to not be enabled by default. My bad for suggesting that in the first place. This reverts commit fc49b4a4ded376cd82b813dcb6d72fdc050b7bed. --- lib/completion.zsh | 2 +- templates/zshrc.zsh-template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 2a457402a..b3cc91822 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,7 +59,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -if [ "$DISABLE_COMPLETION_WAITING_DOTS" != "true" ]; then +if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then expand-or-complete-with-dots() { echo -n "\e[31m......\e[0m" zle expand-or-complete diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 4de1fa4e9..1ab40aba6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,8 +19,8 @@ ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable autosetting terminal title. # DISABLE_AUTO_TITLE="true" -# Uncomment following line if you want disable red dots displayed while waiting for completion -# DISABLE_COMPLETION_WAITING_DOTS="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/*) # Example format: plugins=(rails git textmate ruby lighthouse) From 9c5c70dc0a2531b621ba825c2599189717694d56 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 31 Aug 2011 12:51:10 +0100 Subject: [PATCH 064/220] order aliases alphabetically --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index a6c116407..17e17efd9 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,8 +1,8 @@ alias be="bundle exec" alias bi="bundle install" alias bl="bundle list" -alias bu="bundle update" alias bp="bundle package" +alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec From ee507c90461beb06590af1c5e30bd78a62d8c4be Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 31 Aug 2011 12:53:02 +0100 Subject: [PATCH 065/220] add foreman, nanoc, and rainbows to list of bundled commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 17e17efd9..bd26ca312 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber guard heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From fe175661fddd04691cc03012f84490e729cf2bae Mon Sep 17 00:00:00 2001 From: Max Gonzih Date: Fri, 2 Sep 2011 16:06:32 +0300 Subject: [PATCH 066/220] vundle call fixed for new vundle version --- plugins/vundle/vundle.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh index 39c36ac59..d7ab4858d 100644 --- a/plugins/vundle/vundle.plugin.zsh +++ b/plugins/vundle/vundle.plugin.zsh @@ -12,11 +12,11 @@ function vundle-init () { function vundle () { vundle-init - vim -c "execute \"BundleInstall\" | q" + vim -c "execute \"BundleInstall\" | q | q" } function vundle-update () { vundle-init - vim -c "execute \"BundleInstall!\" | q" + vim -c "execute \"BundleInstall!\" | q | q" } From 965e1cfefa41bd0419126d9321eecec4fcbbb0e3 Mon Sep 17 00:00:00 2001 From: Mario Fernandez Date: Sat, 10 Sep 2011 11:35:08 +0200 Subject: [PATCH 067/220] fix completion for commands wrapped with bundler --- plugins/bundler/bundler.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index a6c116407..bd77b0781 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -33,5 +33,10 @@ _run-with-bundler() { ## Main program for cmd in $bundled_commands; do - alias $cmd="_run-with-bundler $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 + fi done From c6e8c856cb59e24362fe50fd93de097f30205420 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Sat, 10 Sep 2011 06:48:40 -0400 Subject: [PATCH 068/220] [plugins/grails] Added grails plugin --- plugins/grails/grails.plugin.zsh | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 plugins/grails/grails.plugin.zsh diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh new file mode 100755 index 000000000..95b1324e7 --- /dev/null +++ b/plugins/grails/grails.plugin.zsh @@ -0,0 +1,62 @@ + +if [[ ! -d $GRAILS_HOME/scripts ]]; +then + echo "$0:" + echo "Please set \$GRAILS_HOME to use the 'grails' plugin, and ensure that \$GRAILS_HOME/scripts exists" +fi + +_enumerateGrailsScripts() { + # Default directoryies + directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts) + + # Check all of the plugins directories, if they exist + if [ -d plugins ] + then + directories+=(plugins/*/scripts) + fi + + # Enumerate all of the Groovy files + files=() + for dir in $directories; + do + if [ -d $dir ] + then + files+=($dir/*.groovy) + fi + done + + # Don't try to basename () + if [ ${#files} -eq 0 ]; + then + return + fi + + # - Strip the path + # - Remove all scripts with a leading '_' + # - PackagePlugin_.groovy -> PackagePlugin + # - PackagePlugin -> Package-Plugin + # - Package-Plugin -> package-plugin + basename $files \ + | grep -vE -e '^_' \ + | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ + -e 's/([a-z])([A-Z])/\1-\2/g' \ + | tr "[:upper:]" "[:lower:]" \ + | sort \ + | uniq +} + +_grails() { + if (( CURRENT == 2 )); then + scripts=( $(_enumerateGrailsScripts) ) + + if [ ${#scripts} -ne 0 ]; + then + _multi_parts / scripts + return + fi + fi + + _files +} + +compdef _grails grails From 51736343595eb83f9d2364b50cf0b62227a4fab4 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Sat, 10 Sep 2011 07:00:31 -0400 Subject: [PATCH 069/220] [plugins/grails] Use globbing instead of grep --- plugins/grails/grails.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh index 95b1324e7..88e8b9008 100755 --- a/plugins/grails/grails.plugin.zsh +++ b/plugins/grails/grails.plugin.zsh @@ -21,7 +21,7 @@ _enumerateGrailsScripts() { do if [ -d $dir ] then - files+=($dir/*.groovy) + files+=($dir/[^_]*.groovy) fi done @@ -37,7 +37,6 @@ _enumerateGrailsScripts() { # - PackagePlugin -> Package-Plugin # - Package-Plugin -> package-plugin basename $files \ - | grep -vE -e '^_' \ | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ -e 's/([a-z])([A-Z])/\1-\2/g' \ | tr "[:upper:]" "[:lower:]" \ From f9c143b69c30396f79e2cb75d11e70e4b983c1bd Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Sat, 10 Sep 2011 07:06:26 -0400 Subject: [PATCH 070/220] [plugins/grails] Remove warning message; it's always displayed --- plugins/grails/grails.plugin.zsh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh index 88e8b9008..cc6f9c53b 100755 --- a/plugins/grails/grails.plugin.zsh +++ b/plugins/grails/grails.plugin.zsh @@ -1,10 +1,3 @@ - -if [[ ! -d $GRAILS_HOME/scripts ]]; -then - echo "$0:" - echo "Please set \$GRAILS_HOME to use the 'grails' plugin, and ensure that \$GRAILS_HOME/scripts exists" -fi - _enumerateGrailsScripts() { # Default directoryies directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts) From ecfac1cd74cada9594531d6c0217e511914a14f6 Mon Sep 17 00:00:00 2001 From: David Aaron Fendley Date: Sun, 11 Sep 2011 15:19:49 -0500 Subject: [PATCH 071/220] Added VCS prompt to Apple theme. --- themes/apple.zsh-theme | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme index 350548e36..92f1df941 100644 --- a/themes/apple.zsh-theme +++ b/themes/apple.zsh-theme @@ -2,4 +2,25 @@ function toon { echo -n "" } -PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}' +get_git_dirty() { + git diff --quiet || echo '*' +} + +autoload -Uz vcs_info +autoload -U colors && colors +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes +zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes +zstyle ':vcs_info:*' actionformats \ + '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' +zstyle ':vcs_info:*' formats \ + '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f ' +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' +zstyle ':vcs_info:*' enable git cvs svn + +precmd () { + vcs_info +} + +setopt prompt_subst +PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}' From 701f775c18f1f8a1acdd3282cc3f68f1075904ad Mon Sep 17 00:00:00 2001 From: Gil Vandendriesssche Date: Wed, 14 Sep 2011 10:13:01 +0300 Subject: [PATCH 072/220] Textmate plugin update to take Gemfile and cucumber features in account --- plugins/textmate/textmate.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh index aa2f75f4f..a11a097f5 100644 --- a/plugins/textmate/textmate.plugin.zsh +++ b/plugins/textmate/textmate.plugin.zsh @@ -1,5 +1,5 @@ alias et='mate .' -alias ett='mate app config lib db public spec test Rakefile Capfile Todo' +alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo' alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' From 1ad8fde027ea3e66c0ed8f1498dfcfb07e0aefe6 Mon Sep 17 00:00:00 2001 From: Philipp Bosch Date: Thu, 15 Sep 2011 15:00:47 +0200 Subject: [PATCH 073/220] Add basic autocompletion for terminitor (https://github.com/achiu/terminitor). --- plugins/terminitor/_terminitor | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/terminitor/_terminitor diff --git a/plugins/terminitor/_terminitor b/plugins/terminitor/_terminitor new file mode 100644 index 000000000..7d267643b --- /dev/null +++ b/plugins/terminitor/_terminitor @@ -0,0 +1,26 @@ +#compdef terminitor +#autoload + +# terminitor zsh completion + +local -a _1st_arguments +_1st_arguments=( + 'create:create a Termfile in directory' + 'delete:delete terminitor script' + 'edit:open termitor script' + 'fetch:clone the designated repo and run setup' + 'help:Describe available tasks or one specific task' + 'init:create initial root terminitor folder' + 'list:lists all terminitor scripts' + 'setup:execute setup in the terminitor script' + 'start:runs the terminitor script' + 'update:update Terminitor to new global path(.config/.terminitor)' +) + +_arguments \ + '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "terminitor task" _1st_arguments + return +fi From 47d0735b5fb5e9e82d8fb5d71f4f4c814e977b68 Mon Sep 17 00:00:00 2001 From: Philipp Bosch Date: Thu, 15 Sep 2011 15:18:15 +0200 Subject: [PATCH 074/220] terminitor plugin: add autocompletion for start subcommand. --- plugins/terminitor/_terminitor | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/terminitor/_terminitor b/plugins/terminitor/_terminitor index 7d267643b..0326506eb 100644 --- a/plugins/terminitor/_terminitor +++ b/plugins/terminitor/_terminitor @@ -3,6 +3,10 @@ # terminitor zsh completion +_terminitor_available_scripts() { + scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) +} + local -a _1st_arguments _1st_arguments=( 'create:create a Termfile in directory' @@ -17,6 +21,8 @@ _1st_arguments=( 'update:update Terminitor to new global path(.config/.terminitor)' ) +local expl + _arguments \ '*:: :->subcmds' && return 0 @@ -24,3 +30,9 @@ if (( CURRENT == 1 )); then _describe -t commands "terminitor task" _1st_arguments return fi + +case "$words[1]" in + start) + _terminitor_available_scripts + _wanted scripts expl 'installed scripts' compadd -a scripts ;; +esac From 0d285e3a0f12b8bf9f0ac63d5ef7930ab9455bff Mon Sep 17 00:00:00 2001 From: Philipp Bosch Date: Thu, 15 Sep 2011 15:22:05 +0200 Subject: [PATCH 075/220] terminitor plugin: add autocompletion also for edit, delete and setup subcommands. --- plugins/terminitor/_terminitor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/terminitor/_terminitor b/plugins/terminitor/_terminitor index 0326506eb..1ce87c3ad 100644 --- a/plugins/terminitor/_terminitor +++ b/plugins/terminitor/_terminitor @@ -32,7 +32,7 @@ if (( CURRENT == 1 )); then fi case "$words[1]" in - start) + start|edit|delete|setup) _terminitor_available_scripts _wanted scripts expl 'installed scripts' compadd -a scripts ;; esac From 14411cb904b7682fe2a5c69861bfffa96f124707 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 12:40:29 +0100 Subject: [PATCH 076/220] Tweaks to the wakeonlan plugin These were suggested by sorin-ionescu in pull request #343. --- plugins/wakeonlan/wakeonlan.plugin.zsh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh index 08db1bdea..752bfc600 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -1,15 +1,18 @@ function wake() { - local config_file=~/.wakeonlan/$1 - if [[ ! -f $config_file ]]; then + local config_file="$HOME/.wakeonlan/$1" + if [[ ! -f "$config_file" ]]; then echo "ERROR: There is no configuration file at \"$config_file\"." - return + return 1 fi - which wakeonlan > /dev/null - if [[ ! $? == 0 ]]; then + if (( ! $+commands[wakeonlan] )); then echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" - return + return 1 fi wakeonlan -f $config_file } + +if (( $+functions[compdef] )); then + compdef "_arguments '1:device to wake:_files -W '\''$HOME/.wakeonlan'\'''" wake +fi From aa7ddd51cc4bd6afca23760ba3e3cc777305b1da Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 12:45:34 +0100 Subject: [PATCH 077/220] Forgot to quote the path parameter to wakeonlan --- plugins/wakeonlan/wakeonlan.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh index 752bfc600..8406b8f7d 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -10,7 +10,7 @@ function wake() { return 1 fi - wakeonlan -f $config_file + wakeonlan -f "$config_file" } if (( $+functions[compdef] )); then From e94039d62b04e61507cbaa57c5fa955d97c8eca9 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 15:42:58 +0100 Subject: [PATCH 078/220] Splitting wakeonlan plugin completion into separate file --- plugins/wakeonlan/_wake | 4 ++++ plugins/wakeonlan/wakeonlan.plugin.zsh | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 plugins/wakeonlan/_wake diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake new file mode 100644 index 000000000..4ab10d374 --- /dev/null +++ b/plugins/wakeonlan/_wake @@ -0,0 +1,4 @@ +#compdef wake +#autoload + +_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh index 8406b8f7d..6cef7d44a 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -12,7 +12,3 @@ function wake() { wakeonlan -f "$config_file" } - -if (( $+functions[compdef] )); then - compdef "_arguments '1:device to wake:_files -W '\''$HOME/.wakeonlan'\'''" wake -fi From d22b253ce2bd69d908f0c2fce75c5d9ab09edda3 Mon Sep 17 00:00:00 2001 From: Roman Kamyk Date: Tue, 20 Sep 2011 10:16:51 +0200 Subject: [PATCH 079/220] split rkj into two themes. --- themes/rkj-repos.zsh-theme | 29 +++++++++++++++++++++++++++++ themes/rkj.zsh-theme | 25 +------------------------ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 themes/rkj-repos.zsh-theme diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme new file mode 100644 index 000000000..318c315bb --- /dev/null +++ b/themes/rkj-repos.zsh-theme @@ -0,0 +1,29 @@ +# user, host, full path, and time/date +# on two lines for easier vgrepping +# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 + +function hg_prompt_info { + hg prompt --angle-brackets "\ +%{$reset_color%}>\ +%{$reset_color%}>\ +%{$fg[red]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" + +function mygit() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +# alternate prompt with git & hg +PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' + diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme index 4b49a2a09..81b701e07 100644 --- a/themes/rkj.zsh-theme +++ b/themes/rkj.zsh-theme @@ -2,30 +2,7 @@ # on two lines for easier vgrepping # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -function hg_prompt_info { - hg prompt --angle-brackets "\ -%{$reset_color%}>\ -%{$reset_color%}>\ -%{$fg[red]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" - -function mygit() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' -#PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -#%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' -#RPROMPT='$(mygit)' + From 7ba54d197dac8d5ae380271259ba4d8843f01b4f Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Tue, 20 Sep 2011 09:26:32 +0100 Subject: [PATCH 080/220] Adding README file for the wakeonlan plugin --- plugins/wakeonlan/README | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/wakeonlan/README diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README new file mode 100644 index 000000000..16fdd4587 --- /dev/null +++ b/plugins/wakeonlan/README @@ -0,0 +1,29 @@ +This plugin provides a wrapper around the "wakeonlan" tool available from most +distributions' package repositories, or from the following website: + +http://gsd.di.uminho.pt/jpo/software/wakeonlan/ + +In order to use this wrapper, create the ~/.wakeonlan directory, and place in +that directory one file for each device you would like to be able to wake. Give +the file a name that describes the device, such as its hostname. Each file +should contain a line with the mac address of the target device and the network +broadcast address. + +For instance, there might be a file ~/.wakeonlan/leto with the following +contents: + +00:11:22:33:44:55:66 192.168.0.255 + +To wake that device, use the following command: + +# wake leto + +The available device names will be autocompleted, so: + +# wake + +...will suggest "leto", along with any other configuration files that were +placed in the ~/.wakeonlan directory. + +For more information regarding the configuration file format, check the +wakeonlan man page. From 2ca2ad3fc5b8635b22d33fd0f1c1511f44e9fff8 Mon Sep 17 00:00:00 2001 From: fceccon Date: Tue, 20 Sep 2011 12:04:06 +0200 Subject: [PATCH 081/220] First search in the custom folder for the theme --- oh-my-zsh.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c4522491b..6ab2ba35f 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -45,7 +45,12 @@ then else if [ ! "$ZSH_THEME" = "" ] then - source "$ZSH/themes/$ZSH_THEME.zsh-theme" + if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ] + then + source "$ZSH/custom/$ZSH_THEME.zsh-theme" + else + source "$ZSH/themes/$ZSH_THEME.zsh-theme" + fi fi fi From c2d0cdd5330ae072468ca801d0b5750bf4fae7c3 Mon Sep 17 00:00:00 2001 From: James Moore Date: Fri, 23 Sep 2011 10:18:09 -0700 Subject: [PATCH 082/220] This needs to explicitly check the return value --- plugins/svn/svn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 53a8a513a..b1f873be5 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,5 +1,5 @@ function svn_prompt_info { - if [ in_svn ]; then + if [[ in_svn == 1 ]]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi From b2703a3c8a6c860eeea8a36bc693a1508372d8c1 Mon Sep 17 00:00:00 2001 From: James Moore Date: Fri, 23 Sep 2011 10:51:20 -0700 Subject: [PATCH 083/220] This is the correct way to check the return value --- plugins/svn/svn.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index b1f873be5..e2cf96ca3 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,5 +1,5 @@ function svn_prompt_info { - if [[ in_svn == 1 ]]; then + if [ $(in_svn) ]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi @@ -13,7 +13,7 @@ function in_svn() { } function svn_get_repo_name { - if [ in_svn ]; then + if [ $(in_svn) ]; then svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" @@ -21,13 +21,13 @@ function svn_get_repo_name { } function svn_get_rev_nr { - if [ in_svn ]; then + if [ $(in_svn) ]; then svn info 2> /dev/null | sed -n s/Revision:\ //p fi } function svn_dirty_choose { - if [ in_svn ]; then + if [ $(in_svn) ]; then s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) if [ $s ]; then echo $1 From 8287cc177e993aebc8ee0a9f5ee5a1cee6893253 Mon Sep 17 00:00:00 2001 From: Nick Stenning Date: Sat, 24 Sep 2011 17:09:57 +0100 Subject: [PATCH 084/220] Better cake completion: don't barf on options, and don't clobber user's namespace --- plugins/cake/cake.plugin.zsh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh index f968c71d5..1d0d196ee 100644 --- a/plugins/cake/cake.plugin.zsh +++ b/plugins/cake/cake.plugin.zsh @@ -1,18 +1,22 @@ # Set this to 1 if you want to cache the tasks -cache_task_list=1 +_cake_cache_task_list=1 # Cache filename -cache_file='.cake_task_cache' +_cake_task_cache_file='.cake_task_cache' + +_cake_get_target_list () { + cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' +} _cake_does_target_list_need_generating () { - if [ $cache_task_list -eq 0 ]; then + if [ ${_cake_cache_task_list} -eq 0 ]; then return 1; fi - if [ ! -f $cache_file ]; then return 0; + if [ ! -f ${_cake_task_cache_file} ]; then return 0; else - accurate=$(stat -f%m $cache_file) + accurate=$(stat -f%m $_cake_task_cache_file) changed=$(stat -f%m Cakefile) return $(expr $accurate '>=' $changed) fi @@ -21,12 +25,12 @@ _cake_does_target_list_need_generating () { _cake () { if [ -f Cakefile ]; then if _cake_does_target_list_need_generating; then - cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file - compadd `cat $cache_file` + _cake_get_target_list > ${_cake_task_cache_file} + compadd `cat ${_cake_task_cache_file}` else - compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'` + compadd `_cake_get_target_list` fi fi } -compdef _cake cake +compdef _cake cake \ No newline at end of file From c1c7b0e4af8a33c25118679f075f63a3b67b14f4 Mon Sep 17 00:00:00 2001 From: Dan Shearmur Date: Mon, 26 Sep 2011 14:44:42 +0100 Subject: [PATCH 085/220] added git merge as gm --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 4fcf9425d..183c56c1c 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -33,6 +33,8 @@ alias gss='git status -s' compdef _git gss=git-status alias ga='git add' compdef _git ga=git-add +alias gm='git merge' +compdef _git gm=git-merge # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 40cc4dabfb7cd91e09e70a3dd11f73b20d303303 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Tue, 4 Oct 2011 21:27:36 -0500 Subject: [PATCH 086/220] Add new theme: wuffers --- themes/wuffers.zsh-theme | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 themes/wuffers.zsh-theme diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme new file mode 100644 index 000000000..004b5ebc4 --- /dev/null +++ b/themes/wuffers.zsh-theme @@ -0,0 +1,5 @@ +ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[blue][" +ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color " +ZSH_THEME_GIT_PROMPT_DIRTY="$fg_bold[red] x$fg_bold[blue]" + +PROMPT='$(git_prompt_info)$fg_bold[green]{$(rvm current)}$reset_color $fg[cyan]%c$reset_color ' From c373c7153be77a91d30a9c6d5ea96b18e911823c Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Tue, 4 Oct 2011 21:30:32 -0500 Subject: [PATCH 087/220] Fix up some wonkiness --- themes/wuffers.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme index 004b5ebc4..182d8a34f 100644 --- a/themes/wuffers.zsh-theme +++ b/themes/wuffers.zsh-theme @@ -1,5 +1,5 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[blue][" -ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color " -ZSH_THEME_GIT_PROMPT_DIRTY="$fg_bold[red] x$fg_bold[blue]" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" -PROMPT='$(git_prompt_info)$fg_bold[green]{$(rvm current)}$reset_color $fg[cyan]%c$reset_color ' +PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' From 7553d0171f7d1fe070a70af2c863fdadf6d7d5ac Mon Sep 17 00:00:00 2001 From: Gavin Huang Date: Tue, 18 Oct 2011 11:46:45 +0800 Subject: [PATCH 088/220] Replace "git-diff" with "git diff" in the git plugin --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 183c56c1c..89b3259fe 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -9,7 +9,7 @@ alias gup='git fetch && git rebase' compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push -gdv() { git-diff -w "$@" | view - } +gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' compdef _git gc=git-commit From 81d94e6c9e3ebe5f0cb094474b1b2f96d2cf567b Mon Sep 17 00:00:00 2001 From: Godwin Ko Date: Wed, 12 Oct 2011 12:16:23 +0800 Subject: [PATCH 089/220] add rails runner alias --- plugins/rails/rails.plugin.zsh | 1 + plugins/rails3/rails3.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index ac8119e83..4aa7a05d6 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -2,6 +2,7 @@ alias ss='thin --stats "/thin/stats" start' alias sg='ruby script/generate' alias sd='ruby script/destroy' alias sp='ruby script/plugin' +alias sr='ruby script/runner' alias ssp='ruby script/spec' alias rdbm='rake db:migrate' alias sc='ruby script/console' diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index f4ee637e6..a817b483f 100644 --- a/plugins/rails3/rails3.plugin.zsh +++ b/plugins/rails3/rails3.plugin.zsh @@ -14,6 +14,7 @@ alias rdb='_rails_command dbconsole' alias rdbm='rake db:migrate db:test:clone' alias rg='_rails_command generate' alias rp='_rails_command plugin' +alias rr='_rails_command runner' alias rs='_rails_command server' alias rsd='_rails_command server --debugger' alias devlog='tail -f log/development.log' From 6095fe4f7157ba444addaf436f9f44e3d491a784 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 14:12:13 +0800 Subject: [PATCH 090/220] add: battery plugin --- plugins/battery/battery.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/battery/battery.plugin.zsh diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh new file mode 100644 index 000000000..bc75c5cf9 --- /dev/null +++ b/plugins/battery/battery.plugin.zsh @@ -0,0 +1,20 @@ +if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" } + function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') } + function battery_pct_prompt() { + b=$(battery_pct_remaining) + if [ $b -gt 50 ] ; then + color='green' + elif [ $b -gt 20 ] ; then + color='yellow' + else + color='red' + fi + echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" + } +else + error_msg='no battery' + function battery_pct_remaining() { echo $error_msg } + function battery_time_remaining() { echo $error_msg } + function battery_pct_prompt() { echo '' } +fi From a5545bd31c76a4f34339dc4e7b87f74fa0174015 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 14:12:56 +0800 Subject: [PATCH 091/220] add: rbenv plugin --- plugins/rbenv/rbenv.plugin.zsh | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/rbenv/rbenv.plugin.zsh diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh new file mode 100644 index 000000000..136ea75e0 --- /dev/null +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -0,0 +1,44 @@ +FOUND_RBENV=0 +for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do + if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then + FOUND_RBENV=1 + export RBENV_ROOT=$rbenvdir + export PATH=${rbenvdir}/bin:$PATH + eval "$(rbenv init -)" + + alias rubies="rbenv versions" + alias gemsets="rbenv gemset list" + + function current_ruby() { + echo "$(rbenv version-name)" + } + + function current_gemset() { + echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a') | head -n1" + } + + function gems { + local rbenv_path=$(rbenv prefix) + gem list $@ | sed \ + -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ + -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ + -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" + } + + function rbenv_prompt_info() { + if [[ -n $(current_gemset) ]] ; then + echo "$(current_ruby)@$(current_gemset)" + else + echo "$(current_ruby)" + fi + } + fi +done +unset rbenvdir + +if [ $FOUND_RBENV -eq 0 ] ; then + alias rubies='ruby -v' + function gemsets() { echo 'not supported' } + function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } +fi From 31cddcd32427a5f5d3daa0da168d39aba5b510b4 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 15:27:49 +0800 Subject: [PATCH 092/220] fix: rbenv: I need to find a proper way to test changes... --- plugins/rbenv/rbenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 136ea75e0..ae37404cd 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -14,7 +14,7 @@ for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do } function current_gemset() { - echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a') | head -n1" + echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" } function gems { From a2afccae194470e71dd256b594964ddfe0e5c221 Mon Sep 17 00:00:00 2001 From: ornicar Date: Tue, 25 Oct 2011 09:53:59 +0200 Subject: [PATCH 093/220] Add yaourt --sucre alias in archlinux plugin --- plugins/archlinux/archlinux.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b5e519036..294dc5354 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then alias yaconf='yaourt -C' # Fix all configuration files with vimdiff # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. + alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation alias yain='yaourt -S' # Install specific package(s) from the repositories alias yains='yaourt -U' # Install specific package not from the repositories but from a file alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies From 0f13387b074aa20b035251ea85e4f8a82eddbfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lache=CC=80ze=20Alexandre?= Date: Wed, 2 Nov 2011 03:55:26 +0100 Subject: [PATCH 094/220] Added completion plugin for jake --- plugins/jake-node/jake-node.plugin.zsh | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plugins/jake-node/jake-node.plugin.zsh diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh new file mode 100644 index 000000000..d629fa4bc --- /dev/null +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -0,0 +1,28 @@ +##-----Autocomplete for Jake tool---- +# Jake : https://github.com/mde/jake +# Warning : Jakefile should have the right cas : Jakefile +# Add a .jake_tasks file to your working directory +# Author : Alexandre Lacheze (@al3xstrat) +# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh + +function _jake_does_task_list_need_generating () { + if [ ! -f .jake_tasks ]; then + return 0; + else + accurate=$(stat -f%m .jake_tasks) + changed=$(stat -f%m Jakefile) + return $(expr $accurate '>=' $changed) + fi +} + +function _jake () { + if [ -f Jakefile ]; then + if _jake_does_task_list_need_generating; then + echo "\nGenerating .jake_tasks..." > /dev/stderr + jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > .jake_tasks + fi + reply=( `cat .jake_tasks` ) + fi +} + +compctl -K _jake jake \ No newline at end of file From a78387cb5d46c98336a8fa0abd72d682f1c00c8b Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 2 Nov 2011 13:29:28 +0100 Subject: [PATCH 095/220] Minor modifications in comment-header --- plugins/jake-node/jake-node.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index d629fa4bc..d365aee9b 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,7 +1,7 @@ -##-----Autocomplete for Jake tool---- +#---oh-my-zsh plugin : take Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake -# Warning : Jakefile should have the right cas : Jakefile -# Add a .jake_tasks file to your working directory +# Warning : Jakefile should have the right case : Jakefile +# Warnign : Add a .jake_tasks file to your working directory # Author : Alexandre Lacheze (@al3xstrat) # Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh From 456993e03be3193056b9a18a809a18414cf9df00 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 2 Nov 2011 13:31:06 +0100 Subject: [PATCH 096/220] minor modifications in comment header (the revenge) --- plugins/jake-node/jake-node.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index d365aee9b..ff9f6b5cf 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,4 +1,4 @@ -#---oh-my-zsh plugin : take Autocomplete for Jake tool--- +#---oh-my-zsh plugin : task Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake # Warning : Jakefile should have the right case : Jakefile # Warnign : Add a .jake_tasks file to your working directory From 452f1213018551f6a388224bbfd1c84ef73b3770 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Mon, 7 Nov 2011 13:42:16 -0500 Subject: [PATCH 097/220] Add apt-history to debian plugin --- plugins/debian/debian.plugin.zsh | 42 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 09771881d..16a5d54ca 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -54,7 +54,7 @@ if [[ $use_sudo -eq 1 ]]; then # apt-get only alias ads="sudo $apt_pref dselect-upgrade" - + # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: # glob_subst @@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i' alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' - - - # Functions ################################################################# # create a simple script that can be used to 'duplicate' a system apt-copy() { @@ -132,11 +129,46 @@ apt-copy() { chmod +x apt-copy.sh } +# Prints apt history +# Usage: +# apt-history install +# apt-history upgrade +# apt-history remove +# apt-history rollback +# apt-history list +# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html +apt-history () { + case "$1" in + install) + zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*) + ;; + upgrade|remove) + zgrep --no-filename $1 $(ls -rt /var/log/dpkg*) + ;; + rollback) + zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \ + grep "$2" -A10000000 | \ + grep "$3" -B10000000 | \ + awk '{print $4"="$5}' + ;; + list) + zcat $(ls -rt /var/log/dpkg*) + ;; + *) + echo "Parameters:" + echo " install - Lists all packages that have been installed." + echo " upgrade - Lists all packages that have been upgraded." + echo " remove - Lists all packages that have been removed." + echo " rollback - Lists rollback information." + echo " list - Lists all contains of dpkg logs." + ;; + esac +} # Kernel-package building shortcut kerndeb () { # temporarily unset MAKEFLAGS ( '-j3' will fail ) - MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) + MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) print '$MAKEFLAGS set to '"'$MAKEFLAGS'" appendage='-custom' # this shows up in $ (uname -r ) revision=$(date +"%Y%m%d") # this shows up in the .deb file name From 419ffdc48d218156b578d46d7fb5c64adcccb3de Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Wed, 9 Nov 2011 14:46:38 +0400 Subject: [PATCH 098/220] Rails Migrations support --- plugins/rails3/rails3.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index f4ee637e6..792cde2bd 100644 --- a/plugins/rails3/rails3.plugin.zsh +++ b/plugins/rails3/rails3.plugin.zsh @@ -17,3 +17,5 @@ alias rp='_rails_command plugin' alias rs='_rails_command server' alias rsd='_rails_command server --debugger' alias devlog='tail -f log/development.log' +alias rdm='rake db:migrate' +alias rdr='rake db:rollback' From 444145b495338ca3fbc86f0956003a1074f845df Mon Sep 17 00:00:00 2001 From: Mario Fernandez Date: Wed, 9 Nov 2011 23:01:45 +0100 Subject: [PATCH 099/220] FIX: commands like ruby and rake where not being completed --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 3c96b8da9..89f62232b 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -41,6 +41,6 @@ for cmd in $bundled_commands; do alias $cmd=bundled_$cmd if which _$cmd > /dev/null 2>&1; then - compdef _$cmd bundled_$cmd + compdef _$cmd bundled_$cmd=$cmd fi done From 40c47a737571468b759bbc30e4b4dc4b5f77470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Tue, 15 Nov 2011 01:14:03 -0500 Subject: [PATCH 100/220] lib/termsupport now uses add-zsh-hook This is needed to play nice with plugins that need various hooks. --- lib/termsupport.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 22e7f372f..221989502 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -4,7 +4,7 @@ #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { [ "$DISABLE_AUTO_TITLE" != "true" ] || return - if [[ "$TERM" == screen* ]]; then + if [[ "$TERM" == screen* ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" #set window name @@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" #Appears when you have the prompt -function precmd { +function omz_termsupport_precmd { title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } #Appears at the beginning of (and during) of command execution -function preexec { +function omz_termsupport_preexec { emulate -L zsh setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd title "$CMD" "%100>...>$2%<<" } + +autoload -U add-zsh-hook +add-zsh-hook precmd omz_termsupport_precmd +add-zsh-hook preexec omz_termsupport_preexec From 5277a0ffaacbc2e23c8753fefdf1c4fe6d1e7685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Tue, 15 Nov 2011 01:20:29 -0500 Subject: [PATCH 101/220] Added add-zsh-hook support to themes I added add-zsh-hook support to the themes that didn't have it already. This allows the themes to co-exist with plugins and lib/termsupport. --- themes/apple.zsh-theme | 7 +++++-- themes/jonathan.zsh-theme | 28 ++++++++++++++++------------ themes/kolo.zsh-theme | 5 ++++- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme index 92f1df941..275341dc6 100644 --- a/themes/apple.zsh-theme +++ b/themes/apple.zsh-theme @@ -2,7 +2,7 @@ function toon { echo -n "" } -get_git_dirty() { +get_git_dirty() { git diff --quiet || echo '*' } @@ -18,9 +18,12 @@ zstyle ':vcs_info:*' formats \ zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' zstyle ':vcs_info:*' enable git cvs svn -precmd () { +theme_precmd () { vcs_info } setopt prompt_subst PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}' + +autoload -U add-zsh-hook +add-zsh-hook precmd theme_precmd \ No newline at end of file diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index add485279..a170a13d0 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -1,19 +1,19 @@ -function precmd { +function theme_precmd { local TERMWIDTH (( TERMWIDTH = ${COLUMNS} - 1 )) ### # Truncate the path if it's too long. - + PR_FILLBAR="" PR_PWDLEN="" - + local promptsize=${#${(%):---(%n@%m:%l)---()--}} local rubyprompt=`rvm_prompt_info` local rubypromptsize=${#${rubyprompt}} local pwdsize=${#${(%):-%~}} - + if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then ((PR_PWDLEN=$TERMWIDTH - $promptsize)) else @@ -24,7 +24,7 @@ function precmd { setopt extended_glob -preexec () { +theme_preexec () { if [[ "$TERM" == "screen" ]]; then local CMD=${1[(wr)^(*=*|sudo|-*)]} echo -n "\ek$CMD\e\\" @@ -69,7 +69,7 @@ setprompt () { ### # See if we can use extended characters to look nicer. - + typeset -A altchar set -A altchar ${(s..)terminfo[acsc]} PR_SET_CHARSET="%{$terminfo[enacs]%}" @@ -81,10 +81,10 @@ setprompt () { PR_LRCORNER=${altchar[j]:--} PR_URCORNER=${altchar[k]:--} - + ### # Decide if we need to set titlebar text. - + case $TERM in xterm*) PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' @@ -96,8 +96,8 @@ setprompt () { PR_TITLEBAR='' ;; esac - - + + ### # Decide whether to set a screen title if [[ "$TERM" == "screen" ]]; then @@ -105,8 +105,8 @@ setprompt () { else PR_STITLE='' fi - - + + ### # Finally, the prompt. @@ -135,3 +135,7 @@ $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR ' } setprompt + +autoload -U add-zsh-hook +add-zsh-hook precmd theme_precmd +add-zsh-hook preexec theme_preexec \ No newline at end of file diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme index 6e04e1595..e743289c3 100644 --- a/themes/kolo.zsh-theme +++ b/themes/kolo.zsh-theme @@ -7,7 +7,7 @@ zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' zstyle ':vcs_info:*' enable git svn -precmd () { +theme_precmd () { if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' } else { @@ -19,3 +19,6 @@ precmd () { setopt prompt_subst PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' + +autoload -U add-zsh-hook +add-zsh-hook precmd theme_precmd From 4173ba1e95403f3d2cd28b0ad5d5f2c0691f86b7 Mon Sep 17 00:00:00 2001 From: Graham McMillan Date: Tue, 15 Nov 2011 13:46:14 -0500 Subject: [PATCH 102/220] Added option to disable the update prompt. Set DISABLE_UPDATE_PROMPT to true to enable. --- tools/check_for_upgrade.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index aeaa0e415..524aa509d 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -8,6 +8,12 @@ function _update_zsh_update() { echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update } +function _upgrade_zsh() { + /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh + # update the zsh file + _update_zsh_update +} + if [ -f ~/.zsh-update ] then . ~/.zsh-update @@ -19,17 +25,21 @@ then epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) if [ $epoch_diff -gt 6 ] then - echo "[Oh My Zsh] Would you like to check for updates?" - echo "Type Y to update oh-my-zsh: \c" - read line - if [ "$line" = Y ] || [ "$line" = y ] + if [ "$DISABLE_UPDATE_PROMPT" = "true" ] then - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh - # update the zsh file - _update_zsh_update + _upgrade_zsh + else + echo "[Oh My Zsh] Would you like to check for updates?" + echo "Type Y to update oh-my-zsh: \c" + read line + if [ "$line" = Y ] || [ "$line" = y ] + then + _upgrade_zsh + fi fi fi else # create the zsh file _update_zsh_update fi + From 7ec2dd984a7605b28fcaed411f33403802bc876a Mon Sep 17 00:00:00 2001 From: Russell Harmon Date: Wed, 16 Nov 2011 04:32:05 -0500 Subject: [PATCH 103/220] Use printf rather than echo -e in update.sh update.sh is an "sh" script, not a zsh or bash script. On platforms which have real sh, echo does not have the -e option. --- tools/upgrade.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 52a8cc4da..6ffe56f4c 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,12 @@ current_path=`pwd` -echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" +printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" ( cd $ZSH && git pull origin master ) -echo -e "\033[0;32m"' __ __ '"\033[0m" -echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo -e "\033[0;32m"' /____/ '"\033[0m" -echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" +printf '\033[0;32m%s\033[0m\n' ' __ __ ' +printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' +printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' +printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' +printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' +printf '\033[0;32m%s\033[0m\n' ' /____/ ' +printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' +printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' cd "$current_path" From 3512eca2cefee9b89b08230021c25f6e30525e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 16 Nov 2011 09:25:45 -0500 Subject: [PATCH 104/220] set fpath correctly for custom plugins Custom plugins weren't being added to the fpath correctly. --- oh-my-zsh.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 891e8d467..8f5e2472d 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -13,9 +13,16 @@ fpath=($ZSH/functions $ZSH/completions $fpath) # TIP: Add files you don't want in git to .gitignore for config_file ($ZSH/lib/*.zsh) source $config_file -# Add all defined plugins to fpath +# Add all defined plugins to fpath. This must be done +# before running compinit. plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +for plugin ($plugins); do + if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then + fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) + elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then + fpath=($ZSH/plugins/$plugin $fpath) + fi +done # Load and run compinit autoload -U compinit From 258457ea4fe0b8fcb1f6d0242071edb82cab449a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 16 Nov 2011 09:46:05 -0500 Subject: [PATCH 105/220] Moved ZSH_CUSTOM declaration before fpath is set * also normalized style to match the guide. --- oh-my-zsh.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 8f5e2472d..7ae41c33e 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -13,6 +13,12 @@ fpath=($ZSH/functions $ZSH/completions $fpath) # TIP: Add files you don't want in git to .gitignore for config_file ($ZSH/lib/*.zsh) source $config_file +# Set ZSH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom/ +if [[ -z "$ZSH_CUSTOM" ]]; then + ZSH_CUSTOM="$ZSH/custom" +fi + # Add all defined plugins to fpath. This must be done # before running compinit. plugin=${plugin:=()} @@ -28,12 +34,6 @@ done autoload -U compinit compinit -i -# Set ZSH_CUSTOM to the path where your custom config files -# and plugins exists, or else we will use the default custom/ -if [ "$ZSH_CUSTOM" = "" ] -then - ZSH_CUSTOM="$ZSH/custom" -fi # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do From 10618f323f2915c2a7281e258a42d05faf1cc1af Mon Sep 17 00:00:00 2001 From: Matt Outten Date: Wed, 16 Nov 2011 11:14:26 -0500 Subject: [PATCH 106/220] Add the --format tag to knife list commands This commit adds the --format tag to all of the autocompletion functions. The default format changed from json to a "human readable" format as of version 0.10. This change should be backward compatible. Alternatively, these commands could be simplified by using the new default human readable format. --- plugins/knife/_knife | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index 7f8c95ee5..f336380a1 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -138,27 +138,27 @@ _knife_options3() { # The chef_x_remote functions use knife to get a list of objects of type x on the server _chef_roles_remote() { - (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_clients_remote() { - (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_nodes_remote() { - (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_cookbooks_remote() { - (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_sitecookbooks_remote() { - (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_data_bags_remote() { - (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server From 2c660c16ad818d4e1f001e392f7e82c7c02cbbc6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 24 Nov 2011 13:51:55 +0100 Subject: [PATCH 107/220] Only alias git=hub if `hub --version` works. `hub` is crashing for me on a old CentOS setup with "undefined method `shelljoin'". On first use of the `git` function it is now checked if `hub --version` returns successfully. --- plugins/github/github.plugin.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 9b0d54602..197e86a48 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,7 +1,17 @@ # Setup hub function for git, if it is available; http://github.com/defunkt/hub if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then # eval `hub alias -s zsh` - function git(){hub "$@"} + function git(){ + if ! (( $+_has_working_hub )); then + hub --version &> /dev/null + _has_working_hub=$(($? == 0)) + fi + if (( $_has_working_hub )) ; then + hub "$@" + else + command git "$@" + fi + } fi # Functions ################################################################# From 5260bfd4eba3787d5d32086b55ed728f3f3ab7f8 Mon Sep 17 00:00:00 2001 From: Gael Pasgrimaud Date: Sun, 27 Nov 2011 15:07:31 +0100 Subject: [PATCH 108/220] allow django-manage completion. http://pypi.python.org/pypi/DjangoDevKit --- plugins/django/django.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh index 1d72a2f2c..0bbd031fe 100644 --- a/plugins/django/django.plugin.zsh +++ b/plugins/django/django.plugin.zsh @@ -220,3 +220,4 @@ _managepy() { compdef _managepy manage.py compdef _managepy django +compdef _managepy django-manage From 31badac2ea2ecdc77cf4c339fcef9472940cb261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lache=CC=80ze=20Alexandre?= Date: Fri, 2 Dec 2011 12:54:04 +0100 Subject: [PATCH 109/220] Jake-node plugin : update - remove the need to write a `jake_tasks` in the directory - use most recent usage of completion with zsh - tested for MacOSX and Ubuntu --- plugins/jake-node/jake-node.plugin.zsh | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index ff9f6b5cf..a9eef4029 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,28 +1,14 @@ #---oh-my-zsh plugin : task Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake -# Warning : Jakefile should have the right case : Jakefile -# Warnign : Add a .jake_tasks file to your working directory +# Warning : Jakefile should have the right case : Jakefile or jakefile +# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10 # Author : Alexandre Lacheze (@al3xstrat) # Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh -function _jake_does_task_list_need_generating () { - if [ ! -f .jake_tasks ]; then - return 0; - else - accurate=$(stat -f%m .jake_tasks) - changed=$(stat -f%m Jakefile) - return $(expr $accurate '>=' $changed) - fi -} - function _jake () { - if [ -f Jakefile ]; then - if _jake_does_task_list_need_generating; then - echo "\nGenerating .jake_tasks..." > /dev/stderr - jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > .jake_tasks - fi - reply=( `cat .jake_tasks` ) + if [ -f Jakefile ]||[ -f jakefile ]; then + compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` fi } -compctl -K _jake jake \ No newline at end of file +compdef _jake jake \ No newline at end of file From 3fc812afc9af75e49a8f99bad3ada41672547503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Gustafsson?= Date: Sat, 3 Dec 2011 13:18:37 +0100 Subject: [PATCH 110/220] Removed duplicate setting and sorted the remaining --- lib/history.zsh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index ca6f57079..876936b87 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history HISTSIZE=10000 SAVEHIST=10000 -setopt hist_ignore_dups # ignore duplication command history list -setopt share_history # share command history data - -setopt hist_verify -setopt inc_append_history +setopt append_history setopt extended_history setopt hist_expire_dups_first +setopt hist_ignore_dups # ignore duplication command history list setopt hist_ignore_space - -setopt SHARE_HISTORY -setopt APPEND_HISTORY +setopt hist_verify +setopt inc_append_history +setopt share_history # share command history data From b16099f3cb9855affa14d0f03adf6563f8df4cbe Mon Sep 17 00:00:00 2001 From: Steven De Coeyer Date: Tue, 6 Dec 2011 15:18:29 +0100 Subject: [PATCH 111/220] Added Zhann theme. Based on Robbyrussel theme, but shows the current ruby version and has some color variations. --- themes/zhann.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/zhann.zsh-theme diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme new file mode 100644 index 000000000..6c056dfbe --- /dev/null +++ b/themes/zhann.zsh-theme @@ -0,0 +1,7 @@ +PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v) %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" From 7c36ef7faa65441f8eec27589f24ba9f18f8d66c Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 6 Dec 2011 13:51:31 -0800 Subject: [PATCH 112/220] Adding critical security patch to let you all know I'm on top of this shit. add 'nyan' to your plugins... then run for security upgrade. --- plugins/nyan/nyan.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/nyan/nyan.plugin.zsh diff --git a/plugins/nyan/nyan.plugin.zsh b/plugins/nyan/nyan.plugin.zsh new file mode 100644 index 000000000..6321e5f5a --- /dev/null +++ b/plugins/nyan/nyan.plugin.zsh @@ -0,0 +1,5 @@ +if [[ -x `which nc` ]]; then + alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat +fi + + From 42b0123427d2bdee0e3221d930bb48038c601932 Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 11:08:42 +0100 Subject: [PATCH 113/220] Added brute force package completin on install subcommand --- plugins/pip/_pip | 60 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index b58010173..8c03d8519 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -3,30 +3,39 @@ # pip zsh completion, based on homebrew completion +_pip_all() { + all_pkgs=(`pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'`) +} + _pip_installed() { - installed_pkgs=(`pip freeze`) + installed_pkgs=(`pip freeze | cut -d '=' -f 1`) } local -a _1st_arguments _1st_arguments=( - 'bundle:Create pybundles (archives containing multiple packages)' - 'freeze:Output all currently installed packages (exact versions) to stdout' - 'help:Show available commands' - 'install:Install packages' - 'search:Search PyPI' - 'uninstall:Uninstall packages' - 'unzip:Unzip individual packages' - 'zip:Zip individual packages' + 'bundle:create pybundles (archives containing multiple packages)' + 'freeze:output all currently installed packages (exact versions) to stdout' + 'help:show available commands' + 'install:install packages' + 'search:search PyPI' + 'uninstall:uninstall packages' + 'unzip:unzip individual packages' + 'zip:zip individual packages' ) local expl -local -a pkgs installed_pkgs +local -a all_pkgs installed_pkgs _arguments \ - '(--version)--version[Show version number of program and exit]' \ - '(-v --verbose)'{-v,--verbose}'[Give more output]' \ - '(-q --quiet)'{-q,--quiet}'[Give less output]' \ - '(-h --help)'{-h,--help}'[Show help]' \ + '(--version)--version[show version number of program and exit]' \ + '(-h --help)'{-h,--help}'[show help]' \ + '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \ + '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \ + '(-v --verbose)'{-v,--verbose}'[give more output]' \ + '(-q --quiet)'{-q,--quiet}'[give less output]' \ + '(--log)--log[log file location]' \ + '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \ + '(--timeout)--timeout[socket timeout (default 15s)]' \ '*:: :->subcmds' && return 0 if (( CURRENT == 1 )); then @@ -35,10 +44,25 @@ if (( CURRENT == 1 )); then fi case "$words[1]" in - list) - if [[ "$state" == forms ]]; then - _pip_installed - _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs + search) + _arguments \ + '(--index)--index[base URL of Python Package Index]' ;; + freeze) + _arguments \ + '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;; + install) + _arguments \ + '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ + '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ + '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \ + '(--no-install)--no-install[only download packages]' \ + '(--no-download)--no-download[only install downloaded packages]' \ + '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \ + '1: :->packages' && return 0 + + if [[ "$state" == packages ]]; then + _pip_all + _wanted all_pkgs expl 'packages' compadd -a all_pkgs fi ;; uninstall) _pip_installed From 1c4997f5cada6f1ff1f205b20cf321cfc6b6d347 Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 13:32:58 +0100 Subject: [PATCH 114/220] Added caching of packages --- plugins/pip/_pip | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 8c03d8519..07d37c80e 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -4,7 +4,10 @@ # pip zsh completion, based on homebrew completion _pip_all() { - all_pkgs=(`pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'`) + # we cache the list of packages (originally from the macports plugin) + if (( ! $+piplist )); then + piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]')) + fi } _pip_installed() { @@ -62,7 +65,7 @@ case "$words[1]" in if [[ "$state" == packages ]]; then _pip_all - _wanted all_pkgs expl 'packages' compadd -a all_pkgs + _wanted piplist expl 'packages' compadd -a piplist fi ;; uninstall) _pip_installed From 5eae9421883d71b954d4abaa6056b28874ad47ec Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 14:09:43 +0100 Subject: [PATCH 115/220] Added message when caching packages --- plugins/pip/_pip | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 07d37c80e..df53ba5ce 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -6,6 +6,7 @@ _pip_all() { # we cache the list of packages (originally from the macports plugin) if (( ! $+piplist )); then + echo -n " (caching package index...)" piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]')) fi } From d25fb095a9d1f814fe2b4d0f42ffe827780d4a59 Mon Sep 17 00:00:00 2001 From: Dominick LoBraico Date: Fri, 9 Dec 2011 12:18:54 -0600 Subject: [PATCH 116/220] forks miloshadzic theme to add more directory info as well as user and host info --- themes/pygmalion.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 themes/pygmalion.zsh-theme diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme new file mode 100644 index 000000000..cf3bb908f --- /dev/null +++ b/themes/pygmalion.zsh-theme @@ -0,0 +1,9 @@ +# Yay! High voltage and arrows! + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' + From 8ca019f02a4dc718fe5fc8b1186108eb376360c9 Mon Sep 17 00:00:00 2001 From: Suvash Thapaliya Date: Mon, 12 Dec 2011 23:55:07 +0100 Subject: [PATCH 117/220] Added my own theme file : suvash Since I store my dotfiles on github and plan to submodule oh-my-zsh i supposed it was a good idea to submit my theme as well. --- themes/suvash.zsh-theme | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 themes/suvash.zsh-theme diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme new file mode 100644 index 000000000..f50657db2 --- /dev/null +++ b/themes/suvash.zsh-theme @@ -0,0 +1,23 @@ +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + hg root >/dev/null 2>/dev/null && echo 'Hg' && return + echo '○' +} + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function collapse_pwd { + echo $(pwd | sed -e "s,^$HOME,~,") +} + +PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} +$(virtualenv_info)$(prompt_char) ' + + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 3e7e52a25fbfdb57f291ee9575a606f845dbff57 Mon Sep 17 00:00:00 2001 From: Christoph Neuroth Date: Wed, 14 Dec 2011 11:47:24 +0100 Subject: [PATCH 118/220] add support for autojump installed via macports --- plugins/autojump/autojump.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index da0a12765..6f9b80bff 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,3 +1,5 @@ -if [ -f `brew --prefix`/etc/autojump ]; then +if [ -f /opt/local/etc/profile.d/autojump.sh ]; then + . /opt/local/etc/profile.d/autojump.sh +elif [ -f `brew --prefix`/etc/autojump ]; then . `brew --prefix`/etc/autojump fi From 1a49f6443c0230b8e182294546ed9ef2a5110bf2 Mon Sep 17 00:00:00 2001 From: Matt Parnell Date: Sat, 12 Nov 2011 21:09:27 -0800 Subject: [PATCH 119/220] add sprunge.us pastebin uploader - uses files, or pipes --- plugins/sprunge/sprunge.plugin.zsh | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/sprunge/sprunge.plugin.zsh diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh new file mode 100644 index 000000000..9f9432ac8 --- /dev/null +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -0,0 +1,64 @@ +# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf +# Created by the blogger at the URL below...I don't know where to find his/her name +# Original found at http://www.shellperson.net/sprunge-pastebin-script/ + +usage() { +description | fmt -s >&2 +} + +description() { +cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 text string + $0 < filename.txt + piped_data | $0 + +NOTES +-------------------------------------------------------------------------- +* INPUT METHODS * +$0 can accept piped data, STDIN redirection [&2 + if [ "$*" ]; then + echo Arguments present... >&2 + if [ -f "$*" ]; then + echo Uploading the contents of "$*"... >&2 + cat "$*" + else + echo Uploading the text: \""$*"\"... >&2 + echo "$*" + fi | curl -F 'sprunge=<-' http://sprunge.us + else + echo No arguments found, printing USAGE and exiting. >&2 + usage + fi + else + echo Using input from a pipe or STDIN redirection... >&2 + while read -r line ; do + echo $line + done | curl -F 'sprunge=<-' http://sprunge.us + fi +} From 03424fdadba13fea2297a94144e989926cabdcb3 Mon Sep 17 00:00:00 2001 From: Andrew Tch Date: Sun, 18 Dec 2011 00:23:31 +0200 Subject: [PATCH 120/220] Symfony 2 completion --- plugins/symfony2/symfony2.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/symfony2/symfony2.plugin.zsh diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh new file mode 100644 index 000000000..644266841 --- /dev/null +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -0,0 +1,13 @@ +# Symfony2 basic command completion + +_symfony2_get_command_list () { + app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' +} + +_symfony2 () { + if [ -f app/console ]; then + compadd `_symfony2_get_command_list` + fi +} + +compdef _symfony2 app/console \ No newline at end of file From 1ced49b85a859b399728ce32ef77399874f5172b Mon Sep 17 00:00:00 2001 From: Cameron Johnston Date: Sun, 18 Dec 2011 22:15:00 -0700 Subject: [PATCH 121/220] adding support for chef environments in knife plugin --- plugins/knife/_knife | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index 7f8c95ee5..32ff9fc99 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -26,7 +26,7 @@ _knife() { case $state in knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders + compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders ;; knifesubcmd) case $words[2] in @@ -42,6 +42,9 @@ _knife() { cookbook) compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload ;; + environment) + compadd -Q "$@" list create delete edit show "from file" + ;; node) compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" ;; @@ -161,6 +164,10 @@ _chef_data_bags_remote() { (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } +_chef_environments_remote() { + (knife environment list | awk '{print $1}') +} + # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server _chef_cookbooks_local() { (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done) From a62d22726be1c3a02405bf327449e605be8fc5b2 Mon Sep 17 00:00:00 2001 From: Steven De Coeyer Date: Mon, 19 Dec 2011 15:26:37 +0100 Subject: [PATCH 122/220] show gemset next to ruby version --- themes/zhann.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme index 6c056dfbe..3dff29c9c 100644 --- a/themes/zhann.zsh-theme +++ b/themes/zhann.zsh-theme @@ -1,5 +1,5 @@ PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v) %{$reset_color%}' +RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From a21dc477c26ce29c839ca3aa36af91efcad179ea Mon Sep 17 00:00:00 2001 From: Trevor Wennblom Date: Tue, 20 Dec 2011 16:16:02 -0600 Subject: [PATCH 123/220] add note about custom plugins --- templates/zshrc.zsh-template | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..64b1ece69 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -23,6 +23,7 @@ ZSH_THEME="robbyrussell" # 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=(git) From dd14e075b7dd39906e2075ac6dd8f5bcc66b6129 Mon Sep 17 00:00:00 2001 From: "julien@macbook" Date: Wed, 21 Dec 2011 15:03:55 +0100 Subject: [PATCH 124/220] Ignore submodules dirty in prompt info --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index f04343650..defa062c6 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -6,7 +6,7 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { - if [[ -n $(git status -s 2> /dev/null) ]]; then + if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" From d8521693f4e2c140391065e7b721d7452134259f Mon Sep 17 00:00:00 2001 From: Kyle Smith Date: Thu, 22 Dec 2011 14:02:01 -0500 Subject: [PATCH 125/220] Added support for entries in /etc/ssh/ssh_known_hosts. --- lib/completion.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc91822..0e5d480ff 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -32,9 +32,11 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir cdpath=(.) # use /etc/hosts and known_hosts for hostname completion +[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$( Date: Fri, 23 Dec 2011 11:14:22 +0400 Subject: [PATCH 126/220] Added alias gcm='git checkout master --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 183c56c1c..c1b382b2c 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -17,6 +17,7 @@ alias gca='git commit -v -a' compdef _git gca=git-commit alias gco='git checkout' compdef _git gco=git-checkout +alias gcm='git checkout master' alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' From 0b583638ae7bc58928b77669919600e27f4738b0 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 11 Dec 2011 20:27:35 +0530 Subject: [PATCH 127/220] Fix upgrade and uninstall functions to pick up $ZSH value --- lib/functions.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index ef7cc6383..d2dcadd0c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -3,11 +3,11 @@ function zsh_stats() { } function uninstall_oh_my_zsh() { - /bin/sh $ZSH/tools/uninstall.sh + /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh } function upgrade_oh_my_zsh() { - /bin/sh $ZSH/tools/upgrade.sh + /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh } function take() { From 59baf390e96751fc51299ecefe921ba8718ba3aa Mon Sep 17 00:00:00 2001 From: Tate Johnson Date: Mon, 26 Dec 2011 13:16:26 +1000 Subject: [PATCH 128/220] Black on white theme inspired by Sam Stephenson's terminal screenshot on https://github.com/sstephenson/rbenv --- themes/sammy.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/sammy.zsh-theme diff --git a/themes/sammy.zsh-theme b/themes/sammy.zsh-theme new file mode 100644 index 000000000..52e6e4bb6 --- /dev/null +++ b/themes/sammy.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="*)" +ZSH_THEME_GIT_PROMPT_CLEAN=")" From f999fd8e121c1fd4d097c25be59c6020e1aed830 Mon Sep 17 00:00:00 2001 From: Michael Holachek Date: Mon, 26 Dec 2011 12:20:02 -0500 Subject: [PATCH 129/220] Added example aliases in ZSH template. Added a new theme. Example aliases allow for an easier way to open ZSH config file/folder in Textmate. New theme is mh.zsh-theme. --- templates/zshrc.zsh-template | 4 ++++ themes/mh.zsh-theme | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 themes/mh.zsh-theme diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..25cf4f233 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -7,6 +7,10 @@ ZSH=$HOME/.oh-my-zsh # time that oh-my-zsh is loaded. ZSH_THEME="robbyrussell" +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme new file mode 100644 index 000000000..34a3765b1 --- /dev/null +++ b/themes/mh.zsh-theme @@ -0,0 +1,24 @@ +# mh theme +# preview: http://cl.ly/1y2x0W0E3t2C0F29043z + +# features: +# path is autoshortened to ~30 characters +# displays git status (if applicable in current folder) +# turns username green if superuser, otherwise it is white + +# if superuser make the username green +if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi + +# prompt +PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) ' +RPROMPT='$(git_prompt_info)' + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B" +ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱" + +# LS colors, made with http://geoff.greer.fm/lscolors/ +export LSCOLORS="Gxfxcxdxbxegedabagacad" +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' From 480d1247b89ae089564eb0ca7d66aef989b9f5e5 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 26 Dec 2011 10:15:35 -0800 Subject: [PATCH 130/220] Updating installation documentation to show a curl example as well for those who don't have wget installed. --- README.textile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.textile b/README.textile index 2dbfbe5a6..eca968089 100644 --- a/README.textile +++ b/README.textile @@ -8,6 +8,14 @@ h2. Setup h3. The automatic installer... (do you trust me?) +You can install this via the command line with either `curl` or `wget`. + +h4. via `curl` + +@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@ + +h4. via `wget` + @wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ h3. The manual way From e43dd05a6a731462c6124598ce2e4d1a9d3a5160 Mon Sep 17 00:00:00 2001 From: Michael Andersen Date: Thu, 29 Dec 2011 01:30:43 +0100 Subject: [PATCH 131/220] Mortal Scumbag Theme --- themes/mortalscumbag.zsh-theme | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 themes/mortalscumbag.zsh-theme diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme new file mode 100644 index 000000000..7e25b149f --- /dev/null +++ b/themes/mortalscumbag.zsh-theme @@ -0,0 +1,58 @@ +function my_git_prompt() { + tester=$(git rev-parse --git-dir 2> /dev/null) || return + + INDEX=$(git status --porcelain 2> /dev/null) + STATUS="" + + # is branch ahead? + if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" + fi + + # is anything staged? + if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" + fi + + # is anything unstaged? + if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" + fi + + # is anything untracked? + if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" + fi + + # is anything unmerged? + if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" + fi + + if [[ -n $STATUS ]]; then + STATUS=" $STATUS" + fi + + echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(my_current_branch)$STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +function my_current_branch() { + echo $(current_branch || echo "(no branch)") +} + +function ssh_connection() { + if [[ -n $SSH_CONNECTION ]]; then + echo "%{$fg_bold[red]%}(ssh) " + fi +} + +PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n%# ' + +ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" +ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" +ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑" +ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●" +ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}✕" +ZSH_THEME_GIT_PROMPT_SUFFIX=" $fg_bold[white]›%{$reset_color%}" From 967e84ebaa180ad2ab1eebc9a512f94d93e84aea Mon Sep 17 00:00:00 2001 From: Andreas Steinel Date: Thu, 29 Dec 2011 02:22:40 +0100 Subject: [PATCH 132/220] multiple versions could occur and should also be highlighted --- plugins/rvm/rvm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 24621fe0b..604c00713 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -37,7 +37,7 @@ function gems { local current_gemset=`rvm-prompt g` gem list $@ | sed \ - -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" From 2176cf37fb1eed028c53a2095098d585489b1cce Mon Sep 17 00:00:00 2001 From: Simon Jefford Date: Thu, 29 Dec 2011 21:54:19 +0000 Subject: [PATCH 133/220] bundler plugin - don't "bundle exec rails" As per http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 89f62232b..7b73c8fed 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -10,7 +10,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From cb501645d70ad1e50b6b3d3553618e585074533f Mon Sep 17 00:00:00 2001 From: Gustavo Barron Date: Fri, 30 Dec 2011 12:11:41 -0600 Subject: [PATCH 134/220] Get the Hostname Main library should use ZSH native hostname function --- lib/completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 0e5d480ff..b964595ed 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -39,7 +39,7 @@ hosts=( "$_global_ssh_hosts[@]" "$_ssh_hosts[@]" "$_etc_hosts[@]" - `hostname` + "$HOST" localhost ) zstyle ':completion:*:hosts' hosts $hosts From a49fcea9f5d281cccce2ad421db253455a248109 Mon Sep 17 00:00:00 2001 From: Patrick Lindborg Date: Mon, 2 Jan 2012 21:48:19 +0100 Subject: [PATCH 135/220] Fixed the rfind command in the ruby plugin --- plugins/ruby/ruby.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh index 08ca9c601..38e4d7cd0 100644 --- a/plugins/ruby/ruby.plugin.zsh +++ b/plugins/ruby/ruby.plugin.zsh @@ -3,4 +3,4 @@ alias sgem='sudo gem' # Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' +alias rfind='find . -name "*.rb" | xargs grep -n' From 955825b1e9e484e4b6811a6ba8895924c1834493 Mon Sep 17 00:00:00 2001 From: Calogero Lo Leggio Date: Tue, 3 Jan 2012 18:03:53 +0100 Subject: [PATCH 136/220] autojump plugin enhanced --- plugins/autojump/autojump.plugin.zsh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 6f9b80bff..72c416a17 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,5 +1,9 @@ -if [ -f /opt/local/etc/profile.d/autojump.sh ]; then - . /opt/local/etc/profile.d/autojump.sh -elif [ -f `brew --prefix`/etc/autojump ]; then - . `brew --prefix`/etc/autojump +if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package + . /usr/share/autojump/autojump.zsh +elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation + . /etc/profile.d/autojump.zsh +elif (`command -v brew >/dev/null`); then # mac os x with brew + if [ -f `brew --prefix`/etc/autojump ]; then + . `brew --prefix`/etc/autojump + fi fi From a28b8889ee80856b65dd792dedd7735a1b94443c Mon Sep 17 00:00:00 2001 From: Alexander Madyankin Date: Thu, 5 Jan 2012 11:16:17 +0600 Subject: [PATCH 137/220] Apple Terminal.app resume directory plugin --- plugins/terminalapp/terminalapp.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/terminalapp/terminalapp.plugin.zsh diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh new file mode 100644 index 000000000..4695ad055 --- /dev/null +++ b/plugins/terminalapp/terminalapp.plugin.zsh @@ -0,0 +1,11 @@ +# Set Apple Terminal.app resume directory +# based on this answer: http://superuser.com/a/315029 + +function chpwd { + local SEARCH=' ' + local REPLACE='%20' + local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" + printf '\e]7;%s\a' "$PWD_URL" +} + +chpwd \ No newline at end of file From 9ac98f6ceb77df71c98558a122bc06f8adadf989 Mon Sep 17 00:00:00 2001 From: Chad Seeger Date: Thu, 5 Jan 2012 13:41:27 -0800 Subject: [PATCH 138/220] Git Plugin: adds 'grhh' alias for 'git reset HEAD --hard' --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index c1b382b2c..ec98d4ad5 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -36,6 +36,8 @@ alias ga='git add' compdef _git ga=git-add alias gm='git merge' compdef _git gm=git-merge +alias grhh='git reset HEAD --hard' +compdef _git grhh=git-reset-head-hard # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 804c18ca53e832f20869a7681143464382e8a2df Mon Sep 17 00:00:00 2001 From: Mark Drago Date: Thu, 5 Jan 2012 17:39:13 -0500 Subject: [PATCH 139/220] remove the -v flag from a few mercurial aliases The -v flag for these commands really isn't very useful. It will output some information about the hooks it is running, but that is generally not useful and just noisy. The desire to add -v to these commands is exceptional and IMHO it's better to make the common case of not seeing those messages the supported behavior. --- plugins/mercurial/mercurial.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index 2988f0a46..caf0d9efc 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -1,14 +1,14 @@ # Mercurial -alias hgc='hg commit -v' -alias hgb='hg branch -v' +alias hgc='hg commit' +alias hgb='hg branch' alias hgba='hg branches' alias hgco='hg checkout' alias hgd='hg diff' alias hged='hg diffmerge' # pull and update -alias hgl='hg pull -u -v' -alias hgp='hg push -v' -alias hgs='hg status -v' +alias hgl='hg pull -u' +alias hgp='hg push' +alias hgs='hg status' # this is the 'git commit --amend' equivalent alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' From 7a361870a97d9d34158542503f942fb0c67accfc Mon Sep 17 00:00:00 2001 From: lucapette Date: Fri, 6 Jan 2012 22:10:57 +0100 Subject: [PATCH 140/220] add annotate --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 7b73c8fed..55564a252 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -10,7 +10,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From ae735335e186447b370d299376970a7ea949b474 Mon Sep 17 00:00:00 2001 From: Chad Seeger Date: Mon, 9 Jan 2012 15:19:19 -0800 Subject: [PATCH 141/220] Kill the compdef; Introduce 'grh' alias for 'git reset HEAD' --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index ec98d4ad5..ae080662f 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -36,8 +36,8 @@ alias ga='git add' compdef _git ga=git-add alias gm='git merge' compdef _git gm=git-merge +alias grh='git reset HEAD' alias grhh='git reset HEAD --hard' -compdef _git grhh=git-reset-head-hard # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 5809a4721dd1b575c1f4cbc3cc361520e97cd8b9 Mon Sep 17 00:00:00 2001 From: Calogero Lo Leggio Date: Tue, 10 Jan 2012 10:01:16 +0100 Subject: [PATCH 142/220] check if autojump is installed --- plugins/autojump/autojump.plugin.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 72c416a17..6f0edb062 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,9 +1,9 @@ -if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package - . /usr/share/autojump/autojump.zsh -elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation - . /etc/profile.d/autojump.zsh -elif (`command -v brew >/dev/null`); then # mac os x with brew - if [ -f `brew --prefix`/etc/autojump ]; then +if [ $commands[autojump] ]; then # check if autojump is installed + if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package + . /usr/share/autojump/autojump.zsh + elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation + . /etc/profile.d/autojump.zsh + elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew . `brew --prefix`/etc/autojump fi fi From c04b4abe91b69c058bde8e5968abb759b9168b88 Mon Sep 17 00:00:00 2001 From: Daniel Bye Date: Fri, 13 Jan 2012 12:40:59 +0000 Subject: [PATCH 143/220] Removed calls to compinit in the extract and the bundler plugins. compinit should only be called once, after all modules, libs, etc are imported. --- plugins/bundler/bundler.plugin.zsh | 2 -- plugins/extract/extract.plugin.zsh | 2 -- 2 files changed, 4 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 55564a252..e120331ff 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,6 +1,4 @@ fpath=($ZSH/plugins/bundler $fpath) -autoload -U compinit -compinit -i alias be="bundle exec" alias bi="bundle install" diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 8cc17f7d4..383331ccf 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -80,6 +80,4 @@ alias x=extract # add extract completion function to path fpath=($ZSH/plugins/extract $fpath) -autoload -U compinit -compinit -i From 0d99759cc371d7b8f70cde950f42cc3558559533 Mon Sep 17 00:00:00 2001 From: backspace Date: Sun, 15 Jan 2012 08:49:52 +0200 Subject: [PATCH 144/220] =?UTF-8?q?Don=E2=80=99t=20report=20that=20Oh=20My?= =?UTF-8?q?=20Zsh=20has=20been=20updated=20when=20it=20hasn=E2=80=99t.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/upgrade.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 6ffe56f4c..b2a1c06c4 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,19 @@ current_path=`pwd` printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" -( cd $ZSH && git pull origin master ) -printf '\033[0;32m%s\033[0m\n' ' __ __ ' -printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' -printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' -printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' -printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' -printf '\033[0;32m%s\033[0m\n' ' /____/ ' -printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' -printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' -cd "$current_path" +cd $ZSH + +if git pull origin master +then + printf '\033[0;32m%s\033[0m\n' ' __ __ ' + printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' + printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' + printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' + printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' + printf '\033[0;32m%s\033[0m\n' ' /____/ ' + printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' + printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' +else + printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' +fi + +cd "$current_path" \ No newline at end of file From b73f95ab260f49bf6baa484faa40591c51629c02 Mon Sep 17 00:00:00 2001 From: Daniel Bye Date: Mon, 16 Jan 2012 13:34:07 +0000 Subject: [PATCH 145/220] Removed the assignments to fpath as well, since that's all handled in the .oh-my-zsh/oh-my-zsh.sh boot script. --- plugins/bundler/bundler.plugin.zsh | 2 -- plugins/extract/extract.plugin.zsh | 3 --- 2 files changed, 5 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index e120331ff..b473d203c 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,5 +1,3 @@ -fpath=($ZSH/plugins/bundler $fpath) - alias be="bundle exec" alias bi="bundle install" alias bl="bundle list" diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 383331ccf..5c125e98b 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -78,6 +78,3 @@ function extract() { alias x=extract -# add extract completion function to path -fpath=($ZSH/plugins/extract $fpath) - From 73c2c8adc77568abdf2c7be1761c5cac6f06ad06 Mon Sep 17 00:00:00 2001 From: Nicolas Cavigneaux Date: Mon, 16 Jan 2012 15:19:36 +0100 Subject: [PATCH 146/220] Add Thor to bundled commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 55564a252..033f9cedf 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -10,7 +10,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 4b3429d765f1f14f7dbf2cc451e3047388978bf6 Mon Sep 17 00:00:00 2001 From: Arbo von Monkiewitsch Date: Mon, 16 Jan 2012 18:21:27 +0100 Subject: [PATCH 147/220] fixing #812: adding plugins w/o plugin.zsh file to fpath. --- oh-my-zsh.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index aeeaa3daf..732a403b7 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -19,13 +19,19 @@ if [[ -z "$ZSH_CUSTOM" ]]; then ZSH_CUSTOM="$ZSH/custom" fi + +is_plugin() { + local base_dir=$1 + local name=$2 + test -f $base_dir/plugins/$name/$name.plugin.zsh \ + || test -f $base_dir/plugins/$name/_$name +} # Add all defined plugins to fpath. This must be done # before running compinit. -plugin=${plugin:=()} for plugin ($plugins); do - if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then + if is_plugin $ZSH_CUSTOM $plugin; then fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) - elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then + elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) fi done From 96265d26454868b8b654e4a5271939748e1dd148 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 17 Jan 2012 10:00:12 -0800 Subject: [PATCH 148/220] fix bundler plugin for root level folders this fix allows _within-bundled-project() to properly pickup a Gemfile within a root level folder (ie. /my_project) --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 033f9cedf..b8f8ed3da 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -20,7 +20,7 @@ _bundler-installed() { _within-bundled-project() { local check_dir=$PWD - while [ "$(dirname $check_dir)" != "/" ]; do + while [ $check_dir != "/" ]; do [ -f "$check_dir/Gemfile" ] && return check_dir="$(dirname $check_dir)" done From 8f1a5d3f1581c80510728143e146143deecaa61e Mon Sep 17 00:00:00 2001 From: max sharples Date: Tue, 17 Jan 2012 13:11:01 +1100 Subject: [PATCH 149/220] added a rake plugin to disable zsh file globbing when calling rake tasks with square brackets --- plugins/rake/rake.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/rake/rake.plugin.zsh diff --git a/plugins/rake/rake.plugin.zsh b/plugins/rake/rake.plugin.zsh new file mode 100644 index 000000000..16b933c14 --- /dev/null +++ b/plugins/rake/rake.plugin.zsh @@ -0,0 +1,6 @@ +alias rake="noglob rake" # allows square brackts for rake task invocation +alias brake='noglob bundle exec rake' # execute the bundled rake gem +alias srake='noglob sudo rake' # noglob must come before sudo +alias sbrake='noglob sudo bundle exec rake' # altogether now ... + + From 741f6747e418229deec62ae2d19c776f6494e219 Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 12:52:27 -0500 Subject: [PATCH 150/220] fix for pow plugin to default to current dir --- plugins/pow/pow.plugin.zsh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 6b2a6f2be..da94b657b 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -1,10 +1,25 @@ -# Thanks to Christopher Sexton +# Restart a rack app running under pow +# http://pow.cx/ +# +# Adds a kapow command that will restart an app +# +# $ kapow myapp +# $ kapow # defaults to current directory +# +# Supports command completion. +# +# If you are not already using completion you might need to enable it with +# +# autoload -U compinit compinit +# +# Thanks also to Christopher Sexton # https://gist.github.com/965032 +# function kapow { - touch ~/.pow/$1/tmp/restart.txt - if [ $? -eq 0 ]; then - echo "$fg[yellow]Pow restarting $1...$reset_color" - fi + FOLDERNAME=$1 + if [ -z "$FOLDERNAME" ]; then; FOLDERNAME=${PWD##*/}; fi + touch ~/.pow/$FOLDERNAME/tmp/restart.txt; + if [ $? -eq 0 ]; then; echo "pow: restarting $FOLDERNAME" ; fi } compctl -W ~/.pow -/ kapow From c1a04eb61fcdd740bef52cd9da75fd72aeac3cf4 Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 12:58:13 -0500 Subject: [PATCH 151/220] take in csexton's changes https://gist.github.com/1019777/70dbb46db9bd5b346faf543a9dd4edac4782adda --- plugins/pow/pow.plugin.zsh | 45 +++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index da94b657b..08e5cf62f 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -4,7 +4,6 @@ # Adds a kapow command that will restart an app # # $ kapow myapp -# $ kapow # defaults to current directory # # Supports command completion. # @@ -12,14 +11,40 @@ # # autoload -U compinit compinit # -# Thanks also to Christopher Sexton -# https://gist.github.com/965032 +# Changes: # -function kapow { - FOLDERNAME=$1 - if [ -z "$FOLDERNAME" ]; then; FOLDERNAME=${PWD##*/}; fi - touch ~/.pow/$FOLDERNAME/tmp/restart.txt; - if [ $? -eq 0 ]; then; echo "pow: restarting $FOLDERNAME" ; fi -} +# Defaults to the current application, and will walk up the tree to find +# a config.ru file and restart the corresponding app +# +# Will Detect if a app does not exist in pow and print a (slightly) helpful +# error message -compctl -W ~/.pow -/ kapow +rack_root_detect(){ + setopt chaselinks + local orgdir=$(pwd) + local basedir=$(pwd) + + while [[ $basedir != '/' ]]; do + test -e "$basedir/config.ru" && break + builtin cd ".." 2>/dev/null + basedir="$(pwd)" + done + + builtin cd $orgdir 2>/dev/null + [[ ${basedir} == "/" ]] && return 1 + echo `basename $basedir | sed -E "s/.(com|net|org)//"` +} +kapow(){ + local vhost=$1 + [ ! -n "$vhost" ] && vhost=$(rack_root_detect) + if [ ! -h ~/.pow/$vhost ] + then + echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first." + return 1 + fi + + [ ! -d "~/.pow/${vhost}/tmp" ] && mkdir -p "~/.pow/$vhost/tmp" + touch ~/.pow/$vhost/tmp/restart.txt; + [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" +} +compctl -W ~/.pow -/ kapow \ No newline at end of file From 36cd5ed1a59394827d6e9d38eca33b614790ded3 Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 14:18:09 -0500 Subject: [PATCH 152/220] add alias to view the standard out (puts) from any pow app --- plugins/pow/pow.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 08e5cf62f..5ab55ff1f 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -47,4 +47,7 @@ kapow(){ touch ~/.pow/$vhost/tmp/restart.txt; [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" } -compctl -W ~/.pow -/ kapow \ No newline at end of file +compctl -W ~/.pow -/ kapow + +# View the standard out (puts) from any pow app +alias kaput="tail -f ~/Library/Logs/Pow/apps/*" \ No newline at end of file From 3841da15d02e6d36310b9cc1ebd62502d0bf2135 Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 18:07:31 -0500 Subject: [PATCH 153/220] don't check for tmp dir --- plugins/pow/pow.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 5ab55ff1f..0fbcf8c7b 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -43,7 +43,7 @@ kapow(){ return 1 fi - [ ! -d "~/.pow/${vhost}/tmp" ] && mkdir -p "~/.pow/$vhost/tmp" + # [ ! -d "~/.pow/${vhost}/tmp" ] && mkdir -p "~/.pow/$vhost/tmp" touch ~/.pow/$vhost/tmp/restart.txt; [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" } From f9b4356e0ed9e95890ce79c982dd5481ba7803aa Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 18:36:11 -0500 Subject: [PATCH 154/220] bug : stop creating those ~ directories add powit command to symlink an app if it hasn't been already --- plugins/pow/pow.plugin.zsh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 0fbcf8c7b..399a54cb0 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -34,6 +34,7 @@ rack_root_detect(){ [[ ${basedir} == "/" ]] && return 1 echo `basename $basedir | sed -E "s/.(com|net|org)//"` } + kapow(){ local vhost=$1 [ ! -n "$vhost" ] && vhost=$(rack_root_detect) @@ -43,11 +44,23 @@ kapow(){ return 1 fi - # [ ! -d "~/.pow/${vhost}/tmp" ] && mkdir -p "~/.pow/$vhost/tmp" + [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp touch ~/.pow/$vhost/tmp/restart.txt; [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" } compctl -W ~/.pow -/ kapow +powit(){ + local basedir=$(pwd) + local vhost=$1 + [ ! -n "$vhost" ] && vhost=$(rack_root_detect) + if [ ! -h ~/.pow/$vhost ] + then + echo "pow: Symlinking your app with pow. ${vhost}" + [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost + return 1 + fi +} + # View the standard out (puts) from any pow app -alias kaput="tail -f ~/Library/Logs/Pow/apps/*" \ No newline at end of file +alias kaput="tail -f ~/Library/Logs/Pow/apps/*" From 5f95d018e89e886615c82bc180e7e70457188c9b Mon Sep 17 00:00:00 2001 From: lepht Date: Wed, 18 Jan 2012 20:29:31 -0500 Subject: [PATCH 155/220] Updated to latest version of taskwarrior completions (using Taskwarrior 2.0b4) --- plugins/taskwarrior/_task | 160 +++++++++++++++----------------------- 1 file changed, 64 insertions(+), 96 deletions(-) diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task index 5bffa9119..0bda738bb 100644 --- a/plugins/taskwarrior/_task +++ b/plugins/taskwarrior/_task @@ -1,37 +1,37 @@ #compdef task -# # zsh completion for taskwarrior # +# taskwarrior - a command line task list manager. +# # Copyright 2010 - 2011 Johannes Schlatow # Copyright 2009 P.C. Shyamshankar -# All rights reserved. # -# This script is part of the taskwarrior project. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. # -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the -# -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, -# Boston, MA -# 02110-1301 -# USA +# http://www.opensource.org/licenses/mit-license.php # typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers _task_projects=($(task _projects)) _task_tags=($(task _tags)) _task_ids=($(task _ids)) _task_config=($(task _config)) +_task_columns=($(task _columns)) _task_modifiers=( 'before' \ 'after' \ @@ -46,39 +46,19 @@ _task_modifiers=( 'word' \ 'noword' ) +_task_conjunctions=( + 'and' \ + 'or' \ + 'xor' \ + '\)' + '\(' +) _task_cmds=($(task _commands)) _task_zshcmds=( ${(f)"$(task _zshcommands)"} ) - -_task_idCmds=( - 'append' \ - 'prepend' \ - 'annotate' \ - 'denotate' \ - 'edit' \ - 'duplicate' \ - 'info' \ - 'start' \ - 'stop' \ - 'done' -) - -_task_idCmdsDesc=( - 'append:Appends more description to an existing task.' \ - 'prepend:Prepends more description to an existing task.' \ - 'annotate:Adds an annotation to an existing task.' \ - 'denotate:Deletes an annotation of an existing task.' \ - 'edit:Launches an editor to let you modify a task directly.' \ - 'duplicate:Duplicates the specified task, and allows modifications.' \ - 'info:Shows all data, metadata for specified task.' \ - 'start:Marks specified task as started.' \ - 'stop:Removes the start time from a task.' \ - 'done:Marks the specified task as completed.' -) - _task() { _arguments -s -S \ - "*::task command:_task_commands" + "*::task default:_task_default" return 0 } @@ -148,6 +128,7 @@ _regex_words values 'task frequencies' \ 'weekly:Every week' \ 'biweekly:Every two weeks' \ 'fortnight:Every two weeks' \ ++ 'monthly:Every month' \ 'quarterly:Every three months' \ 'semiannual:Every six months' \ 'annual:Every year' \ @@ -196,22 +177,13 @@ _regex_arguments _task_attributes "${args[@]}" ## task commands -# default completion -(( $+functions[_task_default] )) || -_task_default() { +# filter completion +(( $+functions[_task_filter] )) || +_task_filter() { _task_attributes "$@" -} -# commands expecting an ID -(( $+functions[_task_id] )) || -_task_id() { - if (( CURRENT < 3 )); then - # update IDs - _task_zshids=( ${(f)"$(task _zshids)"} ) - _describe -t values 'task IDs' _task_zshids - else - _task_attributes "$@" - fi + # TODO complete conjunctions only if the previous word is a filter expression, i.e. attribute, ID, any non-command + _describe -t default 'task conjunctions' _task_conjunctions } # merge completion @@ -235,46 +207,42 @@ _task_pull() { _files } +# execute completion +(( $+functions[_task_execute] )) || +_task_execute() { + _files +} -# modify (task [0-9]* ...) completion -(( $+functions[_task_modify] )) || -_task_modify() { - _describe -t commands 'task command' _task_idCmdsDesc - _task_attributes "$@" +# id-only completion +(( $+functions[_task_id] )) || +_task_id() { + _describe -t values 'task IDs' _task_zshids } ## first level completion => task sub-command completion -(( $+functions[_task_commands] )) || -_task_commands() { +(( $+functions[_task_default] )) || +_task_default() { local cmd ret=1 - if (( CURRENT == 1 )); then - # update IDs - _task_zshids=( ${(f)"$(task _zshids)"} ) - _describe -t commands 'task command' _task_zshcmds - _describe -t values 'task IDs' _task_zshids - # TODO match more than one ID - elif [[ $words[1] =~ ^[0-9]*$ ]] then - _call_function ret _task_modify - return ret - else -# local curcontext="${curcontext}" -# cmd="${_task_cmds[(r)$words[1]:*]%%:*}" - cmd="${_task_cmds[(r)$words[1]]}" - idCmd="${(M)_task_idCmds[@]:#$words[1]}" - if (( $#cmd )); then -# curcontext="${curcontext%:*:*}:task-${cmd}" + integer i=1 + while (( i < $#words )) + do + cmd="${_task_cmds[(r)$words[$i]]}" + if (( $#cmd )); then + _call_function ret _task_${cmd} || + _call_function ret _task_filter || + _message "No command remaining." + return ret + fi + (( i++ )) + done - if (( $#idCmd )); then - _call_function ret _task_id - else - _call_function ret _task_${cmd} || - _call_function ret _task_default || - _message "No command remaining." - fi - else - _message "Unknown subcommand ${cmd}" - fi - return ret - fi + # update IDs + _task_zshids=( ${(f)"$(task _zshids)"} ) + + _describe -t commands 'task command' _task_zshcmds + _describe -t values 'task IDs' _task_zshids + _call_function ret _task_filter + + return ret } From 62a3ef643328a05c11a62cd42de12cf271ca1e69 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Sat, 21 Jan 2012 13:24:07 -0800 Subject: [PATCH 156/220] Grammar update --- README.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.textile b/README.textile index eca968089..bf6776665 100644 --- a/README.textile +++ b/README.textile @@ -56,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo h3. Customization If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. -If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. +If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. From e0b235608032256f5b725676f7c6217480a52722 Mon Sep 17 00:00:00 2001 From: Tate Johnson Date: Sun, 22 Jan 2012 21:34:25 +1000 Subject: [PATCH 157/220] Add middleman to bundled commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 12123eea6..74a3adaf8 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 6496acf58bf8531809490b52e34811f74a27cc7c Mon Sep 17 00:00:00 2001 From: Brent Faulkner Date: Mon, 23 Jan 2012 20:42:54 -0500 Subject: [PATCH 158/220] adding rbenv support to all the rvm themes --- themes/alanpeabody.zsh-theme | 10 ++++++++-- themes/bira.zsh-theme | 9 ++++++++- themes/crunch.zsh-theme | 8 +++++++- themes/dallas.zsh-theme | 8 +++++++- themes/eastwood.zsh-theme | 4 ++++ themes/fino.zsh-theme | 9 ++++++++- themes/gallois.zsh-theme | 6 +++++- themes/jonathan.zsh-theme | 4 ++-- themes/josh.zsh-theme | 4 ++-- themes/macovsky-ruby.zsh-theme | 9 ++++++++- themes/macovsky.zsh-theme | 8 +++++++- themes/murilasso.zsh-theme | 2 +- themes/nebirhos.zsh-theme | 4 ++++ themes/superjarin.zsh-theme | 8 +++++++- themes/suvash.zsh-theme | 9 ++++++++- themes/wuffers.zsh-theme | 2 +- themes/zhann.zsh-theme | 10 +++++++++- 17 files changed, 96 insertions(+), 18 deletions(-) diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme index 1f66f1ec3..4a1b1b386 100644 --- a/themes/alanpeabody.zsh-theme +++ b/themes/alanpeabody.zsh-theme @@ -1,7 +1,14 @@ local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' local pwd='%{$fg[blue]%}%~%{$reset_color%}' -local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +local rvm='' +if which rvm-prompt &> /dev/null; then + rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' @@ -19,4 +26,3 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" PROMPT="${user} ${pwd}$ " RPROMPT="${return_code} ${git_branch} ${rvm}" - diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index 5642eaeb8..215720477 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -3,7 +3,14 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' -local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +local rvm_ruby='' +if which rvm-prompt &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi local git_branch='$(git_prompt_info)%{$reset_color%}' PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme index 2473cd230..b2759a1b0 100644 --- a/themes/crunch.zsh-theme +++ b/themes/crunch.zsh-theme @@ -29,7 +29,13 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" # Our elements: CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" +if which rvm-prompt &> /dev/null; then + CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" +else + if which rbenv &> /dev/null; then + CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" + fi +fi CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme index eef32e998..e9b4f852a 100644 --- a/themes/dallas.zsh-theme +++ b/themes/dallas.zsh-theme @@ -3,7 +3,13 @@ # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +if which rvm-prompt &> /dev/null; then + DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +else + if which rbenv &> /dev/null; then + DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" + fi +fi # Grab the current machine name: muscato DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" # Grab the current filepath, use shortcuts: ~/Desktop diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index 83664515a..db2529990 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -1,6 +1,10 @@ #RVM settings if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" +else + if which rbenv &> /dev/null; then + RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1" + fi fi ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 17cf59708..26e547176 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -25,7 +25,14 @@ function box_name { } -local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' +local rvm_ruby='' +if which rvm-prompt &> /dev/null; then + rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi local current_dir='${PWD/#$HOME/~}' local git_info='$(git_prompt_info)' diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index f9406dd96..3eac14867 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -15,7 +15,11 @@ git_custom_status() { if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' else - RPS1='$(git_custom_status) $EPS1' + if which rbenv &> /dev/null; then + RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' + else + RPS1='$(git_custom_status) $EPS1' + fi fi PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index a170a13d0..2f0c4b917 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -10,7 +10,7 @@ function theme_precmd { PR_PWDLEN="" local promptsize=${#${(%):---(%n@%m:%l)---()--}} - local rubyprompt=`rvm_prompt_info` + local rubyprompt=`rvm_prompt_info || rbenv_prompt_info` local rubypromptsize=${#${rubyprompt}} local pwdsize=${#${(%):-%~}} @@ -113,7 +113,7 @@ setprompt () { PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ $PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ $PR_GREEN%$PR_PWDLEN<...<%~%<<\ -$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ +$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ $PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\ $PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\ diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index 6bed1a70e..142e76838 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -10,7 +10,7 @@ function josh_prompt { prompt=" " branch=$(current_branch) - ruby_version=$(rvm_prompt_info) + ruby_version=$(rvm_prompt_info || rbenv_prompt_info) path_size=${#PWD} branch_size=${#branch} ruby_size=${#ruby_version} @@ -31,7 +31,7 @@ function josh_prompt { prompt=" $prompt" done - prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)" + prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)" echo $prompt } diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme index 4eb410233..045376761 100644 --- a/themes/macovsky-ruby.zsh-theme +++ b/themes/macovsky-ruby.zsh-theme @@ -1,7 +1,14 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +if which rvm-prompt &> /dev/null; then + PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +else + if which rbenv &> /dev/null; then + PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' + fi +fi + RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme index 4eb410233..b6978b929 100644 --- a/themes/macovsky.zsh-theme +++ b/themes/macovsky.zsh-theme @@ -1,7 +1,13 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +if which rvm-prompt &> /dev/null; then + PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +else + if which rbenv &> /dev/null; then + PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' + fi +fi RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme index 310357b45..bc2b9b224 100644 --- a/themes/murilasso.zsh-theme +++ b/themes/murilasso.zsh-theme @@ -1,7 +1,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}' -local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}' +local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}' local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}' PROMPT="${user_host}:${current_dir} ${rvm_ruby} diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme index c49df972e..c5864d9b8 100644 --- a/themes/nebirhos.zsh-theme +++ b/themes/nebirhos.zsh-theme @@ -4,6 +4,10 @@ # Get the current ruby version in use with RVM: if [ -e ~/.rvm/bin/rvm-prompt ]; then RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " +else + if which rbenv &> /dev/null; then + RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " + fi fi # Get the host name (first 4 chars) diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme index 16eeb5316..0be816de0 100644 --- a/themes/superjarin.zsh-theme +++ b/themes/superjarin.zsh-theme @@ -1,5 +1,11 @@ # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +if which rvm-prompt &> /dev/null; then + JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +else + if which rbenv &> /dev/null; then + JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" + fi +fi # Grab the current filepath, use shortcuts: ~/Desktop # Append the current git branch, if in a git repository diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme index f50657db2..c87f64558 100644 --- a/themes/suvash.zsh-theme +++ b/themes/suvash.zsh-theme @@ -12,8 +12,15 @@ function collapse_pwd { echo $(pwd | sed -e "s,^$HOME,~,") } -PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} +if which rvm-prompt &> /dev/null; then + PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $(virtualenv_info)$(prompt_char) ' +else + if which rbenv &> /dev/null; then + PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} +$(virtualenv_info)$(prompt_char) ' + fi +fi ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme index 182d8a34f..4019d0a51 100644 --- a/themes/wuffers.zsh-theme +++ b/themes/wuffers.zsh-theme @@ -2,4 +2,4 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" -PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' +PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current 2>/dev/null || rbenv version-name 2>/dev/null)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme index 3dff29c9c..574e0cec3 100644 --- a/themes/zhann.zsh-theme +++ b/themes/zhann.zsh-theme @@ -1,5 +1,13 @@ PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' + +if which rvm-prompt &> /dev/null; then + RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' +else + if which rbenv &> /dev/null; then + RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}' + fi +fi + ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From a26f9b9948405a10d3c04280a0ad2e49e69ba6f8 Mon Sep 17 00:00:00 2001 From: Alexander Greim Date: Wed, 25 Jan 2012 06:56:09 +0100 Subject: [PATCH 159/220] adding engine yard command (ey) to bundler binstubs --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 96c649664..5e9b82336 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 0da18650c6d8f63c230c36e92786855361f42ef3 Mon Sep 17 00:00:00 2001 From: Wim Griffioen Date: Thu, 26 Jan 2012 19:31:45 +0100 Subject: [PATCH 160/220] added rails to bundled_commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 5e9b82336..e1f571237 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 35d89ab85991e9a6dc055d0fd790b50c1aaa0cce Mon Sep 17 00:00:00 2001 From: szetobo Date: Fri, 27 Jan 2012 08:50:28 +0800 Subject: [PATCH 161/220] update rails runner alias to ru - avoid rr as it is mostly used for restart rails server --- plugins/rails3/rails3.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index a817b483f..52fdf43e9 100644 --- a/plugins/rails3/rails3.plugin.zsh +++ b/plugins/rails3/rails3.plugin.zsh @@ -14,7 +14,7 @@ alias rdb='_rails_command dbconsole' alias rdbm='rake db:migrate db:test:clone' alias rg='_rails_command generate' alias rp='_rails_command plugin' -alias rr='_rails_command runner' +alias ru='_rails_command runner' alias rs='_rails_command server' alias rsd='_rails_command server --debugger' alias devlog='tail -f log/development.log' From 8769e5f8c959f3d3fc9e5b62ab48fc0f73aedb1f Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Thu, 26 Jan 2012 23:19:50 -0800 Subject: [PATCH 162/220] Removed trailing spaces in Git files. Fixes #867 --- lib/git.zsh | 2 +- plugins/git/git.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index defa062c6..4d1634e8b 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -61,4 +61,4 @@ git_prompt_status() { STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" fi echo $STATUS -} +} \ No newline at end of file diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 94af31202..e1d682508 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -60,4 +60,4 @@ compdef ggpull=git alias ggpush='git push origin $(current_branch)' compdef ggpush=git alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' -compdef ggpnp=git +compdef ggpnp=git \ No newline at end of file From dc4d7a92c1a56509ed116a3ea44345f556c4f91b Mon Sep 17 00:00:00 2001 From: Aleksey Orekhov Date: Wed, 8 Feb 2012 15:19:12 -0500 Subject: [PATCH 163/220] fixed asterisk display for modified repos in git prior to 1.7.2 --- lib/git.zsh | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 4d1634e8b..c46aa608d 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -4,15 +4,21 @@ function git_prompt_info() { echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" } + # Checks if working tree is dirty parse_git_dirty() { - if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then + local SUBMODULE_SYNTAX='' + if [[ PRE_1_7_2_GIT -gt 0 ]]; then + SUBMODULE_SYNTAX="--ignore-submodules=dirty" + fi + if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } + # Checks if there are commits ahead from remote function git_prompt_ahead() { if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then @@ -61,4 +67,30 @@ git_prompt_status() { STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" fi echo $STATUS -} \ No newline at end of file +} + +#this is unlikely to change so make it all statically assigned +PRE_1_7_2_GIT=$(git_compare_version "1.7.2") +#clean up the namespace slightly by removing the checker function +unset -f git_compare_version() + +#compare the provided version of git to the version installed and on path +#prints 1 if input version <= installed version +#prints -1 otherwise +function git_compare_version() { + local INPUT_GIT_VERSION=$1; + local INSTALLED_GIT_VERSION + INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION}); + INSTALLED_GIT_VERSION=($(git --version)); + INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}); + + for i in {1..3}; do + if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then + echo -1 + return 0 + fi + done + echo 1 +} + + From 7ea758834baa2694c2e9301fed1a71faa9f12166 Mon Sep 17 00:00:00 2001 From: Aleksey Orekhov Date: Wed, 8 Feb 2012 15:25:12 -0500 Subject: [PATCH 164/220] changed variable PRE_1_7_2_GIT to POST_1_7_2_GIT to make it more accurate --- lib/git.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index c46aa608d..efaa943ff 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -8,7 +8,7 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' - if [[ PRE_1_7_2_GIT -gt 0 ]]; then + if [[ POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" fi if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then @@ -70,7 +70,7 @@ git_prompt_status() { } #this is unlikely to change so make it all statically assigned -PRE_1_7_2_GIT=$(git_compare_version "1.7.2") +POST_1_7_2_GIT=$(git_compare_version "1.7.2") #clean up the namespace slightly by removing the checker function unset -f git_compare_version() From a9f6aed307f128a58176b151bc36854c9d3899f7 Mon Sep 17 00:00:00 2001 From: Aleksey Orekhov Date: Wed, 8 Feb 2012 15:30:58 -0500 Subject: [PATCH 165/220] fixed introduced to parse_git_dirty --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index efaa943ff..d90f0f315 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -8,7 +8,7 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' - if [[ POST_1_7_2_GIT -gt 0 ]]; then + if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" fi if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then From 5a5c93b33493b47d34dd470eb851aaf24fa87536 Mon Sep 17 00:00:00 2001 From: cruser42 Date: Tue, 21 Feb 2012 10:47:05 -0500 Subject: [PATCH 166/220] Fixed bug introduced when fixing issue 896 --- lib/git.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index d90f0f315..fb4ad8ca6 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -69,11 +69,6 @@ git_prompt_status() { echo $STATUS } -#this is unlikely to change so make it all statically assigned -POST_1_7_2_GIT=$(git_compare_version "1.7.2") -#clean up the namespace slightly by removing the checker function -unset -f git_compare_version() - #compare the provided version of git to the version installed and on path #prints 1 if input version <= installed version #prints -1 otherwise @@ -93,4 +88,9 @@ function git_compare_version() { echo 1 } +#this is unlikely to change so make it all statically assigned +POST_1_7_2_GIT=$(git_compare_version "1.7.2") +#clean up the namespace slightly by removing the checker function +unset -f git_compare_version + From d693711f1419c4c4da1da8eca35c1d983bb42ab0 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 28 Feb 2012 13:52:57 -0500 Subject: [PATCH 167/220] made the 'd' alias only show the directories that can be cd'ed to using the number aliases --- lib/directories.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index bb114f615..a787db9eb 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -36,9 +36,9 @@ cd () { alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v' +alias d='dirs -v | head -10' # mkdir & cd to it function mcd() { mkdir -p "$1" && cd "$1"; -} \ No newline at end of file +} From f8802bd61216b7636b9065efe5441479d3e4f7fd Mon Sep 17 00:00:00 2001 From: Rotem Yaari Date: Thu, 26 Jan 2012 22:25:51 +0200 Subject: [PATCH 168/220] Add dircycle plugin: enables cycling through the directory stack --- plugins/dircycle/dircycle.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/dircycle/dircycle.plugin.zsh diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh new file mode 100644 index 000000000..46a0ab268 --- /dev/null +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -0,0 +1,10 @@ +## +# dircycle plugin: enables cycling through the directory +# stack using Ctrl+Shift+Left/Right + +eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }" +zle -N insert-cycledleft +bindkey "\e[1;6D" insert-cycledleft +eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }" +zle -N insert-cycledright +bindkey "\e[1;6C" insert-cycledright From 19bf83e17d90d64b9bb40f8fd4c36e660e4b17e3 Mon Sep 17 00:00:00 2001 From: Rotem Yaari Date: Sun, 29 Jan 2012 16:41:40 +0200 Subject: [PATCH 169/220] Pager is 'less -R' to support colored outputs --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 88732e664..0f7e7e925 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -9,5 +9,5 @@ bindkey "^[m" copy-prev-shell-word setopt long_list_jobs ## pager -export PAGER=less +export PAGER="less -R" export LC_CTYPE=$LANG From b1e4ef17543d4a236ad35417ac36560917e6cadc Mon Sep 17 00:00:00 2001 From: pomaxa Date: Thu, 1 Mar 2012 16:57:00 +0200 Subject: [PATCH 170/220] current repository action --- plugins/git/git.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e1d682508..d3d3f702a 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -54,10 +54,16 @@ function current_branch() { echo ${ref#refs/heads/} } +function current_repository() { + + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo $(git remote -v | cut -d':' -f 2) +} + # these aliases take advantage of the previous function alias ggpull='git pull origin $(current_branch)' compdef ggpull=git alias ggpush='git push origin $(current_branch)' compdef ggpush=git alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' -compdef ggpnp=git \ No newline at end of file +compdef ggpnp=git From c7105a53416866e8315c503546dc5bfe2b9da83f Mon Sep 17 00:00:00 2001 From: Jeffrey Dileo Date: Wed, 7 Mar 2012 07:47:34 -0500 Subject: [PATCH 171/220] Disabled title function for emacs term mode --- lib/termsupport.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 221989502..e26fef6d3 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -3,7 +3,9 @@ #Fully support screen, iterm, and probably most modern xterm and rxvt #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { - [ "$DISABLE_AUTO_TITLE" != "true" ] || return + if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then + return + fi if [[ "$TERM" == screen* ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then From db27635d8b4cb60f4d3594893e53777179d00d43 Mon Sep 17 00:00:00 2001 From: Vitaliy Yanchuk Date: Fri, 16 Mar 2012 14:10:37 +0200 Subject: [PATCH 172/220] Plugin for encoding strings into base64 and decoding them --- plugins/encode64/encode64.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 plugins/encode64/encode64.plugin.zsh diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh new file mode 100644 index 000000000..cfb7c6a18 --- /dev/null +++ b/plugins/encode64/encode64.plugin.zsh @@ -0,0 +1,2 @@ +encode64(){ echo -n $1 | base64 } +decode64(){ echo -n $1 | base64 -D } \ No newline at end of file From 5f72c6313643f3e627394c540192b77781c08178 Mon Sep 17 00:00:00 2001 From: Mat Schaffer Date: Sat, 17 Mar 2012 22:03:01 -0300 Subject: [PATCH 173/220] Don't clobber standard Esc+. behavior Esc+. works as "last arg" on both bash and zsh. Seems like a shame to introduce a new standard. --- lib/key-bindings.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 5c1b90bfa..5f499f3e8 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -3,7 +3,6 @@ bindkey -e bindkey '\ew' kill-region bindkey -s '\el' "ls\n" -bindkey -s '\e.' "..\n" bindkey '^r' history-incremental-search-backward bindkey "^[[5~" up-line-or-history bindkey "^[[6~" down-line-or-history From 60c3fa937120f38b1215a57889c8207989c9a7f1 Mon Sep 17 00:00:00 2001 From: dir01 Date: Thu, 22 Mar 2012 04:34:19 +0700 Subject: [PATCH 174/220] Python plugin: added pygrep command, simplified pyclean --- plugins/python/python.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 3ea34d718..8be3cd863 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -2,4 +2,7 @@ alias pyfind='find . -name "*.py"' # Remove python compiled byte-code -alias pyclean='find . -type f -name "*.py[co]" -exec rm -f \{\} \;' +alias pyclean='find . -type f -name "*.py[co]" -delete' + +# Grep among .py files +alias pygrep='grep --include="*.py"' From 12e181c6f6167adabb688f63418037c8c1949335 Mon Sep 17 00:00:00 2001 From: Daniel Lockard Date: Wed, 4 Apr 2012 13:04:00 -0500 Subject: [PATCH 175/220] Added an if-statement to see if git is installed --- tools/install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index aedb706da..8ca427d2c 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,13 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +which git > /dev/null +if [[ $? -eq 0 ]]; then + /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +else + echo "git not installed" + exit +fi echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] From e429a880e68982ce9ab0f35921174493fa3e4c03 Mon Sep 17 00:00:00 2001 From: ntpeters Date: Thu, 12 Apr 2012 06:04:24 -0300 Subject: [PATCH 176/220] Added yum aliases for: makecache, grouplist, groupinstall, and groupremove. --- plugins/yum/yum.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh index d6ba7ed62..c9966f1b1 100644 --- a/plugins/yum/yum.plugin.zsh +++ b/plugins/yum/yum.plugin.zsh @@ -3,10 +3,14 @@ alias ys="yum search" # search package alias yp="yum info" # show package info alias yl="yum list" # list packages +alias ygl="yum grouplist" # list package groups alias yli="yum list installed" # print all installed packages +alias ymc="yum makecache # rebuilds the yum package list alias yu="sudo yum update" # upgrate packages alias yi="sudo yum install" # install package +alias ygi="sudo yum groupinstall" # install package group alias yr="sudo yum remove" # remove package +alias ygr="sudo yum groupremove" # remove pagage group alias yrl="sudo yum remove --remove-leaves" # remove package and leaves -alias yc="sudo yum clean all" # clean cache +alias yc="sudo yum clean all" # clean cache \ No newline at end of file From 5eb466a7886e1220584322a10964343a101ed1dc Mon Sep 17 00:00:00 2001 From: Dylan Hudson Date: Thu, 19 Apr 2012 00:14:55 -0700 Subject: [PATCH 177/220] added aliases for sublime text --- plugins/sublime/sublime.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/sublime/sublime.plugin.zsh diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh new file mode 100644 index 000000000..e0f6e052c --- /dev/null +++ b/plugins/sublime/sublime.plugin.zsh @@ -0,0 +1,3 @@ +# Sublime Text 2 Aliases +alias st='open -a "/Applications/Sublime Text 2.app"' +alias stt='st .' From 99a3c3c5c85b7a72037022607f41d682b77db7d7 Mon Sep 17 00:00:00 2001 From: Dylan Hudson Date: Sun, 22 Apr 2012 08:36:37 -0700 Subject: [PATCH 178/220] changed the alias to use to cli provided by sublime text --- plugins/sublime/sublime.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index e0f6e052c..c42c68df1 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,3 +1,3 @@ # Sublime Text 2 Aliases -alias st='open -a "/Applications/Sublime Text 2.app"' +alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' alias stt='st .' From e2f7623534054645e849db42a0030a1642e5ba97 Mon Sep 17 00:00:00 2001 From: Mat Gadd Date: Thu, 3 May 2012 13:03:23 +0100 Subject: [PATCH 179/220] Don't drop everything after a trailing slash, as this breaks standard svn branches: ^/branches/featurename ^/releases/Release-vx.y ^/trunk --- plugins/svn/svn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index e2cf96ca3..4d5bfb8dd 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -16,7 +16,7 @@ function svn_get_repo_name { if [ $(in_svn) ]; then svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT - svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" + svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" fi } From 51c55ad17e23db89e72424add0c34fa20654cd8f Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 6 May 2012 11:08:34 +0100 Subject: [PATCH 180/220] Suppress "zsh: no matches found" error when $ZSH_CUSTOM has no files The addition of `(.N)` enables the `NULL_GLOB` option which suppresses the error output in question. Reference: http://www.zsh.org/mla/users/2004/msg00621.html --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 732a403b7..e360344b0 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -51,7 +51,7 @@ for plugin ($plugins); do done # Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh) source $config_file +for config_file ($ZSH_CUSTOM/*.zsh(.N)) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] From f9018c5efbb6cf164139009eff1863837d72b412 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 6 May 2012 11:10:16 +0100 Subject: [PATCH 181/220] Load themes from `$ZSH_CUSTOM` instead of `$ZSH/custom` This seems like a simple oversight, everything else uses `$ZSH_CUSTOM` rather than `$ZSH/custom`. --- oh-my-zsh.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index e360344b0..c2b6049cb 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -65,12 +65,11 @@ then else if [ ! "$ZSH_THEME" = "" ] then - if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ] + if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ] then - source "$ZSH/custom/$ZSH_THEME.zsh-theme" + source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" else source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi fi fi - From adab18f1616956beb10419dc52b8d713d6b6c9e0 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Sun, 25 Mar 2012 00:00:05 +0200 Subject: [PATCH 182/220] Added suse plugins --- plugins/suse/suse.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/suse/suse.plugin.zsh diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh new file mode 100644 index 000000000..d79308caf --- /dev/null +++ b/plugins/suse/suse.plugin.zsh @@ -0,0 +1,5 @@ +alias zi='sudo zypper install' +alias zrf='sudo zypper refresh' +alias zs='zypper search' +alias zup='sudo zypper dist-upgrade' +alias zrm='sudo zypper remove' From b4380aacb0a0a89618430b2bbb1221c602d43d62 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Thu, 19 Apr 2012 13:49:15 +0300 Subject: [PATCH 183/220] Added zp and zps aliases for the SUSE plugin --- plugins/suse/suse.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh index d79308caf..d46286948 100644 --- a/plugins/suse/suse.plugin.zsh +++ b/plugins/suse/suse.plugin.zsh @@ -3,3 +3,5 @@ alias zrf='sudo zypper refresh' alias zs='zypper search' alias zup='sudo zypper dist-upgrade' alias zrm='sudo zypper remove' +alias zp='sudo zypper patch' +alias zps='sudo zypper ps' From 6f859c5837753a87544b2672678e36bcf167cc82 Mon Sep 17 00:00:00 2001 From: Varun Vijayaraghavan Date: Mon, 21 May 2012 10:42:12 -0400 Subject: [PATCH 184/220] Add Sublime Text 2 alias for Linux. Detects the platform using "uname", and sets the alias accordingly. If you are using Linux, this assumes that you have created a symbolic link to /usr/bin/sublime_text. --- plugins/sublime/sublime.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index c42c68df1..6825d6c08 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,3 +1,8 @@ # Sublime Text 2 Aliases -alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' +#unamestr = 'uname' +if [[ uname == 'Linux' ]]; then + alias st='open -a /usr/bin/sublime_text' +elif [[ uname == 'Darwin' ]]; then + alias st='open -a "/Applications/Sublime Text 2.app' +fi alias stt='st .' From 61c39b50390a7869f22001a6cd65b7e8cd977e88 Mon Sep 17 00:00:00 2001 From: natsumesou Date: Wed, 23 May 2012 13:49:21 +0900 Subject: [PATCH 185/220] Load symlink custom files `(.)` search only real files. The deletion of it enables searching symlink *.zsh files --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c2b6049cb..ddef1ad6c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -51,7 +51,7 @@ for plugin ($plugins); do done # Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh(.N)) source $config_file +for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] From 0f9fff8aecb154627b42a57cede37f7bd7b6c3ba Mon Sep 17 00:00:00 2001 From: Alexander Berezovsky Date: Wed, 23 May 2012 16:47:06 -0700 Subject: [PATCH 186/220] add fasd plugin --- plugins/fasd/fasd.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/fasd/fasd.plugin.zsh diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh new file mode 100644 index 000000000..d42584f1a --- /dev/null +++ b/plugins/fasd/fasd.plugin.zsh @@ -0,0 +1,6 @@ +if [ $commands[fasd] ]; then # check if fasd is installed + eval "$(fasd --init auto)" + alias v='f -e vim' + alias o='a -e open' +fi + From 548f68d7f028acc70f4a9026a28161a604edc405 Mon Sep 17 00:00:00 2001 From: Alexander Berezovsky Date: Wed, 23 May 2012 17:03:18 -0700 Subject: [PATCH 187/220] fino-time theme --- themes/fino-time.zsh-theme | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 themes/fino-time.zsh-theme diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme new file mode 100644 index 000000000..22c7a0981 --- /dev/null +++ b/themes/fino-time.zsh-theme @@ -0,0 +1,39 @@ +# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) + +# Use with a dark background and 256-color terminal! +# Meant for people with RVM and git. Tested only on OS X 10.7. + +# You can set your computer name in the ~/.box-name file if you want. + +# Borrowing shamelessly from these oh-my-zsh themes: +# bira +# robbyrussell +# +# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + echo '○' +} + +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + + +local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' +local current_dir='${PWD/#$HOME/~}' +local git_info='$(git_prompt_info)' + + +PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} %D - %* +╰─$(virtualenv_info)$(prompt_char) " + +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" From 8923694fb42393d063487203e803199b394bbb47 Mon Sep 17 00:00:00 2001 From: Varun Vijayaraghavan Date: Thu, 24 May 2012 11:33:19 -0400 Subject: [PATCH 188/220] Fixed a bug in checking the platform --- plugins/sublime/sublime.plugin.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 plugins/sublime/sublime.plugin.zsh diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh old mode 100644 new mode 100755 index 6825d6c08..0035b1b26 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,8 +1,9 @@ # Sublime Text 2 Aliases #unamestr = 'uname' -if [[ uname == 'Linux' ]]; then - alias st='open -a /usr/bin/sublime_text' -elif [[ uname == 'Darwin' ]]; then - alias st='open -a "/Applications/Sublime Text 2.app' + +if [[ $('uname') == 'Linux' ]]; then + alias st='/usr/bin/sublime_text&' +elif [[ $('uname') == 'Darwin' ]]; then + alias st='open -a /Applications/Sublime Text 2.app' fi alias stt='st .' From 8de877d63222ed4effad7d52d68fccca2c01b6dd Mon Sep 17 00:00:00 2001 From: Amar Raja Date: Tue, 29 May 2012 10:20:49 +0200 Subject: [PATCH 189/220] Prevent the heroku command from being automatically bundle-exec'ed The heroku command should not be executed via bundler, see: https://github.com/heroku/heroku/issues/173 --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index e1f571237..2b80b76e6 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber ey foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 1876f1d5581e7b6907ead46a8371826db5eded49 Mon Sep 17 00:00:00 2001 From: mapc Date: Mon, 28 May 2012 23:14:51 +0200 Subject: [PATCH 190/220] Make the $apt_pref variable evaluatet at alias expansion by using single-quotes instad of double quotes --- plugins/debian/debian.plugin.zsh | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 16a5d54ca..5b6e5cfd4 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -40,20 +40,20 @@ alias ap='apt-cache policy' # superuser operations ###################################################### if [[ $use_sudo -eq 1 ]]; then # commands using sudo ####### - alias aac="sudo $apt_pref autoclean" - alias abd="sudo $apt_pref build-dep" - alias ac="sudo $apt_pref clean" - alias ad="sudo $apt_pref update" - alias adg="sudo $apt_pref update && sudo $apt_pref upgrade" - alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" + alias aac='sudo $apt_pref autoclean' + alias abd='sudo $apt_pref build-dep' + alias ac='sudo $apt_pref clean' + alias ad='sudo $apt_pref update' + alias adg='sudo $apt_pref update && sudo $apt_pref upgrade' + alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade' alias afu='sudo apt-file update' - alias ag="sudo $apt_pref upgrade" - alias ai="sudo $apt_pref install" - alias ap="sudo $apt_pref purge" - alias ar="sudo $apt_pref remove" + alias ag='sudo $apt_pref upgrade' + alias ai='sudo $apt_pref install' + alias ap='sudo $apt_pref purge' + alias ar='sudo $apt_pref remove' # apt-get only - alias ads="sudo $apt_pref dselect-upgrade" + alias ads='sudo $apt_pref dselect-upgrade' # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: @@ -67,18 +67,18 @@ if [[ $use_sudo -eq 1 ]]; then # commands using su ######### else - alias aac='su -ls "'"$apt_pref"' autoclean" root' + alias aac='su -ls \'$apt_pref autoclean\' root' abd() { cmd="su -lc '$apt_pref build-dep $@' root" print "$cmd" eval "$cmd" } - alias ac='su -ls "'"$apt_pref"' clean" root' - alias ad='su -lc "'"$apt_pref"' update" root' - alias adg='su -lc "'"$apt_pref"' update && aptitude safe-upgrade" root' - alias adu='su -lc "'"$apt_pref"' update && aptitude dist-upgrade" root' + alias ac='su -ls \'$apt_pref clean\' root' + alias ad='su -lc \'$apt_pref update\' root' + alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root' + alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root' alias afu='su -lc "apt-file update"' - alias ag='su -lc "'"$apt_pref"' safe-upgrade" root' + alias ag='su -lc \'$apt_pref safe-upgrade\' root' ai() { cmd="su -lc 'aptitude -P install $@' root" print "$cmd" @@ -118,7 +118,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' apt-copy() { print '#!/bin/sh'"\n" > apt-copy.sh - cmd="$apt_pref install " + cmd='$apt_pref install' for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; { cmd="${cmd} ${p}" From 0673425331fe997224bab9f90579c40cd14934f1 Mon Sep 17 00:00:00 2001 From: mapc Date: Mon, 28 May 2012 23:17:38 +0200 Subject: [PATCH 191/220] Add command to directly install the output of acs --- plugins/debian/debian.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 5b6e5cfd4..39d3ef36a 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -49,6 +49,9 @@ if [[ $use_sudo -eq 1 ]]; then alias afu='sudo apt-file update' alias ag='sudo $apt_pref upgrade' alias ai='sudo $apt_pref install' + # Install all packages given on the command line while using only the first word of each line: + # acs ... | ail + alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install' alias ap='sudo $apt_pref purge' alias ar='sudo $apt_pref remove' From 91b4758d8f5a910a60de783f15acb66acda68d7f Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 31 May 2012 09:52:53 -0700 Subject: [PATCH 192/220] Now with 50% less auto-updates. --- tools/check_for_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 524aa509d..bbd705a1e 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -23,7 +23,7 @@ then fi epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) - if [ $epoch_diff -gt 6 ] + if [ $epoch_diff -gt 13 ] then if [ "$DISABLE_UPDATE_PROMPT" = "true" ] then From c4608ba281147af564fc0979b63bc8b23f1e55fb Mon Sep 17 00:00:00 2001 From: Tim Littlemore Date: Fri, 1 Jun 2012 15:26:22 +0100 Subject: [PATCH 193/220] Removing ey command from bundled_commands. It is not usually bundled. --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 2b80b76e6..1ca48089e 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber ey foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From a04484e546e330a9cd2130ee160a53ec4580a844 Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Fri, 1 Jun 2012 19:11:53 -0400 Subject: [PATCH 194/220] rails3, added rgm = 'rails generate migration' --- plugins/rails3/rails3.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index d4c7df654..237d0594b 100644 --- a/plugins/rails3/rails3.plugin.zsh +++ b/plugins/rails3/rails3.plugin.zsh @@ -13,6 +13,7 @@ alias rd='_rails_command destroy' alias rdb='_rails_command dbconsole' alias rdbm='rake db:migrate db:test:clone' alias rg='_rails_command generate' +alias rgm='_rails_command generate migration' alias rp='_rails_command plugin' alias ru='_rails_command runner' alias rs='_rails_command server' From df30eae4121802f8ac800cb3e92c7d08356217a6 Mon Sep 17 00:00:00 2001 From: Erich Menge Date: Sun, 3 Jun 2012 12:44:14 -0500 Subject: [PATCH 195/220] Add a couple of options for git-flow. --- plugins/git-flow/git-flow.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 270bcbe38..71b343884 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -110,6 +110,8 @@ __git-flow-release () -u'[Use the given GPG-key for the digital signature (implies -s)]'\ -m'[Use the given tag message]'\ -p'[Push to $ORIGIN after performing finish]'\ + -k'[Keep branch after performing finish]'\ + -n"[Don't tag this release]"\ ':version:__git_flow_version_list' ;; @@ -162,6 +164,8 @@ __git-flow-hotfix () -u'[Use the given GPG-key for the digital signature (implies -s)]'\ -m'[Use the given tag message]'\ -p'[Push to $ORIGIN after performing finish]'\ + -k'[Keep branch after performing finish]'\ + -n"[Don't tag this release]"\ ':hotfix:__git_flow_hotfix_list' ;; From 083cff4a577f8889db4ec201d2309b126a65e894 Mon Sep 17 00:00:00 2001 From: westonplatter Date: Fri, 8 Jun 2012 12:18:26 -0400 Subject: [PATCH 196/220] checking if airport allows git protocol --- README.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/README.textile b/README.textile index bf6776665..875d02f86 100644 --- a/README.textile +++ b/README.textile @@ -1,5 +1,6 @@ A handful of functions, auto-complete helpers, and stuff that makes you shout... + bq. "OH MY ZSHELL!" h2. Setup From 61ceec528533bdc2865cf3d04a9214dda6f0f173 Mon Sep 17 00:00:00 2001 From: Jaiden Mispy <^_^@mispy.me> Date: Sat, 9 Jun 2012 11:04:58 +1000 Subject: [PATCH 197/220] Plugin which loads Python virtualenvwrapper and activates virtualenvs on cd into git repos --- .../virtualenvwrapper.plugin.zsh | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh new file mode 100644 index 000000000..afdad1bea --- /dev/null +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -0,0 +1,47 @@ +WRAPPER_FOUND=0 +for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do + if [[ -e $wrapsource ]] ; then + WRAPPER_FOUND=1 + source $wrapsource + + if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then + # Automatically activate Git projects' virtual environments based on the + # directory name of the project. Virtual environment name can be overridden + # by placing a .venv file in the project root with a virtualenv name in it + function workon_cwd { + # Check that this is a Git repo + GIT_DIR=`git rev-parse --git-dir 2> /dev/null` + if (( $? == 0 )); then + # Find the repo root and check for virtualenv name override + GIT_DIR=`readlink -f $GIT_DIR` + PROJECT_ROOT=`dirname "$GIT_DIR"` + ENV_NAME=`basename "$PROJECT_ROOT"` + if [[ -f "$PROJECT_ROOT/.venv" ]]; then + ENV_NAME=`cat "$PROJECT_ROOT/.venv"` + fi + # Activate the environment only if it is not already active + if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then + if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then + workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" + fi + fi + elif [ $CD_VIRTUAL_ENV ]; then + # We've just left the repo, deactivate the environment + # Note: this only happens if the virtualenv was activated automatically + deactivate && unset CD_VIRTUAL_ENV + fi + } + + # New cd function that does the virtualenv magic + function cd { + builtin cd "$@" && workon_cwd + } + fi + + break + fi +done + +if [ $WRAPPER_FOUND -eq 0 ] ; then + print "zsh virtualenvwrapper plugin: Couldn't activate virtualenvwrapper. Please run \`pip install virtualenvwrapper\`." +fi From 1bb715965c1dde1ed6f4456b462ae59e1b3769da Mon Sep 17 00:00:00 2001 From: s3 Date: Tue, 12 Jun 2012 10:18:02 +0200 Subject: [PATCH 198/220] Change hardcoded ~/.oh-my-zsh to $ZSH. --- lib/completion.zsh | 2 +- plugins/dirpersist/dirpersist.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b964595ed..f31e101d5 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -46,7 +46,7 @@ zstyle ':completion:*:hosts' hosts $hosts # Use caching so that commands like apt and dpkg complete are useable zstyle ':completion::complete:*' use-cache 1 -zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/ +zstyle ':completion::complete:*' cache-path $ZSH/cache/ # Don't complete uninteresting users zstyle ':completion:*:*:*:users' ignored-patterns \ diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh index 6a2b289a2..0f6d9f435 100644 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -12,7 +12,7 @@ dirpersistinstall () { if grep 'dirpersiststore' ~/.zlogout > /dev/null; then else if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then - echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout + echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout else echo "If you don't want this message to appear, remove dirspersist from \$plugins" fi From 37bce2b51a528c6be5dc4605c81aab70c949a3a3 Mon Sep 17 00:00:00 2001 From: thackoun Date: Tue, 12 Jun 2012 15:48:00 +0300 Subject: [PATCH 199/220] fix a very minor bug with colors of parenthesis in the terminalparty theme --- themes/terminalparty.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme index 73653aca8..216ce37eb 100644 --- a/themes/terminalparty.zsh-theme +++ b/themes/terminalparty.zsh-theme @@ -2,7 +2,7 @@ PROMPT='%{$fg[green]%} %% ' # RPS1='%{$fg[blue]%}%~%{$reset_color%} ' RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}' -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[yellow]%}" +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}" From dee54a2477d2a5be5d6cced7497f539ecfc2e05f Mon Sep 17 00:00:00 2001 From: Kristi Date: Wed, 13 Jun 2012 12:57:15 -0700 Subject: [PATCH 200/220] Use grep to detect if untracked files exist instead of storing all the output of ls-files. --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index a2583b028..f22ce2719 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -81,7 +81,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { if [[ -n "$PR_GIT_UPDATE" ]] ; then # check for untracked files or updated submodules, since vcs_info doesn't - if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" else From 4199c1a6f77f1605157b1cfa6baa47c14c68a6c9 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Wed, 13 Jun 2012 13:14:23 -0700 Subject: [PATCH 201/220] Updating README to ask people to stop sending themes for now --- README.textile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.textile b/README.textile index 875d02f86..a38e2d7cf 100644 --- a/README.textile +++ b/README.textile @@ -69,9 +69,13 @@ h2. Help out! I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! -h3. Send us your theme! +h3. (Don't) Send us your theme! (for now) + +-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.- + +We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there. + -I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. h2. Contributors From 4d6b532248fce0e71d762eb1ec3ef2ec8fcd5289 Mon Sep 17 00:00:00 2001 From: Kristi Date: Wed, 13 Jun 2012 13:14:31 -0700 Subject: [PATCH 202/220] add --directory flag --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index f22ce2719..312229e9f 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -81,7 +81,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { if [[ -n "$PR_GIT_UPDATE" ]] ; then # check for untracked files or updated submodules, since vcs_info doesn't - if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then + if git ls-files --other --exclude-standard --directory 2> /dev/null | grep -q "."; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" else From c65a53df811953b9f4117ff0b8014d869565bf9d Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Fri, 15 Jun 2012 10:07:22 +0300 Subject: [PATCH 203/220] Fixed unmached " in yum plugin --- plugins/yum/yum.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh index c9966f1b1..69abfc4ce 100644 --- a/plugins/yum/yum.plugin.zsh +++ b/plugins/yum/yum.plugin.zsh @@ -5,7 +5,7 @@ alias yp="yum info" # show package info alias yl="yum list" # list packages alias ygl="yum grouplist" # list package groups alias yli="yum list installed" # print all installed packages -alias ymc="yum makecache # rebuilds the yum package list +alias ymc="yum makecache" # rebuilds the yum package list alias yu="sudo yum update" # upgrate packages alias yi="sudo yum install" # install package From 823cc9180c21c0520713b39fe3e3590645c76ad2 Mon Sep 17 00:00:00 2001 From: Thomas Dippel Date: Sat, 16 Jun 2012 12:41:44 +0200 Subject: [PATCH 204/220] Explicitly tell rbenv to use zsh According to @graywh's comment on: https://github.com/sstephenson/rbenv/issues/185 --- plugins/rbenv/rbenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index ae37404cd..4c4647b32 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -4,7 +4,7 @@ for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do FOUND_RBENV=1 export RBENV_ROOT=$rbenvdir export PATH=${rbenvdir}/bin:$PATH - eval "$(rbenv init -)" + eval "$(rbenv init - zsh)" alias rubies="rbenv versions" alias gemsets="rbenv gemset list" From 82f785bc6751dc7c199b5d1ea068567120b92511 Mon Sep 17 00:00:00 2001 From: James Walker Date: Mon, 18 Jun 2012 10:41:19 -0400 Subject: [PATCH 205/220] remove readlink call and clean up --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index afdad1bea..a93c8e863 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -10,11 +10,9 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/ # by placing a .venv file in the project root with a virtualenv name in it function workon_cwd { # Check that this is a Git repo - GIT_DIR=`git rev-parse --git-dir 2> /dev/null` + PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` if (( $? == 0 )); then - # Find the repo root and check for virtualenv name override - GIT_DIR=`readlink -f $GIT_DIR` - PROJECT_ROOT=`dirname "$GIT_DIR"` + # Check for virtualenv name override ENV_NAME=`basename "$PROJECT_ROOT"` if [[ -f "$PROJECT_ROOT/.venv" ]]; then ENV_NAME=`cat "$PROJECT_ROOT/.venv"` @@ -30,6 +28,7 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/ # Note: this only happens if the virtualenv was activated automatically deactivate && unset CD_VIRTUAL_ENV fi + unset PROJECT_ROOT } # New cd function that does the virtualenv magic From e9a9deacb09196a48a39adc827d861e1896f4c59 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Mon, 18 Jun 2012 20:15:57 +0300 Subject: [PATCH 206/220] rbenv plugin now uses 'brew --prefix rbenv' command to find rbenv folder --- plugins/rbenv/rbenv.plugin.zsh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index ae37404cd..a0a64c7e4 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -1,5 +1,18 @@ +function is_homebrew_installed() { + type brew &> /dev/null +} + +function is_rbenv_installed() { + brew --prefix rbenv &> /dev/null +} + FOUND_RBENV=0 -for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do +rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") +if is_homebrew_installed && is_rbenv_installed ; then + rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") +fi + +for rbenvdir in "${rbenvdirs[@]}" ; do if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then FOUND_RBENV=1 export RBENV_ROOT=$rbenvdir From 5931f64308cbf4b0a8ef740a6b4eda5834479bd7 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Mon, 18 Jun 2012 21:29:24 +0300 Subject: [PATCH 207/220] sanitized code according to coding style --- plugins/rbenv/rbenv.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index a0a64c7e4..a62dd5602 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -1,14 +1,14 @@ -function is_homebrew_installed() { +_homebrew-installed() { type brew &> /dev/null } -function is_rbenv_installed() { +_rbenv-from-homebrew-installed() { brew --prefix rbenv &> /dev/null } FOUND_RBENV=0 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") -if is_homebrew_installed && is_rbenv_installed ; then +if _homebrew-installed && _rbenv-from-homebrew-installed ; then rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") fi From b97cc939ec50cbd424beb4d9d5d61625b209ccac Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Wed, 20 Jun 2012 13:17:41 -0700 Subject: [PATCH 208/220] added first version of my theme af-magic --- themes/af-magic.zsh-theme | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 themes/af-magic.zsh-theme diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme new file mode 100644 index 000000000..241393f1e --- /dev/null +++ b/themes/af-magic.zsh-theme @@ -0,0 +1,39 @@ +# af-magic.zsh-theme +# +# Author: Andy Fleming +# URL: http://andyfleming.com/ +# +# Created on: June 19, 2012 +# Last modified on: June 20, 2012 + + + +if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + + +PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} +$FG[032]%~\ +$(git_prompt_info) \ +$FG[105]%(!.#.»)%{$reset_color%} ' +PROMPT2='%{$fg[red]%}\ %{$reset_color%}' +RPS1='${return_code}' + + + +eval my_gray='$FG[237]' +eval my_orange='$FG[214]' +RPROMPT='$my_gray%n@%m%{$reset_color%}%' + + +ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" + + + +# LS colors, made with http://geoff.greer.fm/lscolors/ +#export LSCOLORS="exfxcxdxbxegedabagacad" +#export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' + From 98d7a010994cd39758e4a1599cefe9e130a346db Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Wed, 20 Jun 2012 13:26:05 -0700 Subject: [PATCH 209/220] theme cleanup --- themes/af-magic.zsh-theme | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 241393f1e..c1b00c62b 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -2,6 +2,8 @@ # # Author: Andy Fleming # URL: http://andyfleming.com/ +# Repo: https://github.com/andyfleming/oh-my-zsh +# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme # # Created on: June 19, 2012 # Last modified on: June 20, 2012 @@ -11,7 +13,7 @@ if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - +# primary prompt PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} $FG[032]%~\ $(git_prompt_info) \ @@ -20,20 +22,15 @@ PROMPT2='%{$fg[red]%}\ %{$reset_color%}' RPS1='${return_code}' - +# color vars eval my_gray='$FG[237]' eval my_orange='$FG[214]' + +# right prompt RPROMPT='$my_gray%n@%m%{$reset_color%}%' - +# git settings ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" - - - -# LS colors, made with http://geoff.greer.fm/lscolors/ -#export LSCOLORS="exfxcxdxbxegedabagacad" -#export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' - From 7e1da28d27f42e4d873cdfc28ef362d59d8c2b07 Mon Sep 17 00:00:00 2001 From: jugyo Date: Thu, 21 Jun 2012 07:41:50 +0900 Subject: [PATCH 210/220] correct the ruby version label for rbenv --- themes/nebirhos.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme index c5864d9b8..a5a226b69 100644 --- a/themes/nebirhos.zsh-theme +++ b/themes/nebirhos.zsh-theme @@ -6,7 +6,7 @@ if [ -e ~/.rvm/bin/rvm-prompt ]; then RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " else if which rbenv &> /dev/null; then - RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " + RUBY_PROMPT_="%{$fg_bold[blue]%}rbenv:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " fi fi From 3aa0cb74d0a19a8053889a976404a7915585466e Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Fri, 22 Jun 2012 18:27:21 +0100 Subject: [PATCH 211/220] added plugin for jruby --- plugins/jruby/jruby.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 plugins/jruby/jruby.plugin.zsh diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh new file mode 100755 index 000000000..58781fc72 --- /dev/null +++ b/plugins/jruby/jruby.plugin.zsh @@ -0,0 +1,3 @@ +# Aliases +alias jrspec='jruby --debug -S rspec --debug' +alias jprofile='jruby --profile.api -S rspec' From 5c37c85fb49a377b59115efc2aa132665982ac06 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Fri, 22 Jun 2012 18:33:11 +0100 Subject: [PATCH 212/220] added jexec --- plugins/jruby/jruby.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh index 58781fc72..bb7975b10 100755 --- a/plugins/jruby/jruby.plugin.zsh +++ b/plugins/jruby/jruby.plugin.zsh @@ -1,3 +1,4 @@ # Aliases alias jrspec='jruby --debug -S rspec --debug' alias jprofile='jruby --profile.api -S rspec' +alias jexec='jruby -S' From a39c9ffe5b7236b6e4dc78efa80b478cc411af7f Mon Sep 17 00:00:00 2001 From: Renan Cakirerk Date: Sat, 23 Jun 2012 14:53:40 +0300 Subject: [PATCH 213/220] Fix finding git issue. http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script --- tools/install.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 8ca427d2c..b080be3a1 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,13 +5,10 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -which git > /dev/null -if [[ $? -eq 0 ]]; then - /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh -else +hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { echo "git not installed" exit -fi +} echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] From d15ec4bf248cf091fb31dd10da066c040abcd744 Mon Sep 17 00:00:00 2001 From: David Barragan Date: Mon, 25 Jun 2012 10:55:23 +0200 Subject: [PATCH 214/220] Added another path --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index a93c8e863..5d0860400 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,5 +1,5 @@ WRAPPER_FOUND=0 -for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do +for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do if [[ -e $wrapsource ]] ; then WRAPPER_FOUND=1 source $wrapsource From e2ddf1ef8c1147586a11c25007b201e9cbcfe278 Mon Sep 17 00:00:00 2001 From: Eustachy Kapusta Date: Sun, 1 Jul 2012 19:57:32 +0200 Subject: [PATCH 215/220] Remove bogus "-" from nomz="ps -aux" alias. Info from http://procps.sourceforge.net/faq.html . --- plugins/lol/lol.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index e455527e7..697f98d66 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -29,7 +29,7 @@ alias iminurbase='finger' alias btw='nice' alias obtw='nohup' -alias nomz='ps -aux' +alias nomz='ps aux' alias nomnom='killall' alias byes='exit' From e3ff4b58c6b0012c616ea7a1dc44cde7a2ecfb57 Mon Sep 17 00:00:00 2001 From: lukas Date: Tue, 3 Jul 2012 09:59:42 +0200 Subject: [PATCH 216/220] provide plugin for rbfu the ruby version switcher Evaluates $(rbfu --init --auto) if rbfu is installed on the system, also has a custom rbfu-rubies method which lists the installed rubies which are available to rbfu. For compatibility with themes, also creates the rvm_prompt_info function, so existing themes should work out of the box. --- plugins/rbfu/rbfu.plugin.zsh | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 plugins/rbfu/rbfu.plugin.zsh diff --git a/plugins/rbfu/rbfu.plugin.zsh b/plugins/rbfu/rbfu.plugin.zsh new file mode 100644 index 000000000..008485205 --- /dev/null +++ b/plugins/rbfu/rbfu.plugin.zsh @@ -0,0 +1,42 @@ +# Enables rbfu with --auto option, if available. +# +# Also provides a command to list all installed/available +# rubies. To ensure compatibility with themes, creates the +# rvm_prompt_info function to return the $RBFU_RUBY_VERSION +# version. + +command -v rbfu &>/dev/null + +if [[ $? -eq 0 ]]; then + eval "$(rbfu --init --auto)" + + # Internal: Print ruby version details, if it's currently + # active etc. + function _rbfu_rubies_print() { + local rb rb_out + rb=$(basename $1) + rb_out="$rb" + [[ -h $1 ]] && rb_out="$rb_out${fg[green]}@${reset_color}" + [[ "x$rb" == "x$2" ]] && rb_out="${fg[red]}$rb_out ${fg[red]}*${reset_color}" + echo $rb_out + } + + # Public: Provide a list with all available rubies, this basically depends + # on `ls -1` and .rfbu/rubies. Highlights the currently active ruby version + # and aliases. + function rbfu-rubies() { + local rbfu_dir active_rb + rbfu_dir=$RBFU_RUBIES + active_rb=$RBFU_RUBY_VERSION + [[ -z "$rbfu_dir" ]] && rbfu_dir="${HOME}/.rbfu/rubies" + [[ -z "$active_rb" ]] && active_rb="system" + _rbfu_rubies_print "${rbfu_dir}/system" $active_rb + for rb in $(ls -1 $rbfu_dir); do + _rbfu_rubies_print "${rbfu_dir}/${rb}" $active_rb + done + } + + # Public: Create rvm_prompt_info command for themes compatibility, unless + # it has already been defined. + [ ! -x rvm_prompt_info ] && function rvm_prompt_info() { echo "${RBFU_RUBY_VERSION:=system}" } +fi From 92b6cae02638f644e6359e3f553805e2c3eba957 Mon Sep 17 00:00:00 2001 From: Josh Vermaire Date: Sun, 8 Jul 2012 23:34:27 -0700 Subject: [PATCH 217/220] escape whitespace --- plugins/sublime/sublime.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 0035b1b26..781c8f83f 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -4,6 +4,6 @@ if [[ $('uname') == 'Linux' ]]; then alias st='/usr/bin/sublime_text&' elif [[ $('uname') == 'Darwin' ]]; then - alias st='open -a /Applications/Sublime Text 2.app' + alias st='open -a /Applications/Sublime\ Text\ 2.app' fi alias stt='st .' From a15bcd6461b5b8237844c4e2968df0518dab5e9a Mon Sep 17 00:00:00 2001 From: Josh Vermaire Date: Mon, 9 Jul 2012 00:11:07 -0700 Subject: [PATCH 218/220] utilize sublime's embedded command line binary --- plugins/sublime/sublime.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 781c8f83f..91b0279c5 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -4,6 +4,6 @@ if [[ $('uname') == 'Linux' ]]; then alias st='/usr/bin/sublime_text&' elif [[ $('uname') == 'Darwin' ]]; then - alias st='open -a /Applications/Sublime\ Text\ 2.app' + alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' fi alias stt='st .' From 87ab8771dac655272895e5904fcf93217ea4a64b Mon Sep 17 00:00:00 2001 From: Sebastian Nowak Date: Sun, 15 Jul 2012 21:26:30 +0200 Subject: [PATCH 219/220] 'rails' command should not be run with bundle exec http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/ --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 1ca48089e..39b76ecdf 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) ## Functions From 1c23a52f5744ef419e83733d18a6a698ddd14d1e Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Fri, 20 Jul 2012 15:07:51 -0700 Subject: [PATCH 220/220] auto-upadate feature will now reset the epoch so that if a user doesn't say yes, it won't ask them again for a while. fixes #1240 --- tools/check_for_upgrade.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index bbd705a1e..612901cbe 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -32,9 +32,10 @@ then echo "[Oh My Zsh] Would you like to check for updates?" echo "Type Y to update oh-my-zsh: \c" read line - if [ "$line" = Y ] || [ "$line" = y ] - then + if [ "$line" = Y ] || [ "$line" = y ]; then _upgrade_zsh + else + _update_zsh_update fi fi fi