From 20b025ba2cd419a99630458052bfa9a9e8c99e91 Mon Sep 17 00:00:00 2001 From: Ian Yang Date: Fri, 2 Dec 2011 18:32:15 +0800 Subject: [PATCH 01/50] tmuxinator completion A utility to automate tmux session creation https://github.com/aziz/tmuxinator --- plugins/tmuxinator/_tmuxinator | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/tmuxinator/_tmuxinator diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator new file mode 100644 index 000000000..f0ff304dd --- /dev/null +++ b/plugins/tmuxinator/_tmuxinator @@ -0,0 +1,36 @@ +#compdef tmuxinator +#autoload + +local curcontext="$curcontext" state line ret=1 +local -a _configs + +_arguments -C \ + '1: :->cmds' \ + '2:: :->args' && ret=0 + +case $state in + cmds) + _values "tmuxinator command" \ + "start[start a tmux session using project's tmuxinator config]" \ + "open[create a new project file and open it in your editor]" \ + "copy[copy source_project project file to a new project called new_project]" \ + "delete[deletes the project called project_name]" \ + "implode[deletes all existing projects!]" \ + "list[list all existing projects]" \ + "doctor[look for problems in your configuration]" \ + "help[shows this help document]" \ + "version[shows tmuxinator version number]" + ret=0 + ;; + args) + case $line[1] in + start|open|copy|delete) + _configs=(`tmuxinator list | sed -n 's/^[ \t]\+//p'`) + _values 'configs' $_configs + ret=0 + ;; + esac + ;; +esac + +return ret \ No newline at end of file From 8942d304ff55ad9467872ecab3f343552b5c2083 Mon Sep 17 00:00:00 2001 From: Daniel Bayerlein Date: Sat, 7 Apr 2012 18:23:12 +0200 Subject: [PATCH 02/50] Add Theme "itchy" --- themes/itchy.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/itchy.zsh-theme diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme new file mode 100644 index 000000000..afc2abf69 --- /dev/null +++ b/themes/itchy.zsh-theme @@ -0,0 +1,19 @@ +# Created by Daniel Bayerlein https://github.com/danielbayerlein +# Inspired by http://peepcode.com/blog/2012/my-command-line-prompt + +local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" + +local user="%{$fg[cyan]%}%n%{$reset_color%}" +local host="%{$fg[cyan]%}@%m%{$reset_color%}" +local pwd="%{$fg[yellow]%}%~%{$reset_color%}" + +PROMPT='${user}${host} ${pwd} +${smiley} ' + +RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔%{$reset_color%}" + From c23392ac5b9e8655a42e827983ba93636801136b Mon Sep 17 00:00:00 2001 From: jaischeema Date: Tue, 3 Jul 2012 13:02:29 +1000 Subject: [PATCH 03/50] Add new theme : jaischeema --- themes/jaischeema.zsh-theme | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/jaischeema.zsh-theme diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme new file mode 100644 index 000000000..06778216d --- /dev/null +++ b/themes/jaischeema.zsh-theme @@ -0,0 +1,22 @@ +# ------------------------------------------------------------------------------ +# FILE: jaischeema.zsh-theme +# DESCRIPTION: oh-my-zsh theme file. +# AUTHOR: Jais Cheema +# VERSION: 0.0.1 +# ------------------------------------------------------------------------------ + + + +PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$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]%}) " + +if which rbenv &> /dev/null; then + RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}' +else +if which rvm-prompt &> /dev/null; then + RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' +fi From 8d60f9a0d8eaf7f72eb64f600fcecbe48a26300f Mon Sep 17 00:00:00 2001 From: jais Date: Tue, 3 Jul 2012 15:12:55 +1000 Subject: [PATCH 04/50] Fix the rvm gemset right prompt:wq --- themes/jaischeema.zsh-theme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme index 06778216d..aecc5b961 100644 --- a/themes/jaischeema.zsh-theme +++ b/themes/jaischeema.zsh-theme @@ -17,6 +17,7 @@ ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " if which rbenv &> /dev/null; then RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}' else -if which rvm-prompt &> /dev/null; then - RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' + if which rvm-prompt &> /dev/null; then + RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' + fi fi From b979400cff17248147d95f6271edb6f2d6e36c84 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 14:05:22 -0500 Subject: [PATCH 05/50] Starting tmux plugin with basic config variables. --- plugins/tmux/tmux.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/tmux/tmux.plugin.zsh diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh new file mode 100644 index 000000000..cc676cb92 --- /dev/null +++ b/plugins/tmux/tmux.plugin.zsh @@ -0,0 +1,12 @@ +# Configuration variables +# Automatically start tmux +[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART = false +# Automatically connect to a previous session if it exists +[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT = true +# Automatically close the terminal when tmux exits +[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT = true +# Set term to screen or screen-256color based on current terminal support +[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_AUTOCONNECT = true + +# Get the absolute path to the current directory +local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" From 26ee66f179be08fab59d41a0522ad51610125c6c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 17:50:15 -0500 Subject: [PATCH 06/50] Adding main function and alias to tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 37 ++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index cc676cb92..a2f36c0be 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,12 +1,41 @@ # Configuration variables # Automatically start tmux -[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART = false +[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false # Automatically connect to a previous session if it exists -[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT = true +[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true # Automatically close the terminal when tmux exits -[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT = true +[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART # Set term to screen or screen-256color based on current terminal support -[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_AUTOCONNECT = true +[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_AUTOCONNECT=true # Get the absolute path to the current directory local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" + +# Local variable to store the local config file to use, if any. +local fixed_config="" + +# Set the correct local config file to use +if [[ "$ZSH_TMUX_FIXTERM" == "true" ]] +then + if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] + then + fixed_config=$zsh_tmux_plugin_path/tmux.extra.conf + else + fixed_config=$zsh_tmux_plugin_path/tmux.only.conf + fi +fi + +# Override tmux with our function +function zsh_tmux_plugin_start() +{ + if [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] + then + \tmux attach || tmux -f $fixed_config new-session + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + else + \tmux -f $fixed_config + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + fi +} + +alias tmux=zsh_tmux_plugin_start From 3aef6793c2bf0c0afec1fdb97a3a56e7f8d065c6 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 18:05:58 -0500 Subject: [PATCH 07/50] Now checking for 256 color terminal in tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index a2f36c0be..f67c2b8b5 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -11,6 +11,14 @@ # Get the absolute path to the current directory local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" +# Determine if the terminal supports 256 colors +if [[ `tput colors` == "256" ]] +then + export $ZSH_TMUX_TERM="screen-256" +else + export $ZSH_TMUX_TERM="screen" +fi + # Local variable to store the local config file to use, if any. local fixed_config="" From 778ae57772a02d11c393708c4c0644fbd1ffac35 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 18:07:25 -0500 Subject: [PATCH 08/50] Tmux plugin now just runs tmux if any extra args are given. --- plugins/tmux/tmux.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index f67c2b8b5..d8fdd9255 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -36,7 +36,12 @@ fi # Override tmux with our function function zsh_tmux_plugin_start() { - if [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] + # We have other arguments, just run them + if [[ ! -n "$@" ]] + then + \tmux $@ + # Try to connect to an existing session. + elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then \tmux attach || tmux -f $fixed_config new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit From 0cf871d51299a4f837e6dce4d4ae827b0c09f5bd Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 18:08:37 -0500 Subject: [PATCH 09/50] Adding comments to tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index d8fdd9255..48ffc1c27 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -27,8 +27,10 @@ if [[ "$ZSH_TMUX_FIXTERM" == "true" ]] then if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then + #use this when they have a ~/.tmux.conf fixed_config=$zsh_tmux_plugin_path/tmux.extra.conf else + #use this when they don't have a ~/.tmux.conf fixed_config=$zsh_tmux_plugin_path/tmux.only.conf fi fi @@ -45,6 +47,7 @@ function zsh_tmux_plugin_start() then \tmux attach || tmux -f $fixed_config new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + # Just try to fix the TERM variable. else \tmux -f $fixed_config [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit From 45a4db33f81c5dbdcafa25cfe5a75490d55ec185 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 18:09:01 -0500 Subject: [PATCH 10/50] Enabling autostart of tmux in tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 48ffc1c27..8dd208399 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -55,3 +55,8 @@ function zsh_tmux_plugin_start() } alias tmux=zsh_tmux_plugin_start + +if [[ "$ZSH_TMUX_AUTOSTART" == "true" ]] +then + zsh_tmux_plugin_start +fi From bf40d4e354ce33c0d9f42cc64372461bff14cde8 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 18:09:17 -0500 Subject: [PATCH 11/50] Adding helper tmux config files to tmux plugin. --- plugins/tmux/tmux.extra.conf | 2 ++ plugins/tmux/tmux.only.conf | 1 + 2 files changed, 3 insertions(+) create mode 100644 plugins/tmux/tmux.extra.conf create mode 100644 plugins/tmux/tmux.only.conf diff --git a/plugins/tmux/tmux.extra.conf b/plugins/tmux/tmux.extra.conf new file mode 100644 index 000000000..beffd380c --- /dev/null +++ b/plugins/tmux/tmux.extra.conf @@ -0,0 +1,2 @@ +set -g default-terminal $ZSH_TMUX_TERM +source $HOME/.tmux.conf diff --git a/plugins/tmux/tmux.only.conf b/plugins/tmux/tmux.only.conf new file mode 100644 index 000000000..0734df3e1 --- /dev/null +++ b/plugins/tmux/tmux.only.conf @@ -0,0 +1 @@ +set -g default-terminal $ZSH_TMUX_TERM From 7b15627851983e63a5756f0b3633938c44ed7a7d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 21:47:11 -0500 Subject: [PATCH 12/50] Fixing typos, logic, and gremlins in tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 8dd208399..46c142b77 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -6,7 +6,7 @@ # Automatically close the terminal when tmux exits [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART # Set term to screen or screen-256color based on current terminal support -[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_AUTOCONNECT=true +[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true # Get the absolute path to the current directory local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" @@ -14,49 +14,50 @@ local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" # Determine if the terminal supports 256 colors if [[ `tput colors` == "256" ]] then - export $ZSH_TMUX_TERM="screen-256" + export ZSH_TMUX_TERM="screen-256color" else - export $ZSH_TMUX_TERM="screen" + export ZSH_TMUX_TERM="screen" fi # Local variable to store the local config file to use, if any. local fixed_config="" -# Set the correct local config file to use +# Set the correct local config file to use. if [[ "$ZSH_TMUX_FIXTERM" == "true" ]] then if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then #use this when they have a ~/.tmux.conf - fixed_config=$zsh_tmux_plugin_path/tmux.extra.conf + fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" else #use this when they don't have a ~/.tmux.conf - fixed_config=$zsh_tmux_plugin_path/tmux.only.conf + fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" fi fi -# Override tmux with our function -function zsh_tmux_plugin_start() +# Wrapper function for tmux. +function zsh_tmux_plugin_run() { # We have other arguments, just run them - if [[ ! -n "$@" ]] + if [[ -n "$@" ]] then \tmux $@ # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux attach || tmux -f $fixed_config new-session + \tmux attach || \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit - # Just try to fix the TERM variable. + # Just run tmux, fixing the TERM variable if requested. else - \tmux -f $fixed_config + \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit fi } +# Alias tmux to our wrapper function. alias tmux=zsh_tmux_plugin_start if [[ "$ZSH_TMUX_AUTOSTART" == "true" ]] then - zsh_tmux_plugin_start + zsh_tmux_plugin_run fi From 43c50f03e3c547ec51feef7ae3c99f734a66e6a6 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 21:52:26 -0500 Subject: [PATCH 13/50] Checking environment instead of local variable for fixing term in tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 46c142b77..9a52e6376 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -23,16 +23,13 @@ fi local fixed_config="" # Set the correct local config file to use. -if [[ "$ZSH_TMUX_FIXTERM" == "true" ]] +if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then - if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] - then - #use this when they have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" - else - #use this when they don't have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" - fi + #use this when they have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" +else + #use this when they don't have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" fi # Wrapper function for tmux. @@ -45,11 +42,11 @@ function zsh_tmux_plugin_run() # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux attach || \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` new-session + \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit # Just run tmux, fixing the TERM variable if requested. else - \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` + \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit fi } From f096644c751cb7fe566e82de531435a405d76be8 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 22:03:22 -0500 Subject: [PATCH 14/50] Checking if already in tmux before autostarting in tmux in tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 9a52e6376..8bdd92133 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -54,7 +54,7 @@ function zsh_tmux_plugin_run() # Alias tmux to our wrapper function. alias tmux=zsh_tmux_plugin_start -if [[ "$ZSH_TMUX_AUTOSTART" == "true" ]] +if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] then zsh_tmux_plugin_run fi From 691630a89586c86dfafa32974c5c6dbaa1356c07 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 22:18:36 -0500 Subject: [PATCH 15/50] Adding option to prevent autostarting tmux more than once in the same session. --- plugins/tmux/tmux.plugin.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 8bdd92133..a7bf93dbd 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,6 +1,10 @@ # Configuration variables +# # Automatically start tmux [[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false +# Only autostart once. If set to false, tmux will attempt to +# autostart every time your zsh configs are reloaded. +[[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true # Automatically connect to a previous session if it exists [[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true # Automatically close the terminal when tmux exits @@ -8,6 +12,7 @@ # Set term to screen or screen-256color based on current terminal support [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true + # Get the absolute path to the current directory local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" @@ -54,7 +59,13 @@ function zsh_tmux_plugin_run() # Alias tmux to our wrapper function. alias tmux=zsh_tmux_plugin_start +# Autostart if not already in tmux and enabled. if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] then - zsh_tmux_plugin_run + # Actually don't autostart if we already did and multiple autostarts are disabled. + if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]] + then + export ZSH_TMUX_AUTOSTARTED=true + zsh_tmux_plugin_run + fi fi From 56c46c4ed8339c66c671927c197eb4511b5a664c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 22:55:18 -0500 Subject: [PATCH 16/50] Fixing typo in alias. --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index a7bf93dbd..982f87356 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -57,7 +57,7 @@ function zsh_tmux_plugin_run() } # Alias tmux to our wrapper function. -alias tmux=zsh_tmux_plugin_start +alias tmux=zsh_tmux_plugin_run # Autostart if not already in tmux and enabled. if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] From 86c9b32031dc28b4c6a641a4475e0e55c7ff32e5 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 22:57:37 -0500 Subject: [PATCH 17/50] Adding compdef to maintain tmux completions. --- plugins/tmux/tmux.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 982f87356..5c4076904 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -56,6 +56,9 @@ function zsh_tmux_plugin_run() fi } +# Use the completions for tmux for our function +compdef _tmux zsh_tmux_plugin_run + # Alias tmux to our wrapper function. alias tmux=zsh_tmux_plugin_run From 4e8681c6e19f77a9b54ceee5934e3356e4ffb207 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 23:35:45 -0500 Subject: [PATCH 18/50] Adding options to choose tmux TERM for 256 and non-256 color terminals. This may be needed on systems that don't have the proper terminfo for screen and/or screen-256color. Otherwise the defaults of screen and screen-256color should be fine. --- plugins/tmux/tmux.plugin.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 5c4076904..be92fe096 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -11,6 +11,14 @@ [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART # Set term to screen or screen-256color based on current terminal support [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true +# The TERM to use for non-256 color terminals. +# Tmux states this should be screen, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" +# The TERM to use for 256 color terminals. +# Tmux states this should be screen-256color, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" # Get the absolute path to the current directory @@ -19,9 +27,9 @@ local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" # Determine if the terminal supports 256 colors if [[ `tput colors` == "256" ]] then - export ZSH_TMUX_TERM="screen-256color" + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else - export ZSH_TMUX_TERM="screen" + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR fi # Local variable to store the local config file to use, if any. From f0a920df5a4a5e5260ef45daf27d42a15cd75217 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 27 Feb 2013 10:21:19 -0500 Subject: [PATCH 19/50] Checking to make sure tmux is actually installed before running plugin. If it is not found an error message is printed. --- plugins/tmux/tmux.plugin.zsh | 152 ++++++++++++++++++----------------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index be92fe096..6f0d5902a 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,82 +1,88 @@ -# Configuration variables -# -# Automatically start tmux -[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false -# Only autostart once. If set to false, tmux will attempt to -# autostart every time your zsh configs are reloaded. -[[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true -# Automatically connect to a previous session if it exists -[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true -# Automatically close the terminal when tmux exits -[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART -# Set term to screen or screen-256color based on current terminal support -[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true -# The TERM to use for non-256 color terminals. -# Tmux states this should be screen, but you may need to change it on -# systems without the proper terminfo -[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" -# The TERM to use for 256 color terminals. -# Tmux states this should be screen-256color, but you may need to change it on -# systems without the proper terminfo -[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" - - -# Get the absolute path to the current directory -local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" - -# Determine if the terminal supports 256 colors -if [[ `tput colors` == "256" ]] -then - export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR -else - export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR -fi - -# Local variable to store the local config file to use, if any. -local fixed_config="" - -# Set the correct local config file to use. -if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] -then - #use this when they have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" -else - #use this when they don't have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" -fi - -# Wrapper function for tmux. -function zsh_tmux_plugin_run() -{ - # We have other arguments, just run them - if [[ -n "$@" ]] +# Only run if tmux is actually installed +if which tmux &> /dev/null then - \tmux $@ - # Try to connect to an existing session. - elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] + # Configuration variables + # + # Automatically start tmux + [[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false + # Only autostart once. If set to false, tmux will attempt to + # autostart every time your zsh configs are reloaded. + [[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true + # Automatically connect to a previous session if it exists + [[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true + # Automatically close the terminal when tmux exits + [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART + # Set term to screen or screen-256color based on current terminal support + [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true + # The TERM to use for non-256 color terminals. + # Tmux states this should be screen, but you may need to change it on + # systems without the proper terminfo + [[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" + # The TERM to use for 256 color terminals. + # Tmux states this should be screen-256color, but you may need to change it on + # systems without the proper terminfo + [[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" + + + # Get the absolute path to the current directory + local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" + + # Determine if the terminal supports 256 colors + if [[ `tput colors` == "256" ]] then - \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit - # Just run tmux, fixing the TERM variable if requested. + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else - \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR fi -} -# Use the completions for tmux for our function -compdef _tmux zsh_tmux_plugin_run + # Local variable to store the local config file to use, if any. + local fixed_config="" -# Alias tmux to our wrapper function. -alias tmux=zsh_tmux_plugin_run - -# Autostart if not already in tmux and enabled. -if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] -then - # Actually don't autostart if we already did and multiple autostarts are disabled. - if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]] + # Set the correct local config file to use. + if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then - export ZSH_TMUX_AUTOSTARTED=true - zsh_tmux_plugin_run + #use this when they have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" + else + #use this when they don't have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" fi + + # Wrapper function for tmux. + function zsh_tmux_plugin_run() + { + # We have other arguments, just run them + if [[ -n "$@" ]] + then + \tmux $@ + # Try to connect to an existing session. + elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] + then + \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + # Just run tmux, fixing the TERM variable if requested. + else + \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + fi + } + + # Use the completions for tmux for our function + compdef _tmux zsh_tmux_plugin_run + + # Alias tmux to our wrapper function. + alias tmux=zsh_tmux_plugin_run + + # Autostart if not already in tmux and enabled. + if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] + then + # Actually don't autostart if we already did and multiple autostarts are disabled. + if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]] + then + export ZSH_TMUX_AUTOSTARTED=true + zsh_tmux_plugin_run + fi + fi +else + print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." fi From 6dd286bba3fe36278ca6de45567c3842e2db7cc0 Mon Sep 17 00:00:00 2001 From: Vladimir Zakharov Date: Mon, 11 Mar 2013 14:24:12 +0400 Subject: [PATCH 20/50] Mercurial: add aliases for 'incoming' and 'outgoing' commands --- plugins/mercurial/mercurial.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index a3a6ff8b6..820e1aee9 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -7,7 +7,9 @@ alias hgco='hg checkout' alias hgd='hg diff' alias hged='hg diffmerge' # pull and update +alias hgi='hg incoming' alias hgl='hg pull -u' +alias hgo='hg outgoing' alias hgp='hg push' alias hgs='hg status' # this is the 'git commit --amend' equivalent @@ -17,4 +19,4 @@ function hg_current_branch() { if [ -d .hg ]; then echo hg:$(hg branch) fi -} \ No newline at end of file +} From 72ec24108a88d79a13cc3581f17b440418048a72 Mon Sep 17 00:00:00 2001 From: bertag Date: Mon, 11 Mar 2013 13:41:32 -0600 Subject: [PATCH 21/50] Tweaked parse_git_dirty() in lib/git.zsh to support proper dirty/clean parsing against both git 1.6 and git 1.7+ --- lib/git.zsh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 3e14695bd..172bf4f7a 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -9,16 +9,19 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' + local GIT_STATUS='' + local CLEAN_MESSAGE='nothing to commit (working directory clean)' if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; 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 + fi + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) + if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" - fi - fi + fi + fi } # get the difference between the local and remote branches From 300f94cb0e1121e7796edbedcbc6d686e755be5b Mon Sep 17 00:00:00 2001 From: Spencer Rinehart Date: Tue, 12 Mar 2013 13:11:18 -0400 Subject: [PATCH 22/50] Use [ -nt ] instead of stat -f%m to check cache files. --- plugins/ant/ant.plugin.zsh | 16 +++------------- plugins/cake/cake.plugin.zsh | 11 ++++------- plugins/gradle/gradle.plugin.zsh | 19 +++---------------- plugins/phing/phing.plugin.zsh | 9 +++------ 4 files changed, 13 insertions(+), 42 deletions(-) diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh index 691d4d2db..45f2b06eb 100644 --- a/plugins/ant/ant.plugin.zsh +++ b/plugins/ant/ant.plugin.zsh @@ -1,17 +1,7 @@ -stat -f%m . > /dev/null 2>&1 -if [ "$?" = 0 ]; then - stat_cmd=(stat -f%m) -else - stat_cmd=(stat -L --format=%Y) -fi - _ant_does_target_list_need_generating () { - if [ ! -f .ant_targets ]; then return 0; - else - accurate=$($stat_cmd .ant_targets) - changed=$($stat_cmd build.xml) - return $(expr $accurate '>=' $changed) - fi + [ ! -f .ant_targets ] && return 0; + [ .ant_targets -nt build.xml ] && return 0; + return 1; } _ant () { diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh index 1d0d196ee..44cc47470 100644 --- a/plugins/cake/cake.plugin.zsh +++ b/plugins/cake/cake.plugin.zsh @@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () { return 1; fi - if [ ! -f ${_cake_task_cache_file} ]; then return 0; - else - accurate=$(stat -f%m $_cake_task_cache_file) - changed=$(stat -f%m Cakefile) - return $(expr $accurate '>=' $changed) - fi + [ ! -f ${_cake_task_cache_file} ] && return 0; + [ ${_cake_task_cache_file} -nt Cakefile ] && return 0; + return 1; } _cake () { @@ -33,4 +30,4 @@ _cake () { fi } -compdef _cake cake \ No newline at end of file +compdef _cake cake diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index fc4c78c50..9229512f7 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -54,27 +54,14 @@ function in_gradle() { 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 + [ ! -f .gradletasknamecache ] && return 0; + [ .gradletasknamecache -nt build.gradle ] && return 0; + return 1; } diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh index 8f4adca08..1abf0a954 100644 --- a/plugins/phing/phing.plugin.zsh +++ b/plugins/phing/phing.plugin.zsh @@ -1,10 +1,7 @@ _phing_does_target_list_need_generating () { - if [ ! -f .phing_targets ]; then return 0; - else - accurate=$(stat -f%m .phing_targets) - changed=$(stat -f%m build.xml) - return $(expr $accurate '>=' $changed) - fi + [ ! -f .phing_targets ] && return 0; + [ .phing_targets -nt build.xml ] && return 0; + return 1; } _phing () { From bdf4f5a347789069dda438e64467344b551fff00 Mon Sep 17 00:00:00 2001 From: Spencer Rinehart Date: Tue, 12 Mar 2013 13:15:05 -0400 Subject: [PATCH 23/50] Allow ":" and "-" characters in phing tasks. Tasks that included hyphens or colons were being excluded from completion. This improves the usage for this. --- plugins/phing/phing.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh index 1abf0a954..795f1db85 100644 --- a/plugins/phing/phing.plugin.zsh +++ b/plugins/phing/phing.plugin.zsh @@ -7,7 +7,7 @@ _phing_does_target_list_need_generating () { _phing () { if [ -f build.xml ]; then if _phing_does_target_list_need_generating; then - phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets + phing -l |grep -v ":$" |grep -v "^-*$" > .phing_targets fi compadd `cat .phing_targets` fi From 4bf174c38b2b8ff9b000accf63155d9756c63a02 Mon Sep 17 00:00:00 2001 From: hacfi Date: Wed, 13 Mar 2013 04:06:16 +0100 Subject: [PATCH 24/50] Autocomplete composer default methods if composer.json is not available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This plugin currently doesn't autocomplete composer commands if there is no composer.json in the current dir. However, the commands create-project, init, search, selfupdate and show are still useful without a composer.json! --- plugins/composer/composer.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index c9b762d07..639677ba6 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -13,6 +13,8 @@ _composer_get_command_list () { _composer () { if [ -f composer.json ]; then compadd `_composer_get_command_list` + else + compadd create-project init search selfupdate show fi } @@ -26,4 +28,4 @@ alias ci='composer install' alias ccp='composer create-project' # install composer in the current directory -alias cget='curl -s https://getcomposer.org/installer | php' \ No newline at end of file +alias cget='curl -s https://getcomposer.org/installer | php' From 1cfd813f796e4472575daf4b51cd816bacc833e0 Mon Sep 17 00:00:00 2001 From: rylwin Date: Wed, 13 Mar 2013 22:48:28 -0500 Subject: [PATCH 25/50] last-working-dir: Use >! to overwrite $cache_file Use ">!" to overwrite $cache_file in case noclobber is set. When noclobber is set, zsh will not allow the use of ">" to overwrite the contents of a file. Instead, it displays a "file exists" error. By using ">!" instead, we tell zsh to overwrite the file without complaining. --- plugins/last-working-dir/last-working-dir.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 190bc279d..4903616e3 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -9,7 +9,8 @@ local cache_file="$ZSH/cache/last-working-dir" # Updates the last directory once directory is changed. function chpwd() { - echo "$PWD" > "$cache_file" + # Use >! in case noclobber is set to avoid "file exists" error + echo "$PWD" >! "$cache_file" } # Changes directory to the last working directory. From 4c8bba57acb0f64edde89321d5d6cbc3a5226cac Mon Sep 17 00:00:00 2001 From: Ryan Winograd Date: Wed, 13 Mar 2013 22:51:12 -0500 Subject: [PATCH 26/50] Fix whitespace That's what I get for using GitHub text editor and not checking tabs. --- plugins/last-working-dir/last-working-dir.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 4903616e3..ccf0f5b22 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -9,7 +9,7 @@ local cache_file="$ZSH/cache/last-working-dir" # Updates the last directory once directory is changed. function chpwd() { - # Use >! in case noclobber is set to avoid "file exists" error + # Use >! in case noclobber is set to avoid "file exists" error echo "$PWD" >! "$cache_file" } From f7f487c42666adfe7b94ebed4714ed212ed22cb9 Mon Sep 17 00:00:00 2001 From: Ben Marshall-Corser Date: Sun, 17 Mar 2013 23:00:12 +0000 Subject: [PATCH 27/50] Alias for commit and commit all with amend For the lazy and forgetful. Don't worry, a bang is fine in an alias and completion. :tada: --- plugins/git/git.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 154aa6db1..15f901f86 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -14,8 +14,12 @@ gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' compdef _git gc=git-commit +alias gc!='git commit -v --amend' +compdef _git gc!=git-commit alias gca='git commit -v -a' -compdef _git gca=git-commit +compdef _git gc=git-commit +alias gca!='git commit -v -a --amend' +compdef _git gca!=git-commit alias gco='git checkout' compdef _git gco=git-checkout alias gcm='git checkout master' From a91872df35d15f0544339ae9c61f87e761c19827 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Mar 2013 19:41:34 +0000 Subject: [PATCH 28/50] Prefixing tmux wrapper function with '_'. --- plugins/tmux/tmux.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 6f0d5902a..ea6b4d26c 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -49,7 +49,7 @@ if which tmux &> /dev/null fi # Wrapper function for tmux. - function zsh_tmux_plugin_run() + function _zsh_tmux_plugin_run() { # We have other arguments, just run them if [[ -n "$@" ]] @@ -68,10 +68,10 @@ if which tmux &> /dev/null } # Use the completions for tmux for our function - compdef _tmux zsh_tmux_plugin_run + compdef _tmux _zsh_tmux_plugin_run # Alias tmux to our wrapper function. - alias tmux=zsh_tmux_plugin_run + alias tmux=_zsh_tmux_plugin_run # Autostart if not already in tmux and enabled. if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] @@ -80,7 +80,7 @@ if which tmux &> /dev/null if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]] then export ZSH_TMUX_AUTOSTARTED=true - zsh_tmux_plugin_run + _zsh_tmux_plugin_run fi fi else From 19ae0b576c4fd0c0c4af1a5c491df867fdce39a4 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Mar 2013 19:42:05 +0000 Subject: [PATCH 29/50] Exporting path to fixed config as a global variable. This is done to fix compatibility with antigen. To keep with convention, the variable has been renamed to be in all caps. --- plugins/tmux/tmux.plugin.zsh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index ea6b4d26c..465f5b053 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -35,17 +35,14 @@ if which tmux &> /dev/null export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR fi - # Local variable to store the local config file to use, if any. - local fixed_config="" - # Set the correct local config file to use. if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then #use this when they have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" + export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf" else #use this when they don't have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" + export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf" fi # Wrapper function for tmux. @@ -58,11 +55,11 @@ if which tmux &> /dev/null # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session + \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit # Just run tmux, fixing the TERM variable if requested. else - \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` + \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit fi } From 295bac03297b3909712cdf68b3cc388d5b6feb5e Mon Sep 17 00:00:00 2001 From: Vladimir Zakharov Date: Wed, 27 Mar 2013 10:16:46 +0400 Subject: [PATCH 30/50] Mercurial: add alias for pull with rebasing --- plugins/mercurial/mercurial.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index 820e1aee9..30e4be5b5 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -9,6 +9,7 @@ alias hged='hg diffmerge' # pull and update alias hgi='hg incoming' alias hgl='hg pull -u' +alias hglr='hg pull --rebase' alias hgo='hg outgoing' alias hgp='hg push' alias hgs='hg status' From c89afd2f6a7221152648c7c0e32879dfc98cad5b Mon Sep 17 00:00:00 2001 From: "Simeon F. Willbanks" Date: Tue, 11 Dec 2012 11:17:32 -0800 Subject: [PATCH 31/50] Fixes #1485 zeus should not be bundled --- plugins/bundler/bundler.plugin.zsh | 2 +- plugins/zeus/zeus.plugin.zsh | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 10c221acd..bc21da134 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 rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus) +bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma) ## Functions diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh index 1658b34d3..eddfb4f94 100644 --- a/plugins/zeus/zeus.plugin.zsh +++ b/plugins/zeus/zeus.plugin.zsh @@ -2,12 +2,6 @@ # Zeus preloads your Rails environment and forks that process whenever # needed. This effectively speeds up Rails' boot process to under 1 sec. -# Always use bundler. -# Rails depends on bundler, so we can be pretty sure, that there are no -# problems with this command. For all the other aliases I provided an -# alternative, in case people have conflicts with other plugins (e.g. suse). -alias zeus='bundle exec zeus' - # Init alias zi='zeus init' alias zinit='zeus init' From fc67399843f26d4f7851fa0b7727183f138bdfa2 Mon Sep 17 00:00:00 2001 From: lesmyrmidons Date: Fri, 29 Mar 2013 13:35:35 +0100 Subject: [PATCH 32/50] Simplification name aliases and adding new alias --- plugins/symfony2/symfony2.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index cc9ffebc0..10406c5c0 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -14,6 +14,8 @@ compdef _symfony2 app/console compdef _symfony2 sf #Alias -alias sf2='php app/console' -alias sf2clear='php app/console cache:clear' +alias sfc='php app/console' +alias sfcl='php app/console cache:clear' +alias sfcroute='php app/console router:debug' +alias sfcgb='php app/console generate:bundle' From 55da480da17701531daf6874e17cabf460c9a75a Mon Sep 17 00:00:00 2001 From: lesmyrmidons Date: Fri, 29 Mar 2013 16:39:18 +0100 Subject: [PATCH 33/50] modify alias sfc => sf --- plugins/symfony2/symfony2.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 10406c5c0..45d6165aa 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -14,8 +14,8 @@ compdef _symfony2 app/console compdef _symfony2 sf #Alias -alias sfc='php app/console' +alias sf='php app/console' alias sfcl='php app/console cache:clear' -alias sfcroute='php app/console router:debug' -alias sfcgb='php app/console generate:bundle' +alias sfroute='php app/console router:debug' +alias sfgb='php app/console generate:bundle' From af8d8df36cee517c55449e6aaeaa2f60a94ac9f8 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Sat, 30 Mar 2013 16:00:40 +0100 Subject: [PATCH 34/50] Add colored man plugin. --- plugins/colored-man/colored-man.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/colored-man/colored-man.plugin.zsh diff --git a/plugins/colored-man/colored-man.plugin.zsh b/plugins/colored-man/colored-man.plugin.zsh new file mode 100644 index 000000000..56056284a --- /dev/null +++ b/plugins/colored-man/colored-man.plugin.zsh @@ -0,0 +1,11 @@ +man() { + env \ + LESS_TERMCAP_mb=$(printf "\e[1;31m") \ + LESS_TERMCAP_md=$(printf "\e[1;31m") \ + LESS_TERMCAP_me=$(printf "\e[0m") \ + LESS_TERMCAP_se=$(printf "\e[0m") \ + LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[1;32m") \ + man "$@" +} From 3ad05df020f4ad672d99a325304a1c962991fd64 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Sat, 30 Mar 2013 16:01:31 +0100 Subject: [PATCH 35/50] Add 'kiwi' theme --- themes/kiwi.zsh-theme | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 themes/kiwi.zsh-theme diff --git a/themes/kiwi.zsh-theme b/themes/kiwi.zsh-theme new file mode 100644 index 000000000..f93de2b75 --- /dev/null +++ b/themes/kiwi.zsh-theme @@ -0,0 +1,12 @@ +# +# Kiwi ZSH Theme +# + +PROMPT='%{$fg_bold[green]%}┌[%{$fg_bold[cyan]%}kiwish-4.2%{$fg_bold[green]%}]-(%{$fg_bold[white]%}%2~%{$fg_bold[green]%})-$(git_prompt_info)$(svn_prompt_info)$(battery_pct_prompt) +└> % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}git:%{$fg_bold[white]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[green]%}]-" + +ZSH_THEME_SVN_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}svn:%{$fg_bold[white]%}/" +ZSH_THEME_SVN_PROMPT_SUFFIX="%{$fg_bold[green]%}]-" From 8d6b7573e77abf2fb114579806e6e749bef5eca5 Mon Sep 17 00:00:00 2001 From: Rostislav Raykov Date: Sun, 31 Mar 2013 15:49:51 +0200 Subject: [PATCH 36/50] Powify autocomplete --- plugins/powify/_powify | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/powify/_powify diff --git a/plugins/powify/_powify b/plugins/powify/_powify new file mode 100644 index 000000000..d23c46513 --- /dev/null +++ b/plugins/powify/_powify @@ -0,0 +1,55 @@ +#compdef powify + +_powify_all_servers() { + all_servers=(`ls $HOME/.pow/`) +} + +local -a all_servers + +local -a _1st_arguments +_1st_arguments=( + 'server:server specific commands' + 'utils:manage powify' + 'create:creates a pow app from the current directory (to change the name append name as an argument)' + 'destroy:destroys the pow app linked to the current directory' + 'restart:restarts the pow app linked to the current directory' + 'always_restart:reload the pow app after each request' + 'always_restart_off:do not reload the pow app after each request' + 'rename:rename the current pow app to [NAME] or renmae [OLD] to [NEW]' + 'environment:run the this pow app in a different environment (aliased `env`)' + 'browse:opens and navigates the default browser to this app' + 'logs:tail the application logs' +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "powify command" _1st_arguments + return +fi + +case "$words[1]" in + server) + _values \ + 'install[install pow server]' \ + 'reinstall[reinstall pow server]' \ + 'update[update pow server]' \ + 'uninstall[uninstall pow server]' \ + 'list[list all pow apps]' \ + 'start[start the pow server]' \ + 'stop[stop the pow server]' \ + 'restart[restart the pow server]' \ + 'host[adds all pow apps to /etc/hosts file]' \ + 'unhost[removes all pow apps from /etc/hosts file]' \ + 'status[print the current server status]' \ + 'config[print the current server configuration]' \ + 'logs[tails the pow server logs]' ;; + utils) + _values \ + 'install[install powify.dev server management tool]' \ + 'reinstall[reinstall powify.dev server management tool]' \ + 'uninstall[uninstall powify.dev server management tool]' ;; + destroy|restart|always_restart|always_restart_off|rename|browse|logs) + _powify_all_servers + _wanted all_servers expl 'all pow servers' compadd -a all_servers ;; +esac From b7608bf32de06a546ae509f872bba44a46e10f0a Mon Sep 17 00:00:00 2001 From: Adam Krebs Date: Mon, 1 Apr 2013 00:26:39 -0400 Subject: [PATCH 37/50] add bower autocompletion --- plugins/bower/_bower | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 plugins/bower/_bower diff --git a/plugins/bower/_bower b/plugins/bower/_bower new file mode 100644 index 000000000..1b582a55e --- /dev/null +++ b/plugins/bower/_bower @@ -0,0 +1,58 @@ + + +# Credits to npm's. Awesome completion utility. +# +# Bower completion script, based on npm completion script. + +###-begin-bower-completion-### +# +# Installation: bower completion >> ~/.bashrc (or ~/.zshrc) +# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/npm +# + +COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} +COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} +export COMP_WORDBREAKS + +if type complete &>/dev/null; then + _bower_completion () { + local si="$IFS" + IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ + COMP_LINE="$COMP_LINE" \ + COMP_POINT="$COMP_POINT" \ + bower completion -- "${COMP_WORDS[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + complete -F _bower_completion bower +elif type compdef &>/dev/null; then + _bower_completion() { + si=$IFS + compadd -- $(COMP_CWORD=$((CURRENT-1)) \ + COMP_LINE=$BUFFER \ + COMP_POINT=0 \ + bower completion -- "${words[@]}" \ + 2>/dev/null) + IFS=$si + } + compdef _bower_completion bower +elif type compctl &>/dev/null; then + _bower_completion () { + local cword line point words si + read -Ac words + read -cn cword + let cword-=1 + read -l line + read -ln point + si="$IFS" + IFS=$'\n' reply=($(COMP_CWORD="$cword" \ + COMP_LINE="$line" \ + COMP_POINT="$point" \ + bower completion -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + compctl -K _bower_completion bower +fi +###-end-bower-completion-### + From f9722174f72f3eb184159e7c77751472cb73384e Mon Sep 17 00:00:00 2001 From: Adam Krebs Date: Mon, 1 Apr 2013 00:30:35 -0400 Subject: [PATCH 38/50] fix some references from npm --> bower. --- plugins/bower/_bower | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 plugins/bower/_bower diff --git a/plugins/bower/_bower b/plugins/bower/_bower old mode 100644 new mode 100755 index 1b582a55e..ae0ca4a4e --- a/plugins/bower/_bower +++ b/plugins/bower/_bower @@ -1,13 +1,13 @@ -# Credits to npm's. Awesome completion utility. +# Credits to npm's awesome completion utility. # # Bower completion script, based on npm completion script. ###-begin-bower-completion-### # # Installation: bower completion >> ~/.bashrc (or ~/.zshrc) -# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/npm +# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/bower # COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} From 5c1c536015ea3e87acc19653faf537c0fb22b7ba Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Mon, 1 Apr 2013 13:34:59 -0700 Subject: [PATCH 39/50] allowing you to override knife paths --- plugins/knife/_knife | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index dec491257..ca6347957 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -170,11 +170,13 @@ _chef_environments_remote() { # 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() { - local knife_rb="$HOME/.chef/knife.rb" - if [ -f ./.chef/knife.rb ]; then - knife_rb="./.chef/knife.rb" - fi - (for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done) + + local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb} + if [ -f ./.chef/knife.rb ]; then + knife_rb="./.chef/knife.rb" + fi + local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )} + (for i in $cookbook_path; do ls $i; done) } # This function extracts the available cookbook versions on the chef server From 520b0132e943252409457b550b39d8821663da7a Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Mon, 1 Apr 2013 13:44:53 -0700 Subject: [PATCH 40/50] adding docs about knife path config variables --- plugins/knife/_knife | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index ca6347957..9f5b406af 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -1,5 +1,10 @@ #compdef knife +# You can override the path to knife.rb and your cookbooks by setting +# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb +# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks +# Read around where these are used for more detail. + # These flags should be available everywhere according to man knife knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes ) From 48c0f6c2941941815bcccbed1b329f98b13c43c0 Mon Sep 17 00:00:00 2001 From: Justin Clayton Date: Tue, 2 Apr 2013 18:18:01 -0700 Subject: [PATCH 41/50] Update _vagrant updated to match new vagrant 1.1.x command list --- plugins/vagrant/_vagrant | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 9bed1e3c6..9af8cb036 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -8,18 +8,19 @@ _1st_arguments=( 'box:Box commands' 'destroy:Destroys the vagrant environment' 'halt:Halts the currently running vagrant environment' - 'help:[TASK] Describe available tasks or one specific task' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' 'package:Packages a vagrant environment for distribution' + 'plugin:Plugin commands' 'provision:Run the provisioner' 'reload:Reload the vagrant environment' 'resume:Resumes a suspend vagrant environment' 'ssh:SSH into the currently running environment' - 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' + 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' 'status:Shows the status of the current Vagrant environment.' 'suspend:Suspends the currently running vagrant environment' 'up:Creates the vagrant environment' - 'version:Prints the Vagrant version information' + '--help:[TASK] Describe available tasks or one specific task' + '--version:Prints the Vagrant version information' ) local -a _box_arguments From 8e368c1222a9ccd9203c6f19eba9db61bf4c27f8 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Wed, 3 Apr 2013 16:43:22 +0300 Subject: [PATCH 42/50] added hub autocomplete instructions --- plugins/github/github.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 598b059c1..66a10cfdb 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,5 +1,22 @@ # Setup hub function for git, if it is available; http://github.com/defunkt/hub if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then + # Autoload _git completion functions + if declare -f _git > /dev/null; then + _git + fi + + if declare -f _git_commands > /dev/null; then + _hub_commands=( + 'alias:show shell instructions for wrapping git' + 'pull-request:open a pull request on GitHub' + 'fork:fork origin repo on GitHub' + 'create:create new repo on GitHub for the current project' + 'browse:browse the project on GitHub' + 'compare:open GitHub compare view' + ) + # Extend the '_git_commands' function with hub commands + eval "$(declare -f _git_commands | sed -e 's/base_commands=(/base_commands=(${_hub_commands} /')" + fi # eval `hub alias -s zsh` function git(){ if ! (( $+_has_working_hub )); then From 889045068465c3aac25b212b80b07f3f1755d937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 3 Apr 2013 20:41:05 -0400 Subject: [PATCH 43/50] This fixes checking for git untracked items The grep expression was incorrect for normal grep. Adding the `-E` option fixed the escaping of the question marks. --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 67075248e..98c00bd8a 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -62,7 +62,7 @@ function git_prompt_long_sha() { git_prompt_status() { INDEX=$(git status --porcelain -b 2> /dev/null) STATUS="" - if $(echo "$INDEX" | grep '^\?\? ' &> /dev/null); then + if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" fi if $(echo "$INDEX" | grep '^A ' &> /dev/null); then From 0707bfce5386eb7ad83e6ad8d0b09358916eeb64 Mon Sep 17 00:00:00 2001 From: Sergio Rafael Gianazza Date: Thu, 4 Apr 2013 16:18:48 -0300 Subject: [PATCH 44/50] New theme: Gianu Theme I created a theme that I feel confortable with and want to share with everyone. The prompt format is: @ ()$ --- themes/gianu.zsh-theme | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 themes/gianu.zsh-theme diff --git a/themes/gianu.zsh-theme b/themes/gianu.zsh-theme new file mode 100644 index 000000000..2eb4520ce --- /dev/null +++ b/themes/gianu.zsh-theme @@ -0,0 +1,11 @@ +# Oh-my-Zsh prompt created by gianu +# +# github.com/gianu +# sgianazza@gmail.com + +PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}]$ ' + +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" From c8423eb6d7149b9e73a94f4bf0c754771e27530a Mon Sep 17 00:00:00 2001 From: Sergio Rafael Gianazza Date: Thu, 4 Apr 2013 18:11:37 -0300 Subject: [PATCH 45/50] Removed colors from parenthesis. --- themes/gianu.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/gianu.zsh-theme b/themes/gianu.zsh-theme index 2eb4520ce..c7fe40665 100644 --- a/themes/gianu.zsh-theme +++ b/themes/gianu.zsh-theme @@ -3,9 +3,9 @@ # github.com/gianu # sgianazza@gmail.com -PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}]$ ' +PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ ' -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" +ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}" From 6271941a919858a05e9abec120db90ca0c131153 Mon Sep 17 00:00:00 2001 From: dsx Date: Sun, 7 Apr 2013 09:12:30 -0400 Subject: [PATCH 46/50] Prevents echo of _sublime_darwin_paths contents --- 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 bfbc45a07..7a5ada337 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,6 +1,6 @@ # Sublime Text 2 Aliases -local _sublime_darwin_paths +local _sublime_darwin_paths > /dev/null 2>&1 _sublime_darwin_paths=( "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" From fc785de97b7ed1438b4d0e46d29079fb97a55338 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sun, 7 Apr 2013 17:18:39 -0700 Subject: [PATCH 47/50] +safe-paste plugin --- plugins/safe-paste/safe-paste.plugin.zsh | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/safe-paste/safe-paste.plugin.zsh diff --git a/plugins/safe-paste/safe-paste.plugin.zsh b/plugins/safe-paste/safe-paste.plugin.zsh new file mode 100644 index 000000000..0aa97965f --- /dev/null +++ b/plugins/safe-paste/safe-paste.plugin.zsh @@ -0,0 +1,54 @@ +# Code from Mikael Magnusson: http://www.zsh.org/mla/users/2011/msg00367.html +# +# Requires xterm, urxvt, iTerm2 or any other terminal that supports bracketed +# paste mode as documented: http://www.xfree86.org/current/ctlseqs.html + +# create a new keymap to use while pasting +bindkey -N paste +# make everything in this keymap call our custom widget +bindkey -R -M paste "^@"-"\M-^?" paste-insert +# these are the codes sent around the pasted text in bracketed +# paste mode. +# do the first one with both -M viins and -M vicmd in vi mode +bindkey '^[[200~' _start_paste +bindkey -M paste '^[[201~' _end_paste +# insert newlines rather than carriage returns when pasting newlines +bindkey -M paste -s '^M' '^J' + +zle -N _start_paste +zle -N _end_paste +zle -N zle-line-init _zle_line_init +zle -N zle-line-finish _zle_line_finish +zle -N paste-insert _paste_insert + +# switch the active keymap to paste mode +function _start_paste() { + bindkey -A paste main +} + +# go back to our normal keymap, and insert all the pasted text in the +# command line. this has the nice effect of making the whole paste be +# a single undo/redo event. +function _end_paste() { +#use bindkey -v here with vi mode probably. maybe you want to track +#if you were in ins or cmd mode and restore the right one. + bindkey -e + LBUFFER+=$_paste_content + unset _paste_content +} + +function _paste_insert() { + _paste_content+=$KEYS +} + +function _zle_line_init() { + # Tell terminal to send escape codes around pastes. + [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004h' +} + +function _zle_line_finish() { + # Tell it to stop when we leave zle, so pasting in other programs + # doesn't get the ^[[200~ codes around the pasted text. + [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004l' +} + From b2421cc73fe4c531c5d8a699124a3ef62bb327bd Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Sun, 7 Apr 2013 19:26:40 -0700 Subject: [PATCH 48/50] 005d967dc4e879f304607a706ccd18886e630dc1 --- 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 689a79fef..5b8e63e73 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 zsh $ZSH/tools/check_for_upgrade.sh + /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh From 9af229539467adf010c1f81c0ac4f03dc9bc9542 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 8 Apr 2013 09:38:15 +0200 Subject: [PATCH 49/50] Add emoji-clock plugin which displays the current time with half hour accuracy as an emoji symbol, for example in the shell prompt. --- plugins/emoji-clock/emoji-clock.plugin.zsh | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/emoji-clock/emoji-clock.plugin.zsh diff --git a/plugins/emoji-clock/emoji-clock.plugin.zsh b/plugins/emoji-clock/emoji-clock.plugin.zsh new file mode 100644 index 000000000..7351a02ec --- /dev/null +++ b/plugins/emoji-clock/emoji-clock.plugin.zsh @@ -0,0 +1,29 @@ +# ------------------------------------------------------------------------------ +# FILE: emoji-clock.plugin.zsh +# DESCRIPTION: The current time with half hour accuracy as an emoji symbol. +# Inspired by Andre Torrez' "Put A Burger In Your Shell" +# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html +# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) +# VERSION: 1.0.0 +# ----------------------------------------------------------------------------- + +function emoji-clock() { + hour=$(date '+%I') + minutes=$(date '+%M') + case $hour in + 01) clock="🕐"; [ $minutes -ge 30 ] && clock="🕜";; + 02) clock="🕑"; [ $minutes -ge 30 ] && clock="🕝";; + 03) clock="🕒"; [ $minutes -ge 30 ] && clock="🕞";; + 04) clock="🕓"; [ $minutes -ge 30 ] && clock="🕟";; + 05) clock="🕔"; [ $minutes -ge 30 ] && clock="🕠";; + 06) clock="🕕"; [ $minutes -ge 30 ] && clock="🕡";; + 07) clock="🕖"; [ $minutes -ge 30 ] && clock="🕢";; + 08) clock="🕗"; [ $minutes -ge 30 ] && clock="🕣";; + 09) clock="🕘"; [ $minutes -ge 30 ] && clock="🕤";; + 10) clock="🕙"; [ $minutes -ge 30 ] && clock="🕥";; + 11) clock="🕚"; [ $minutes -ge 30 ] && clock="🕦";; + 12) clock="🕛"; [ $minutes -ge 30 ] && clock="🕧";; + *) clock="⌛";; + esac + echo $clock +} From 58a6ed1eac57d3faf082070c21bc9770da90a044 Mon Sep 17 00:00:00 2001 From: Bercio Date: Mon, 8 Apr 2013 18:45:45 +0800 Subject: [PATCH 50/50] "$PWD" = "PWD", >! doesn't work, echo is redundant. Fixed all. --- plugins/last-working-dir/last-working-dir.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index ccf0f5b22..bc36c80db 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -9,8 +9,8 @@ local cache_file="$ZSH/cache/last-working-dir" # Updates the last directory once directory is changed. function chpwd() { - # Use >! in case noclobber is set to avoid "file exists" error - echo "$PWD" >! "$cache_file" + # Use >| in case noclobber is set to avoid "file exists" error + pwd >| "$cache_file" } # Changes directory to the last working directory.