From 4d6947ca0fa93afdaf38fdefb4c1c7fb3ffe4a41 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Sat, 7 Apr 2012 23:00:34 -0300 Subject: [PATCH 01/42] My zsh config --- lib/aliases.zsh | 1 - templates/zshrc.zsh-template | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 0555be264..d2d3aed81 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -21,4 +21,3 @@ alias ll='ls -l' alias sl=ls # often screw this up alias afind='ack-grep -il' - diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index e52553241..6f184c80e 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -ZSH_THEME="robbyrussell" +ZSH_THEME="gallifrey" # Example aliases # alias zshconfig="mate ~/.zshrc" @@ -29,8 +29,11 @@ ZSH_THEME="robbyrussell" # 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) +plugins=(git osx python pip django) source $ZSH/oh-my-zsh.sh # Customize to your needs... + +# Themes override ls alias from aliases.zsh +alias ls='ls -Ga' From 6a10614609c756eb8b831f020ba2ebddff9674ad Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Sun, 8 Apr 2012 22:34:38 -0300 Subject: [PATCH 02/42] Added new virtualenvwrapper plugin --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 ++ templates/zshrc.zsh-template | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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..aa1ff17b4 --- /dev/null +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -0,0 +1,2 @@ +export WORKON_HOME="/Volumes/Workspace/Envs" +source /usr/local/share/python/virtualenvwrapper.sh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 6f184c80e..175bface9 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -29,7 +29,7 @@ ZSH_THEME="gallifrey" # 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 osx python pip django) +plugins=(git osx python virtualenvwrapper) source $ZSH/oh-my-zsh.sh From 73321f3e7eb6fa30e45667b0e9d98e72dcb4fdc7 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Tue, 1 May 2012 10:09:18 -0400 Subject: [PATCH 03/42] VirtualEnvWrapper plugin customization --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index aa1ff17b4..7a181d5e4 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,2 +1,6 @@ -export WORKON_HOME="/Volumes/Workspace/Envs" -source /usr/local/share/python/virtualenvwrapper.sh + +VW_SCRIPT=`which virtualenvwrapper.sh` +if [ -f $VW_SCRIPT ]; then + export WORKON_HOME="~/virtualenvs" + source $VW_SCRIPT +fi From b62fd8020216680f14c943e06865a2e4d4665a96 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Tue, 1 May 2012 10:16:00 -0400 Subject: [PATCH 04/42] Changed shell theme --- templates/zshrc.zsh-template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 175bface9..8993c2815 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -ZSH_THEME="gallifrey" +ZSH_THEME="jreese" # Example aliases # alias zshconfig="mate ~/.zshrc" @@ -36,4 +36,3 @@ source $ZSH/oh-my-zsh.sh # Customize to your needs... # Themes override ls alias from aliases.zsh -alias ls='ls -Ga' From 029ad2828ce4e719dccff8958fe4c4f931fd19ab Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Mon, 14 May 2012 04:51:28 -0300 Subject: [PATCH 05/42] redirecionamento de vim para 7.3 --- .gitignore | 1 + plugins/vim-override/vim-override.plugin.zsh | 10 ++++++++++ templates/zshrc.zsh-template | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 plugins/vim-override/vim-override.plugin.zsh diff --git a/.gitignore b/.gitignore index 2e8db7341..c7ad5ca6a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ custom/* !custom/example.zsh cache *.swp +*.un~ diff --git a/plugins/vim-override/vim-override.plugin.zsh b/plugins/vim-override/vim-override.plugin.zsh new file mode 100644 index 000000000..80ac92dbe --- /dev/null +++ b/plugins/vim-override/vim-override.plugin.zsh @@ -0,0 +1,10 @@ +# try to replace OSX's default vim by MacVim's version +RECENTVIM=`find /usr/local/Cellar/macvim -name Vim` + +# if mode indicator wasn't setup by theme, define default +if [[ "$OSTYPE" == darwin* && -e $RECENTVIM ]]; then + echo "Redirecionando vim..." + alias vim="$RECENTVIM" +else + echo "deu zica criando alias" +fi diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 8993c2815..02e0e6cb1 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -15,7 +15,7 @@ ZSH_THEME="jreese" # CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment following line if you want to disable colors in ls # DISABLE_LS_COLORS="true" @@ -29,7 +29,7 @@ ZSH_THEME="jreese" # 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 osx python virtualenvwrapper) +plugins=(git osx python virtualenvwrapper vim-override) source $ZSH/oh-my-zsh.sh From 454b685fd21b3ab0251346610bcbfd02cbc28b3b Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Tue, 15 May 2012 10:30:54 -0300 Subject: [PATCH 06/42] Atualizado script de override vim para Mac. --- plugins/vim-override/vim-override.plugin.zsh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/vim-override/vim-override.plugin.zsh b/plugins/vim-override/vim-override.plugin.zsh index 80ac92dbe..e92ffbab0 100644 --- a/plugins/vim-override/vim-override.plugin.zsh +++ b/plugins/vim-override/vim-override.plugin.zsh @@ -1,10 +1,7 @@ # try to replace OSX's default vim by MacVim's version -RECENTVIM=`find /usr/local/Cellar/macvim -name Vim` +RECENTVIM=`test -e /usr/local/Cellar/macvim && find /usr/local/Cellar/macvim -name Vim` # if mode indicator wasn't setup by theme, define default if [[ "$OSTYPE" == darwin* && -e $RECENTVIM ]]; then - echo "Redirecionando vim..." alias vim="$RECENTVIM" -else - echo "deu zica criando alias" fi From 0d0ae39af02e5d73613edb47ff33bd962ecf5cbb Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Sat, 19 May 2012 11:19:17 -0300 Subject: [PATCH 07/42] Atualizado default LC_ALL e LANG --- templates/zshrc.zsh-template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 02e0e6cb1..eba7bdd87 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -34,5 +34,7 @@ plugins=(git osx python virtualenvwrapper vim-override) source $ZSH/oh-my-zsh.sh # Customize to your needs... +if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi +if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi # Themes override ls alias from aliases.zsh From 0222b0af116805db2c003070bdb644fc6ede6d0a Mon Sep 17 00:00:00 2001 From: "cadusk@yahoo.com.br" Date: Tue, 22 May 2012 13:47:50 -0300 Subject: [PATCH 08/42] Removido plugin 'osx' da inicializacao automatica. --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index eba7bdd87..5cc84c0cd 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -29,7 +29,7 @@ DISABLE_AUTO_UPDATE="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 osx python virtualenvwrapper vim-override) +plugins=(git python virtualenvwrapper vim-override) source $ZSH/oh-my-zsh.sh From aa709fd5f2c517b5578494eb8a305ab8dda1158c Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Fri, 29 Jun 2012 00:06:18 -0300 Subject: [PATCH 09/42] new plugin for pythonbrew --- plugins/pythonbrew/pythonbrew.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 plugins/pythonbrew/pythonbrew.plugin.zsh diff --git a/plugins/pythonbrew/pythonbrew.plugin.zsh b/plugins/pythonbrew/pythonbrew.plugin.zsh new file mode 100644 index 000000000..0fc3e9676 --- /dev/null +++ b/plugins/pythonbrew/pythonbrew.plugin.zsh @@ -0,0 +1,2 @@ +# Initialize pythonbrew if installed +[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc From 73c69e7f1af9f72aa9dedd81e6124f25a54b33a7 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Fri, 29 Jun 2012 00:06:57 -0300 Subject: [PATCH 10/42] set pythonbrew plugin as initializable. --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index f0192e5ec..b80d17548 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -29,7 +29,7 @@ DISABLE_AUTO_UPDATE="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 python virtualenvwrapper vim-override) +plugins=(git python pythonbrew virtualenvwrapper vim-override) source $ZSH/oh-my-zsh.sh From e7fcb090881edfe5729b1fb021d31280bbef39ee Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Thu, 5 Jul 2012 13:34:53 -0300 Subject: [PATCH 11/42] New customizations. --- templates/zshrc.zsh-template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index b80d17548..0c03d6ff5 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -ZSH_THEME="robbyrussell" +ZSH_THEME="miloshadzic" # Example aliases # alias zshconfig="mate ~/.zshrc" @@ -29,7 +29,7 @@ DISABLE_AUTO_UPDATE="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 python pythonbrew virtualenvwrapper vim-override) +plugins=(git python virtualenvwrapper pythonbrew vim-override) source $ZSH/oh-my-zsh.sh From 402053ff37160586c56dd82ba1680d3c384ecb60 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Fri, 27 Jul 2012 01:06:57 -0300 Subject: [PATCH 12/42] Changed default theme. --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 0c03d6ff5..1f1513334 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -ZSH_THEME="miloshadzic" +ZSH_THEME="mh" # Example aliases # alias zshconfig="mate ~/.zshrc" From fe80ab4baa5902afe78d7683b269345395aa1d8d Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Tue, 25 Sep 2012 01:15:15 -0300 Subject: [PATCH 13/42] Updated virtualenv initialization. --- templates/zshrc.zsh-template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1f1513334..62fbda14d 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -29,9 +29,10 @@ DISABLE_AUTO_UPDATE="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 python virtualenvwrapper pythonbrew vim-override) +plugins=(git python pythonbrew vim-override) source $ZSH/oh-my-zsh.sh +source `which virtualenvwrapper.sh` # Customize to your needs... if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi From 2230bea1d46b7d558f38cb072a077dcbb077a95e Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Wed, 3 Oct 2012 23:18:31 -0300 Subject: [PATCH 14/42] Disable correction suggestions. --- templates/zshrc.zsh-template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 62fbda14d..694122543 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -38,4 +38,7 @@ source `which virtualenvwrapper.sh` if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi +if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi +unsetopt correctall + # Themes override ls alias from aliases.zsh From 6c10907143e50e1b013b24284b270e46a99bf3a7 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Sat, 6 Oct 2012 10:32:40 -0300 Subject: [PATCH 15/42] My custom zshrc's --- templates/zshrc.zsh-cadusk-linux | 44 ++++++++++++++++++++++++++++++++ templates/zshrc.zsh-cadusk-mac | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 templates/zshrc.zsh-cadusk-linux create mode 100644 templates/zshrc.zsh-cadusk-mac diff --git a/templates/zshrc.zsh-cadusk-linux b/templates/zshrc.zsh-cadusk-linux new file mode 100644 index 000000000..694122543 --- /dev/null +++ b/templates/zshrc.zsh-cadusk-linux @@ -0,0 +1,44 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="mh" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# 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/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git python pythonbrew vim-override) + +source $ZSH/oh-my-zsh.sh +source `which virtualenvwrapper.sh` + +# Customize to your needs... +if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi +if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi + +if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi +unsetopt correctall + +# Themes override ls alias from aliases.zsh diff --git a/templates/zshrc.zsh-cadusk-mac b/templates/zshrc.zsh-cadusk-mac new file mode 100644 index 000000000..694122543 --- /dev/null +++ b/templates/zshrc.zsh-cadusk-mac @@ -0,0 +1,44 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="mh" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# 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/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git python pythonbrew vim-override) + +source $ZSH/oh-my-zsh.sh +source `which virtualenvwrapper.sh` + +# Customize to your needs... +if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi +if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi + +if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi +unsetopt correctall + +# Themes override ls alias from aliases.zsh From 0a3db5bf2df0e14a07e8aac127ed671a5919c779 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Wed, 24 Oct 2012 00:35:17 -0200 Subject: [PATCH 16/42] Updated repository references. --- README.textile | 10 +++++----- templates/zshrc.zsh-cadusk-mac | 1 + templates/zshrc.zsh-template | 1 + tools/install.sh | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.textile b/README.textile index a38e2d7cf..70996fd54 100644 --- a/README.textile +++ b/README.textile @@ -13,18 +13,18 @@ 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@ +@curl -L https://github.com/cadusk/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@ +@wget --no-check-certificate https://github.com/cadusk/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ h3. The manual way 1. Clone the repository - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ + @git clone git://github.com/cadusk/oh-my-zsh.git ~/.oh-my-zsh@ 2. Create a new zsh config by copying the zsh template we've provided. @@ -47,7 +47,7 @@ h2. Usage * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) ** example: @plugins=(git osx ruby)@ * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. +** Take a look at the "current themes":https://wiki.github.com/cadusk/oh-my-zsh/themes that come bundled with _Oh My Zsh_. * much much more... take a look at @lib/@ what _Oh My Zsh_ offers... h2. Useful @@ -81,6 +81,6 @@ h2. Contributors This project wouldn't exist without all of our awesome users and contributors. -* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors +* "View our growing list of contributors":https://github.com/cadusk/oh-my-zsh/contributors Thank you so much! diff --git a/templates/zshrc.zsh-cadusk-mac b/templates/zshrc.zsh-cadusk-mac index 694122543..561564d9c 100644 --- a/templates/zshrc.zsh-cadusk-mac +++ b/templates/zshrc.zsh-cadusk-mac @@ -42,3 +42,4 @@ if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi unsetopt correctall # Themes override ls alias from aliases.zsh +alias tmux 'tmux -u2' diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 694122543..95ced48f8 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -42,3 +42,4 @@ if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi unsetopt correctall # Themes override ls alias from aliases.zsh +alias tmux='tmux -u2' diff --git a/tools/install.sh b/tools/install.sh index b080be3a1..89417989e 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,7 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { +hash git >/dev/null && /usr/bin/env git clone https://github.com/cadusk/oh-my-zsh.git ~/.oh-my-zsh || { echo "git not installed" exit } From 623c4b2ac3f04a2a849e5e43cbd912818bba27e4 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Thu, 25 Oct 2012 14:16:27 -0200 Subject: [PATCH 17/42] Fixed aliases and theme appearance. --- lib/aliases.zsh | 8 ++++ lib/theme-and-appearance.zsh | 7 --- ...shrc.zsh-cadusk-linux => zshrc.zsh-cadusk} | 0 templates/zshrc.zsh-cadusk-mac | 45 ------------------- 4 files changed, 8 insertions(+), 52 deletions(-) rename templates/{zshrc.zsh-cadusk-linux => zshrc.zsh-cadusk} (100%) delete mode 100644 templates/zshrc.zsh-cadusk-mac diff --git a/lib/aliases.zsh b/lib/aliases.zsh index d2d3aed81..73c38ddfa 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -14,6 +14,14 @@ alias _='sudo' # Show history alias history='fc -l 1' +# Enable ls colors +LS_OPTIONS='-hF' +if [ "$DISABLE_LS_COLORS" != "true" ] +then + # Find the option for using colors in ls, depending on the version: Linux or BSD + ls --color -d . &>/dev/null 2>&1 && alias ls="ls --color=tty $LS_OPTIONS" || alias ls="ls -G $LS_OPTIONS" +fi + # List direcory contents alias lsa='ls -lah' alias l='ls -la' diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index aec67721a..e70741b5c 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -3,13 +3,6 @@ autoload colors; colors; export LSCOLORS="Gxfxcxdxbxegedabagacad" #export LS_COLORS -# Enable ls colors -if [ "$DISABLE_LS_COLORS" != "true" ] -then - # Find the option for using colors in ls, depending on the version: Linux or BSD - ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' -fi - #setopt no_beep setopt auto_cd setopt multios diff --git a/templates/zshrc.zsh-cadusk-linux b/templates/zshrc.zsh-cadusk similarity index 100% rename from templates/zshrc.zsh-cadusk-linux rename to templates/zshrc.zsh-cadusk diff --git a/templates/zshrc.zsh-cadusk-mac b/templates/zshrc.zsh-cadusk-mac deleted file mode 100644 index 561564d9c..000000000 --- a/templates/zshrc.zsh-cadusk-mac +++ /dev/null @@ -1,45 +0,0 @@ -# Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh - -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. -ZSH_THEME="mh" - -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -# Set to this to use case-sensitive completion -# CASE_SENSITIVE="true" - -# Comment this out to disable weekly auto-update checks -DISABLE_AUTO_UPDATE="true" - -# Uncomment following line if you want to disable colors in ls -# DISABLE_LS_COLORS="true" - -# 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/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git python pythonbrew vim-override) - -source $ZSH/oh-my-zsh.sh -source `which virtualenvwrapper.sh` - -# Customize to your needs... -if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi -if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi - -if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi -unsetopt correctall - -# Themes override ls alias from aliases.zsh -alias tmux 'tmux -u2' From ba136bb773f6450de73f38d3f2000c52783fbd2e Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Thu, 25 Oct 2012 21:10:15 -0200 Subject: [PATCH 18/42] Fixed customizations for mac and linux environments. --- templates/zshrc-linux.zsh | 43 +++++++++++++++++++ templates/{zshrc.zsh-cadusk => zshrc-mac.zsh} | 11 ++--- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 templates/zshrc-linux.zsh rename templates/{zshrc.zsh-cadusk => zshrc-mac.zsh} (84%) diff --git a/templates/zshrc-linux.zsh b/templates/zshrc-linux.zsh new file mode 100644 index 000000000..6f647174a --- /dev/null +++ b/templates/zshrc-linux.zsh @@ -0,0 +1,43 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="mh" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# 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" + +# Virtualenvwrapper plugin - Disable directory name discovery +DISABLE_VENV_CD="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 ssh-agent debian python pythonbrew vim-override virtualenvwrapper) + +source $ZSH/oh-my-zsh.sh +# source `which virtualenvwrapper.sh` + +# Customize to your needs... + +if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi +unsetopt correctall diff --git a/templates/zshrc.zsh-cadusk b/templates/zshrc-mac.zsh similarity index 84% rename from templates/zshrc.zsh-cadusk rename to templates/zshrc-mac.zsh index 694122543..4a02a6839 100644 --- a/templates/zshrc.zsh-cadusk +++ b/templates/zshrc-mac.zsh @@ -24,15 +24,18 @@ DISABLE_AUTO_UPDATE="true" # DISABLE_AUTO_TITLE="true" # Uncomment following line if you want red dots to be displayed while waiting for completion -# COMPLETION_WAITING_DOTS="true" +COMPLETION_WAITING_DOTS="true" + +# Virtualenvwrapper plugin - Disable directory name discovery +DISABLE_VENV_CD="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 python pythonbrew vim-override) +plugins=(git ssh-agent python pythonbrew vim-override virtualenvwrapper) source $ZSH/oh-my-zsh.sh -source `which virtualenvwrapper.sh` +# source `which virtualenvwrapper.sh` # Customize to your needs... if [ -z "$LC_ALL" ]; then export LC_ALL=en_US.UTF-8; fi @@ -40,5 +43,3 @@ if [ -z "$LANG" ]; then export LANG=en_US.UTF-8; fi if [ -e $HOME/bin ]; then export PATH="$HOME/bin:$PATH"; fi unsetopt correctall - -# Themes override ls alias from aliases.zsh From c071030b6835d86c09c2ef393c5917649d4abde8 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Thu, 25 Oct 2012 21:22:32 -0200 Subject: [PATCH 19/42] Added tmux plugin. --- plugins/tmux/tmux.plugin.zsh | 1 + templates/zshrc-linux.zsh | 2 +- templates/zshrc-mac.zsh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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..c6f21c30a --- /dev/null +++ b/plugins/tmux/tmux.plugin.zsh @@ -0,0 +1 @@ +alias tmux="tmux -u2" diff --git a/templates/zshrc-linux.zsh b/templates/zshrc-linux.zsh index 6f647174a..7353f86bf 100644 --- a/templates/zshrc-linux.zsh +++ b/templates/zshrc-linux.zsh @@ -32,7 +32,7 @@ DISABLE_VENV_CD="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 ssh-agent debian python pythonbrew vim-override virtualenvwrapper) +plugins=(git tmux ssh-agent debian python pythonbrew vim-override virtualenvwrapper) source $ZSH/oh-my-zsh.sh # source `which virtualenvwrapper.sh` diff --git a/templates/zshrc-mac.zsh b/templates/zshrc-mac.zsh index 4a02a6839..b6a1bb9b7 100644 --- a/templates/zshrc-mac.zsh +++ b/templates/zshrc-mac.zsh @@ -32,7 +32,7 @@ DISABLE_VENV_CD="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 ssh-agent python pythonbrew vim-override virtualenvwrapper) +plugins=(git tmux ssh-agent python pythonbrew vim-override virtualenvwrapper) source $ZSH/oh-my-zsh.sh # source `which virtualenvwrapper.sh` From 1ce42650726e28a1a0df546c4d63e5e457c35791 Mon Sep 17 00:00:00 2001 From: Carlos Cardoso Date: Sat, 27 Oct 2012 13:27:20 -0200 Subject: [PATCH 20/42] disable ssh-agent. --- templates/zshrc-linux.zsh | 2 +- templates/zshrc-mac.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/zshrc-linux.zsh b/templates/zshrc-linux.zsh index 7353f86bf..8a4339709 100644 --- a/templates/zshrc-linux.zsh +++ b/templates/zshrc-linux.zsh @@ -32,7 +32,7 @@ DISABLE_VENV_CD="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 tmux ssh-agent debian python pythonbrew vim-override virtualenvwrapper) +plugins=(git tmux debian python pythonbrew vim-override virtualenvwrapper) source $ZSH/oh-my-zsh.sh # source `which virtualenvwrapper.sh` diff --git a/templates/zshrc-mac.zsh b/templates/zshrc-mac.zsh index b6a1bb9b7..82ffeec29 100644 --- a/templates/zshrc-mac.zsh +++ b/templates/zshrc-mac.zsh @@ -32,7 +32,7 @@ DISABLE_VENV_CD="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 tmux ssh-agent python pythonbrew vim-override virtualenvwrapper) +plugins=(git tmux python pythonbrew vim-override virtualenvwrapper) source $ZSH/oh-my-zsh.sh # source `which virtualenvwrapper.sh` From f84b2eddeb6e539891bb9c6cd505f4ae5db81c3d Mon Sep 17 00:00:00 2001 From: Gaetan SEMET Date: Tue, 12 Feb 2013 14:50:46 +0100 Subject: [PATCH 21/42] Creating new completion scheme for buildbot and repo tools --- .project | 12 +++ completions/_blop | 5 + plugins/buildbot/_buildbot | 51 ++++++++++ plugins/buildbot/buildbot.plugin.zsh | 8 ++ plugins/encode64/encode64.plugin.zsh | 2 +- plugins/git/_git-remote | 74 ++++++++++++++ plugins/python/python.plugin.zsh | 1 + plugins/repo/_repo | 146 +++++++++++++++++++++++++++ plugins/repo/_repo~ | 146 +++++++++++++++++++++++++++ plugins/repo/repo.plugin.zsh | 36 +++++++ templates/zshrc.zsh-template | 2 + themes/gsemet.zsh-theme | 25 +++++ 12 files changed, 507 insertions(+), 1 deletion(-) create mode 100644 .project create mode 100644 completions/_blop create mode 100644 plugins/buildbot/_buildbot create mode 100644 plugins/buildbot/buildbot.plugin.zsh create mode 100644 plugins/git/_git-remote create mode 100644 plugins/repo/_repo create mode 100644 plugins/repo/_repo~ create mode 100644 plugins/repo/repo.plugin.zsh create mode 100644 themes/gsemet.zsh-theme diff --git a/.project b/.project new file mode 100644 index 000000000..574956435 --- /dev/null +++ b/.project @@ -0,0 +1,12 @@ + + + oh-my-zsh + + + + + + + com.aptana.projects.webnature + + diff --git a/completions/_blop b/completions/_blop new file mode 100644 index 000000000..046672a69 --- /dev/null +++ b/completions/_blop @@ -0,0 +1,5 @@ +#compdef blop + + +_arguments "1: :(World)" + diff --git a/plugins/buildbot/_buildbot b/plugins/buildbot/_buildbot new file mode 100644 index 000000000..7e628eeb1 --- /dev/null +++ b/plugins/buildbot/_buildbot @@ -0,0 +1,51 @@ +#compdef buildbot + +_buildbot() +{ + typeset -A opt_args + local context state line curcontext="$curcontext" + + local ret=1 + + _arguments -C \ + '(- 1 *)--help[show usage]'\ + '(- 1 *)--version[display version]'\ + '(- 1 *)--verbose[verbose output]'\ + '1:command:->command'\ + '*::args:->args' && ret=0 + + case $state in + (command) + local commands; + commands=( + 'create-master:Create and populate a directory for a new buildmaster' + 'upgrade-master:Upgrade an existing buildmaster directory for the current version' + 'start:Start a buildmaster' + 'stop:Stop a buildmaster' + 'restart:Restart a buildmaster' + 'reconfig:SIGHUP a buildmaster to make it re-read the config file' + 'sighup:SIGHUP a buildmaster to make it re-read the config file' + 'sendchange:Send a change to the buildmaster' + 'debugclient:Launch a small debug panel GUI' + 'statuslog:Emit current builder status to stdout' + 'statusgui:Display a small window showing current builder status' + 'try:Run a build with your local changes' + 'tryserver:buildmaster-side "try" support function, not for users' + 'checkconfig:test the validity of a master.cfg config file' + 'user:Manage users in buildbot''s database' + ) + _describe -t commands 'command' commands && ret=0 + ;; + (args) + ret=0 + ;; + esac + + return $ret +} + +_buildbot "$@" +return $? + + + diff --git a/plugins/buildbot/buildbot.plugin.zsh b/plugins/buildbot/buildbot.plugin.zsh new file mode 100644 index 000000000..0d30172d5 --- /dev/null +++ b/plugins/buildbot/buildbot.plugin.zsh @@ -0,0 +1,8 @@ +#compdef buildbot + +# Aliases +alias b='buildbot' + +zstyle ':completion:*:descriptions' format '%B%d%b' + + diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh index 3b59447c5..6f8582642 100644 --- a/plugins/encode64/encode64.plugin.zsh +++ b/plugins/encode64/encode64.plugin.zsh @@ -1,4 +1,4 @@ encode64(){ echo -n $1 | base64 } -decode64(){ echo -n $1 | base64 -D } +decode64(){ echo -n $1 | base64 -d } alias e64=encode64 alias d64=decode64 diff --git a/plugins/git/_git-remote b/plugins/git/_git-remote new file mode 100644 index 000000000..4ba62a357 --- /dev/null +++ b/plugins/git/_git-remote @@ -0,0 +1,74 @@ +#compdef git-remote + +# NOTE: --track is undocumented. +# TODO: --track, -t, --master, and -m should take remote branches, I guess. +# NOTE: --master is undocumented. +# NOTE: --fetch is undocumented. +_git-remote () { + local curcontext=$curcontext state line + declare -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' && ret=0 + + case $state in + (command) + declare -a commands + + commands=( + 'add:add a new remote' + 'show:show information about a given remote' + 'prune:delete all stale tracking branches for a given remote' + 'update:fetch updates for a set of remotes' + 'rm:remove a remote from .git/config and all associated tracking branches' + 'rename:rename a remote from .git/config and update all associated tracking branches' + 'set-head:sets or deletes the default branch' + 'set-branches:changes the list of branches tracked by the named remote.' + 'set-url:changes URL remote points to.' + ) + + _describe -t commands 'sub-command' commands && ret=0 + ;; + (options) + case $line[1] in + (add) + _arguments \ + '*'{--track,-t}'[track given branch instead of default glob refspec]:branch:__git_branch_names' \ + '(--master -m)'{--master,-m}'[set the remote'\''s HEAD to point to given master branch]:branch:__git_branch_names' \ + '(--fetch -f)'{--fetch,-f}'[run git-fetch on the new remote after it has been created]' \ + ':branch name:__git_remotes' \ + ':url:_urls' && ret=0 + ;; + (show) + _arguments \ + '-n[do not contact the remote for a list of branches]' \ + ':remote:__git_remotes' && ret=0 + ;; + (prune) + _arguments \ + '(--dry-run -n)'{-n,--dry-run}'[do not actually prune, only list what would be done]' \ + ':remote:__git_remotes' && ret=0 + ;; + (update) + __git_remote-groups && ret=0 + ;; + (rm) + __git_remotes && ret=0 + ;; + (rename) + __git_remotes && ret=0 + ;; + (set-url) + _arguments \ + '*--push[manipulate push URLs]' \ + '(--add)--add[add URL]' \ + '(--delete)--delete[delete URLs]' \ + ':branch name:__git_remotes' \ + ':url:_urls' && ret=0 + ;; + + esac + ;; + esac +} diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 852c8b919..319bf0bf0 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -10,3 +10,4 @@ function pyclean() { # Grep among .py files alias pygrep='grep --include="*.py"' + diff --git a/plugins/repo/_repo b/plugins/repo/_repo new file mode 100644 index 000000000..95dbc1b64 --- /dev/null +++ b/plugins/repo/_repo @@ -0,0 +1,146 @@ +#compdef repo + +_repo() +{ + typeset -A opt_args + local context state line curcontext="$curcontext" + + local ret=1 + + _arguments -C \ + '(- 1 *)--help[show usage]'\ + '1:command:->command'\ + '*::args:->args' && ret=0 + + case $state in + (command) + repo list 2> /dev/null > /dev/null + if [[ $? == 0 ]]; then + local commands; + commands=( + 'abandon:Permanently abandon a development branch' + 'branch:View current topic branches' + 'branches:View current topic branches' + 'checkout:Checkout a branch for development' + 'checkout-manifest:for every project in a manifest tag file check out the sha1 listed in the file' + 'cherry-pick:Cherry-pick a change.' + 'diff:Show changes between commit and working tree' + 'download:Download and checkout a change' + 'format-patch:build patch sets for each project common to a manifest baseline' + 'grep:Print lines matching a pattern' + 'help:Display detailed help on a command' + 'init:Initialize repo in the current directory' + 'list:List projects and their associated directories' + 'overview:Display overview of unmerged project branches' + 'prune:Prune (delete) already merged topics' + 'push:Push the local branch rebase:Rebase local branches on upstream branch' + 'smartsync:Update working tree to the latest known good revision' + 'stage:Stage file(s) for commit start:Start a new branch for development' + 'status:Show the working tree status sync:Update working tree to the latest revision' + 'sync:Update working tree to the latest revision' + 'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it' + 'upload:Upload changes for code review' + ) + _describe -t commands 'command' commands && ret=0 + else + local commands; + commands=( + 'init:Install repo in the current working directory' + 'help:Display detailed help on a command' + ) + _describe -t commands 'command' commands && ret=0 + fi + ;; + (args) + + case $words[1] in + (branch | branches ) + # TODO : list available projects and add them in list to feed compadd with + _arguments :::_branches_projects + ;; + (init) + _arguments \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-q --quiet)"{-q,--quiet}"[be quiet]" \ + "(-u --manifest-url)"{-u,--manifest-url=}"[manifest repository location]":url:_url \ + "(-b --manifest-branch)"{-b,--manifest-branch=}"[manifest branch or revision]":branch:_branch\ + "(-m --manifest-name)"{-m,--manifest-name=}"[initial manifest file]":manifest_name:_manifest_name\ + "(--mirror)--mirror[mirror the forrest]"\ + "(--reference)--reference=[location of mirror directory]":dir:_dirs\ + "(--depth)--depth=[create a shallow clone with given depth; see git clone]":depth:_depth\ + "(-g --group=)"{-g,--group=}"[restrict manifest projects to ones with a specified group]":group:_group\ + "(-p --platform=)"{-p,--platform=}"[restrict manifest projects to ones with a specified platform group(auto|all|none|linux|darwin|...)]":platform:_platform\ + "(--repo-url)--repo-url=[repo repository location]":url:_url\ + "(--repo-branch)--repo-branch[repo branch or revision]":branch_or_rev:_branch_or_rev\ + "(--no-repo-verify)--no-repo-verify[do not verify repo source code]"\ + "(--config-name)--config-name[Always prompt for name/e-mail]"\ + && ret=0 + ;; + *) + ret=0 + esac + ;; + esac + + return $ret +} + +_url() +{ + _message -e url 'url' +} + +_platform() +{ + _message -e platform 'platform group(auto|all|none|linux|darwin|...)' +} + +_manifest_name() +{ + _message -e manifest_name 'manifest name' +} + +_group() +{ + _message -e group 'group' +} + +_branch() +{ + _message -e branch 'branch' +} + +_branch_or_rev() +{ + _message -e branch_or_rev 'repo branch or revision' +} + +_depth() +{ + _message -e depth 'depth' +} + +_branches_projects() +{ + _message -e depth '...' +} + +_repo "$@" +return $? + + +#typeset -A opt_args + +local context state line +local fontdir + +_arguments \ + "(-l -c -r)init[Install repo in the current working directory]" \ + "(-l -c -r)help[Display detailed help on a command]" \ + && return 0 + + +return 1 + + + diff --git a/plugins/repo/_repo~ b/plugins/repo/_repo~ new file mode 100644 index 000000000..ecb12b5a1 --- /dev/null +++ b/plugins/repo/_repo~ @@ -0,0 +1,146 @@ +#compdef repo + +_repo() +{ + typeset -A opt_args + local context state line curcontext="$curcontext" + + local ret=1 + + _arguments -C \ + '(- 1 *)--help[show usage]'\ + '1:command:->command'\ + '*::args:->args' && ret=0 + + case $state in + (command) + repo status 2> /dev/null > /dev/null + if [[ $? == 0 ]]; then + local commands; + commands=( + 'abandon:Permanently abandon a development branch' + 'branch:View current topic branches' + 'branches:View current topic branches' + 'checkout:Checkout a branch for development' + 'checkout-manifest:for every project in a manifest tag file check out the sha1 listed in the file' + 'cherry-pick:Cherry-pick a change.' + 'diff:Show changes between commit and working tree' + 'download:Download and checkout a change' + 'format-patch:build patch sets for each project common to a manifest baseline' + 'grep:Print lines matching a pattern' + 'help:Display detailed help on a command' + 'init:Initialize repo in the current directory' + 'list:List projects and their associated directories' + 'overview:Display overview of unmerged project branches' + 'prune:Prune (delete) already merged topics' + 'push:Push the local branch rebase:Rebase local branches on upstream branch' + 'smartsync:Update working tree to the latest known good revision' + 'stage:Stage file(s) for commit start:Start a new branch for development' + 'status:Show the working tree status sync:Update working tree to the latest revision' + 'sync:Update working tree to the latest revision' + 'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it' + 'upload:Upload changes for code review' + ) + _describe -t commands 'command' commands && ret=0 + else + local commands; + commands=( + 'init:Install repo in the current working directory' + 'help:Display detailed help on a command' + ) + _describe -t commands 'command' commands && ret=0 + fi + ;; + (args) + + case $words[1] in + (branch | branches ) + # TODO : list available projects and add them in list to feed compadd with + _arguments :::_branches_projects + ;; + (init) + _arguments \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-q --quiet)"{-q,--quiet}"[be quiet]" \ + "(-u --manifest-url)"{-u,--manifest-url=}"[manifest repository location]":url:_url \ + "(-b --manifest-branch)"{-b,--manifest-branch=}"[manifest branch or revision]":branch:_branch\ + "(-m --manifest-name)"{-m,--manifest-name=}"[initial manifest file]":manifest_name:_manifest_name\ + "(--mirror)--mirror[mirror the forrest]"\ + "(--reference)--reference=[location of mirror directory]":dir:_dirs\ + "(--depth)--depth=[create a shallow clone with given depth; see git clone]":depth:_depth\ + "(-g --group=)"{-g,--group=}"[restrict manifest projects to ones with a specified group]":group:_group\ + "(-p --platform=)"{-p,--platform=}"[restrict manifest projects to ones with a specified platform group(auto|all|none|linux|darwin|...)]":platform:_platform\ + "(--repo-url)--repo-url=[repo repository location]":url:_url\ + "(--repo-branch)--repo-branch[repo branch or revision]":branch_or_rev:_branch_or_rev\ + "(--no-repo-verify)--no-repo-verify[do not verify repo source code]"\ + "(--config-name)--config-name[Always prompt for name/e-mail]"\ + && ret=0 + ;; + *) + ret=0 + esac + ;; + esac + + return $ret +} + +_url() +{ + _message -e url 'url' +} + +_platform() +{ + _message -e platform 'platform group(auto|all|none|linux|darwin|...)' +} + +_manifest_name() +{ + _message -e manifest_name 'manifest name' +} + +_group() +{ + _message -e group 'group' +} + +_branch() +{ + _message -e branch 'branch' +} + +_branch_or_rev() +{ + _message -e branch_or_rev 'repo branch or revision' +} + +_depth() +{ + _message -e depth 'depth' +} + +_branches_projects() +{ + _message -e depth '...' +} + +_repo "$@" +return $? + + +#typeset -A opt_args + +local context state line +local fontdir + +_arguments \ + "(-l -c -r)init[Install repo in the current working directory]" \ + "(-l -c -r)help[Display detailed help on a command]" \ + && return 0 + + +return 1 + + + diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh new file mode 100644 index 000000000..7a97b86ce --- /dev/null +++ b/plugins/repo/repo.plugin.zsh @@ -0,0 +1,36 @@ +# Aliases +#alias r='repo' + +## +#function listRepoCompletions { +# reply=( +# abandon + #branch +# branches +# checkout +# checkout-manifest +# cherry-pick +# diff + #download +# format-patch +# forall +# grep +# help +# init +# list + #overview +# prune +# push +# rebase +# smartsync +# stage +# start +# status + #sync +# tag-manifest +# upload +# ); +#} + +###compctl -K listRepoCompletions repo + diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 2ea9934af..6a705c54f 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -36,4 +36,6 @@ plugins=(git) source $ZSH/oh-my-zsh.sh +zstyle ':completion:*:descriptions' format '%B%d%b' + # Customize to your needs... diff --git a/themes/gsemet.zsh-theme b/themes/gsemet.zsh-theme new file mode 100644 index 000000000..10a2d94c6 --- /dev/null +++ b/themes/gsemet.zsh-theme @@ -0,0 +1,25 @@ +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +#Customized git status, oh-my-zsh currently does not allow render dirty status before branch +git_custom_status() { + local cb=$(current_branch) + if [ -n "$cb" ]; then + echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} + +#RVM and git settings +if [[ -s ~/.rvm/scripts/rvm ]] ; then + RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' +else + 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[yellow]%}%n%{$fg[cyan]%}@%{$fg[yellow]%}%m%{$fg[cyan]%}:%{$fg[magenta]%}%~% %{$fg[cyan]%}]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' From 0c9deec62bab4a2960f8773e45310d4a730682f2 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 15:39:05 +0100 Subject: [PATCH 22/42] New aliases :gg and gk --- plugins/git/git.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 154aa6db1..e554d9cfa 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -58,6 +58,9 @@ alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' alias gf='git ls-files | grep' alias gpoat='git push origin --all && git push origin --tags' +alias gg='git gui' +alias gk='gitk' + # Will cd into the top of the current repository # or submodule. alias grt='cd $(git rev-parse --show-toplevel || echo ".")' From 520de213659502bed72de6a71a777ae5da53e364 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 15:39:48 +0100 Subject: [PATCH 23/42] imported python completion script, to add new options --- plugins/python/_python | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/python/_python diff --git a/plugins/python/_python b/plugins/python/_python new file mode 100644 index 000000000..f517d4806 --- /dev/null +++ b/plugins/python/_python @@ -0,0 +1,54 @@ +#compdef python + +# Python 2.6 +# Python 3.0 + +local curcontext="$curcontext" state line expl +typeset -A opt_args + +local -a args + +if _pick_variant python3=Python\ 3 python2 --version; then + args=( + '(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' + '(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' + ) +else + args=( + '-Q+[division options]:division option:(old warn warnall new)' + '(-tt)-t[issue warnings about inconsistent tab usage]' + '(-t)-tt[issue errors about inconsistent tab usage]' + '-3[warn about Python 3.x incompatibilities]' + ) +fi + +_arguments -C -s -S "$args[@]" \ + "-B[don't write .py\[co\] files on import]" \ + '(1 -)-c+[program passed in as string (terminates option list)]:python command:' \ + '-d[debug output from parser]' \ + '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \ + '(1 * -)-h[display help information]' \ + '-i[inspect interactively after running script]' \ + '(1 * -)-m[run library module as a script (terminates option list)]:module:->modules' \ + '-O[optimize generated bytecode slightly]' \ + '-OO[remove doc-strings in addition to the -O optimizations]' \ + "-s[don't add user site directory to sys.path]" \ + "-S[don't imply 'import site' on initialization]" \ + '-u[unbuffered binary stdout and stderr]' \ + '-v[verbose (trace import statements)]' \ + '(1 * -)'{-V,--version}'[display version information]' \ + '-W+[warning control]:warning filter (action\:message\:category\:module\:lineno):(default always ignore module once error)' \ + '-x[skip first line of source, allowing use of non-Unix forms of #!cmd]' \ + '(-)1:script file:_files -g "*.py(|c|o)(-.)"' \ + '*::script argument: _normal' && return + +if [[ "$state" = modules ]]; then + local -a modules + modules=( + ${${=${(f)"$(_call_program modules $words[1] -c \ + 'from\ pydoc\ import\ help\;\ help\(\"modules\"\)')"}[2,-3]}:#\(package\)} + ) + _wanted modules expl module compadd -a modules && return +fi + +return 1 From c3f1d5a3e4f0cea5e692fe690285771b109fdade Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 15:40:30 +0100 Subject: [PATCH 24/42] created _git-branch completion script to support git branch --- plugins/git/_git-branch | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 plugins/git/_git-branch diff --git a/plugins/git/_git-branch b/plugins/git/_git-branch new file mode 100644 index 000000000..86d03bc30 --- /dev/null +++ b/plugins/git/_git-branch @@ -0,0 +1,62 @@ +#compdef git-branch + +_git-branch () +{ + declare l c m d + + l='--color --no-color -r -a --all -v --verbose --abbrev --no-abbrev' + c='-l -f --force -t --track --no-track --set-upstream --contains --merged --no-merged' + m='-m -M' + d='-d -D' + + declare -a dependent_creation_args + if (( words[(I)-r] == 0 )); then + dependent_creation_args=( + "($l $m $d): :__git_branch_names" + "::start-point:__git_revisions") + fi + + declare -a dependent_deletion_args + if (( words[(I)-d] || words[(I)-D] )); then + dependent_creation_args= + dependent_deletion_args=( + '-r[delete only remote-tracking branches]') + if (( words[(I)-r] )); then + dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names' + else + dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names' + fi + fi + + declare -a dependent_modification_args + if (( words[(I)-m] || words[(I)-M] )); then + dependent_creation_args= + dependent_modification_args=( + ':old or new branch name:__git_branch_names' + '::new branch name:__git_branch_names') + fi + + _arguments -w -S -s \ + "($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \ + "($c $m $d : --color)--no-color[turn off branch coloring]" \ + "($c $m -a --all)-r[list or delete only remote-tracking branches]" \ + "($c $m $d : -r)"{-a,--all}"[list both remote-tracking branches and local branches]" \ + "($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \ + "($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \ + "($c $m $d :)--no-abbrev[do not abbreviate sha1s]" \ + "($l $m $d)-l[create the branch's reflog]" \ + "($l $m $d -f --force)"{-f,--force}"[force the creation of a new branch]" \ + "($l $m $d -t --track)"{-t,--track}"[set up configuration so that pull merges from the start point]" \ + "($l $m $d)--no-track[override the branch.autosetupmerge configuration variable]" \ + "($l $m $d)--set-upstream[set up configuration so that pull merges]" \ + "($l $m $d)--contains=[only list branches which contain the specified commit]: :__git_committishs" \ + "($l $m $d)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \ + "($l $m $d)--no-merged=[do not list branches which are fully contained by HEAD]: :__git_committishs" \ + $dependent_creation_args \ + "($l $c $d -M)-m[rename a branch and the corresponding reflog]" \ + "($l $c $d -m)-M[rename a branch even if the new branch-name already exists]" \ + $dependent_modification_args \ + "($l $c $m -D)-d[delete a fully merged branch]" \ + "($l $c $m -d)-D[delete a branch]" \ + $dependent_deletion_args +} From 9f73e3b16b92b662949579228eaf0de844271ecf Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 15:40:42 +0100 Subject: [PATCH 25/42] Updated repo completion --- plugins/repo/_repo | 121 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 100 insertions(+), 21 deletions(-) diff --git a/plugins/repo/_repo b/plugins/repo/_repo index 95dbc1b64..9cd293d38 100644 --- a/plugins/repo/_repo +++ b/plugins/repo/_repo @@ -2,11 +2,11 @@ _repo() { + local context state state_descr line curcontext="$curcontext" typeset -A opt_args - local context state line curcontext="$curcontext" local ret=1 - + _arguments -C \ '(- 1 *)--help[show usage]'\ '1:command:->command'\ @@ -36,6 +36,7 @@ _repo() 'push:Push the local branch rebase:Rebase local branches on upstream branch' 'smartsync:Update working tree to the latest known good revision' 'stage:Stage file(s) for commit start:Start a new branch for development' + 'start:Start a new branch for development' 'status:Show the working tree status sync:Update working tree to the latest revision' 'sync:Update working tree to the latest revision' 'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it' @@ -54,28 +55,89 @@ _repo() (args) case $words[1] in - (branch | branches ) + (branch | branches) # TODO : list available projects and add them in list to feed compadd with - _arguments :::_branches_projects + _arguments : \ + '::__repo_projects' + ret=0 ;; (init) - _arguments \ + _arguments : "(-h --help)"{-h,--help}"[Show help]" \ "(-q --quiet)"{-q,--quiet}"[be quiet]" \ - "(-u --manifest-url)"{-u,--manifest-url=}"[manifest repository location]":url:_url \ - "(-b --manifest-branch)"{-b,--manifest-branch=}"[manifest branch or revision]":branch:_branch\ - "(-m --manifest-name)"{-m,--manifest-name=}"[initial manifest file]":manifest_name:_manifest_name\ + "(-u --manifest-url)"{-u,--manifest-url=}"[manifest repository location]":url:__repo_url_prompt \ + "(-b --manifest-branch)"{-b,--manifest-branch=}"[manifest branch or revision]":branch:__repo_branch\ + "(-m --manifest-name)"{-m,--manifest-name=}"[initial manifest file]":manifest_name:__repo_manifest_name\ "(--mirror)--mirror[mirror the forrest]"\ "(--reference)--reference=[location of mirror directory]":dir:_dirs\ - "(--depth)--depth=[create a shallow clone with given depth; see git clone]":depth:_depth\ + "(--depth)--depth=[create a shallow clone with given depth; see git clone]":depth:__repo_depth_prompt\ "(-g --group=)"{-g,--group=}"[restrict manifest projects to ones with a specified group]":group:_group\ - "(-p --platform=)"{-p,--platform=}"[restrict manifest projects to ones with a specified platform group(auto|all|none|linux|darwin|...)]":platform:_platform\ - "(--repo-url)--repo-url=[repo repository location]":url:_url\ - "(--repo-branch)--repo-branch[repo branch or revision]":branch_or_rev:_branch_or_rev\ + "(-p --platform=)"{-p,--platform=}"[restrict manifest projects to ones with a specified platform group(auto|all|none|linux|darwin|...)]":platform:(auto all none linux darwin)\ + "(--repo-url)--repo-url=[repo repository location]":url:__repo_url_prompt\ + "(--repo-branch)--repo-branch[repo branch or revision]":branch_or_rev:__repo__repo_branch_or_rev\ "(--no-repo-verify)--no-repo-verify[do not verify repo source code]"\ "(--config-name)--config-name[Always prompt for name/e-mail]"\ && ret=0 ;; + (start) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(--all)--all=[begin branch in all projects]"\ + ':branch name:__repo_new__repo_branch_name' \ + ':projects:__repo_projects_or_all' \ + && ret=0 + ;; + (checkout) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + ':branch name:__git_branch_names' \ + ':projects:__repo_projects' \ + && ret=0 + ;; + (list) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + && ret=0 + ;; + (status) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-j --jobs)"{-j,--jobs}"[number of projects to check simultaneously]" \ + ':projects:__repo_projects' \ + && ret=0 + ;; + (sync) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(--no-force-broken)--no-force-broken[stop sync if a project fails to sync (probably because of permissions)]" \ + "(-l --local-only)"{-l,--local-only}"[only update working tree, don't fetch]" \ + "(-n --network-only)"{-n,--network-branch}"[fetch only, don't update working tree]" \ + "(-d --detach)"{-d,--detach}"[detach projects back to manifest revision]" \ + "(-c --current-branch)"{-c,--current-branch}"[fetch only current branch from server]" \ + "(-q --quiet)"{-q,--quiet}"[be more quiet]" \ + "(-j --jobs=)"{-j,--jobs=}"[projects to fetch simultaneously (default 1) (limited to 5)]:projects to fetch simultaneously (default 1) (limited to 5)" \ + "(--i-know-i-may-hurt-the-team=)--i-know-i-may-hurt-the-team=[raise the maximum number of jobs]:raise the maximum number of jobs" \ + "(-m --manifest-name=)"{-m,--manifest-name=}"[temporary manifest to use for this sync]:manifest xml file:_files -g *.xml" \ + "(--no-clone-bundle)--no-clone-bundle[disable use of /clone.bundle on HTTP/HTTPS]" \ + "(-s --smart-sync)"{-s,--smart-sync=}"[smart sync using manifest from a known tag]:tag:" \ + '(--no-repo-verify)--no-repo-verify[do not verify repo source code]' \ + ': :__repo_projects' \ + && ret=0 + ;; + (upload) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-t)-t[Send local branch name to Gerrit Code Review]" \ + "(--re= --reviewers=)"{--re=,--reviewers=}"[Request reviews from these people]:Request reviews from these people:" \ + "(--cc=)--cc=[Also send email to these email addresses.]:email addresses:_email_addresses" \ + "(--br=)--br=[Branch to upload.]:branch:__repo_branch" \ + "(--cbr --current-branch)"{--cbr,--current-branch}"[Upload current git branch]" \ + "(-d --draft)"{-d,--draft}"[If specified, upload as a draft.]" \ + "(--verify --no-verify)--no-verify[Do not run the upload hook.]" \ + '(--verify --no-verify)--verify[Run the upload hook without prompting]' \ + ': :__repo_projects' \ + && ret=0 + ;; *) ret=0 esac @@ -85,17 +147,22 @@ _repo() return $ret } -_url() +__repo_reviewers() +{ + # _message -e url 'reviewers' +} + +__repo_url_prompt() { _message -e url 'url' } -_platform() +__repo_platform() { _message -e platform 'platform group(auto|all|none|linux|darwin|...)' } -_manifest_name() +__repo_manifest_name() { _message -e manifest_name 'manifest name' } @@ -105,24 +172,36 @@ _group() _message -e group 'group' } -_branch() +__repo_branch() { - _message -e branch 'branch' + _message -e branch 'Repo branch' } -_branch_or_rev() +__repo__repo_branch_or_rev() { _message -e branch_or_rev 'repo branch or revision' } -_depth() +__repo_depth_prompt() { _message -e depth 'depth' } -_branches_projects() +__repo_projects() { - _message -e depth '...' + #_message -e depth 'Optional option : ...' + projects=($(repo list | cut -d' ' -f1)) + _describe -t projects 'Select projects (keep empty for selecting all projects)' projects +} + +__repo_new__repo_branch_name() +{ + _message -e depth '' +} + +__repo_projects_or_all() +{ + _message -e depth '[--all | ...]' } _repo "$@" From d85771f1614bce7a2752a769d65bfea56af51e40 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 15:40:59 +0100 Subject: [PATCH 26/42] just to add ':' into the _argument command line --- plugins/buildbot/_buildbot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/buildbot/_buildbot b/plugins/buildbot/_buildbot index 7e628eeb1..90b933614 100644 --- a/plugins/buildbot/_buildbot +++ b/plugins/buildbot/_buildbot @@ -7,7 +7,7 @@ _buildbot() local ret=1 - _arguments -C \ + _arguments -C : \ '(- 1 *)--help[show usage]'\ '(- 1 *)--version[display version]'\ '(- 1 *)--verbose[verbose output]'\ From 50d219423689869a1c1100bf032922944833097b Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 14 Feb 2013 16:38:47 +0100 Subject: [PATCH 27/42] better repo completion --- plugins/repo/_repo | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/plugins/repo/_repo b/plugins/repo/_repo index 9cd293d38..7226aaceb 100644 --- a/plugins/repo/_repo +++ b/plugins/repo/_repo @@ -58,7 +58,24 @@ _repo() (branch | branches) # TODO : list available projects and add them in list to feed compadd with _arguments : \ - '::__repo_projects' + "(-h --help)"{-h,--help}"[Show help]" \ + ': :__repo_projects' + ret=0 + ;; + (abandon) + # TODO : list available projects and add them in list to feed compadd with + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + ':branch name:__repo_branch' \ + ': :__repo_projects' + ret=0 + ;; + (checkout) + # TODO : list available projects and add them in list to feed compadd with + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + ':branch name:__repo_branch' \ + ': :__repo_projects' ret=0 ;; (init) @@ -174,7 +191,9 @@ _group() __repo_branch() { - _message -e branch 'Repo branch' + #_message -e branch 'Repo branch' + branches=($(repo branches| cut -c4- | grep '|' | cut -d' ' -f1)) + _describe -t branches 'Select repo branch' branches } __repo__repo_branch_or_rev() @@ -189,19 +208,25 @@ __repo_depth_prompt() __repo_projects() { - #_message -e depth 'Optional option : ...' - projects=($(repo list | cut -d' ' -f1)) + _message -e depth 'Optional option : ...' + projects=("" $(repo list | cut -d' ' -f1)) _describe -t projects 'Select projects (keep empty for selecting all projects)' projects } __repo_new__repo_branch_name() { - _message -e depth '' + branches=($(repo branches| cut -c4- | grep '|' | cut -d' ' -f1)) + _describe "" branches + _message -e "branch name" 'Enter new branch name or select an existing repo branch' } __repo_projects_or_all() { - _message -e depth '[--all | ...]' + #_message -e depth '[--all | ...]' + + projects=(--all $(repo list | cut -d' ' -f1)) + _describe -t projects 'Select projects or --all' projects + _describe -t --all 'All projects' } _repo "$@" From cd5545ff3f584f33b3285207deedff31be937d51 Mon Sep 17 00:00:00 2001 From: Stibbons Date: Thu, 14 Feb 2013 23:19:44 +0100 Subject: [PATCH 28/42] Update lib/aliases.zsh Added new custom aliases --- lib/aliases.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index a7f699c19..8a75ece73 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -3,10 +3,18 @@ alias pu='pushd' alias po='popd' # Basic directory operations +alias ..='cd ..' alias ...='cd ../..' +alias ....='cd ../../..' alias -- -='cd -' +alias cd..='cd ..' +alias cd...='cd ../..' +alias cd....='cd ../../..' +alias cd.....='cd ../../../..' + # Super user +alias sudo='sudo ' # This allow 'sudo ll'. See http://www.shellperson.net/using-sudo-with-an-alias/ alias _='sudo' alias please='sudo' From dd5d72dcd148ae2324bca1e3ffa2b55cc8e1e192 Mon Sep 17 00:00:00 2001 From: Stibbons Date: Thu, 14 Feb 2013 15:00:42 -0800 Subject: [PATCH 29/42] Create README.md Add a dummy README --- plugins/repo/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/repo/README.md diff --git a/plugins/repo/README.md b/plugins/repo/README.md new file mode 100644 index 000000000..f82a610c5 --- /dev/null +++ b/plugins/repo/README.md @@ -0,0 +1,4 @@ +## repo +**Maintainer:** [Stibbons](https://github.com/Stibbons) + +* `thealias` aliases `thecontent` From 7f233789c49a2dcf4bd39aeedf47a70b058606d3 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Fri, 15 Feb 2013 00:15:22 +0100 Subject: [PATCH 30/42] Updated repo plugin README.md --- plugins/repo/README.md | 5 +- plugins/repo/_repo~ | 146 ----------------------------------- plugins/repo/repo.plugin.zsh | 34 -------- 3 files changed, 4 insertions(+), 181 deletions(-) delete mode 100644 plugins/repo/_repo~ diff --git a/plugins/repo/README.md b/plugins/repo/README.md index f82a610c5..0b77e6d48 100644 --- a/plugins/repo/README.md +++ b/plugins/repo/README.md @@ -1,4 +1,7 @@ ## repo **Maintainer:** [Stibbons](https://github.com/Stibbons) -* `thealias` aliases `thecontent` +This plugin mainly add support automatic completion for the repo command line tool: +http://code.google.com/p/git-repo/ + +* `r` aliases `repo` diff --git a/plugins/repo/_repo~ b/plugins/repo/_repo~ deleted file mode 100644 index ecb12b5a1..000000000 --- a/plugins/repo/_repo~ +++ /dev/null @@ -1,146 +0,0 @@ -#compdef repo - -_repo() -{ - typeset -A opt_args - local context state line curcontext="$curcontext" - - local ret=1 - - _arguments -C \ - '(- 1 *)--help[show usage]'\ - '1:command:->command'\ - '*::args:->args' && ret=0 - - case $state in - (command) - repo status 2> /dev/null > /dev/null - if [[ $? == 0 ]]; then - local commands; - commands=( - 'abandon:Permanently abandon a development branch' - 'branch:View current topic branches' - 'branches:View current topic branches' - 'checkout:Checkout a branch for development' - 'checkout-manifest:for every project in a manifest tag file check out the sha1 listed in the file' - 'cherry-pick:Cherry-pick a change.' - 'diff:Show changes between commit and working tree' - 'download:Download and checkout a change' - 'format-patch:build patch sets for each project common to a manifest baseline' - 'grep:Print lines matching a pattern' - 'help:Display detailed help on a command' - 'init:Initialize repo in the current directory' - 'list:List projects and their associated directories' - 'overview:Display overview of unmerged project branches' - 'prune:Prune (delete) already merged topics' - 'push:Push the local branch rebase:Rebase local branches on upstream branch' - 'smartsync:Update working tree to the latest known good revision' - 'stage:Stage file(s) for commit start:Start a new branch for development' - 'status:Show the working tree status sync:Update working tree to the latest revision' - 'sync:Update working tree to the latest revision' - 'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it' - 'upload:Upload changes for code review' - ) - _describe -t commands 'command' commands && ret=0 - else - local commands; - commands=( - 'init:Install repo in the current working directory' - 'help:Display detailed help on a command' - ) - _describe -t commands 'command' commands && ret=0 - fi - ;; - (args) - - case $words[1] in - (branch | branches ) - # TODO : list available projects and add them in list to feed compadd with - _arguments :::_branches_projects - ;; - (init) - _arguments \ - "(-h --help)"{-h,--help}"[Show help]" \ - "(-q --quiet)"{-q,--quiet}"[be quiet]" \ - "(-u --manifest-url)"{-u,--manifest-url=}"[manifest repository location]":url:_url \ - "(-b --manifest-branch)"{-b,--manifest-branch=}"[manifest branch or revision]":branch:_branch\ - "(-m --manifest-name)"{-m,--manifest-name=}"[initial manifest file]":manifest_name:_manifest_name\ - "(--mirror)--mirror[mirror the forrest]"\ - "(--reference)--reference=[location of mirror directory]":dir:_dirs\ - "(--depth)--depth=[create a shallow clone with given depth; see git clone]":depth:_depth\ - "(-g --group=)"{-g,--group=}"[restrict manifest projects to ones with a specified group]":group:_group\ - "(-p --platform=)"{-p,--platform=}"[restrict manifest projects to ones with a specified platform group(auto|all|none|linux|darwin|...)]":platform:_platform\ - "(--repo-url)--repo-url=[repo repository location]":url:_url\ - "(--repo-branch)--repo-branch[repo branch or revision]":branch_or_rev:_branch_or_rev\ - "(--no-repo-verify)--no-repo-verify[do not verify repo source code]"\ - "(--config-name)--config-name[Always prompt for name/e-mail]"\ - && ret=0 - ;; - *) - ret=0 - esac - ;; - esac - - return $ret -} - -_url() -{ - _message -e url 'url' -} - -_platform() -{ - _message -e platform 'platform group(auto|all|none|linux|darwin|...)' -} - -_manifest_name() -{ - _message -e manifest_name 'manifest name' -} - -_group() -{ - _message -e group 'group' -} - -_branch() -{ - _message -e branch 'branch' -} - -_branch_or_rev() -{ - _message -e branch_or_rev 'repo branch or revision' -} - -_depth() -{ - _message -e depth 'depth' -} - -_branches_projects() -{ - _message -e depth '...' -} - -_repo "$@" -return $? - - -#typeset -A opt_args - -local context state line -local fontdir - -_arguments \ - "(-l -c -r)init[Install repo in the current working directory]" \ - "(-l -c -r)help[Display detailed help on a command]" \ - && return 0 - - -return 1 - - - diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh index 7a97b86ce..6d19c4999 100644 --- a/plugins/repo/repo.plugin.zsh +++ b/plugins/repo/repo.plugin.zsh @@ -1,36 +1,2 @@ # Aliases #alias r='repo' - -## -#function listRepoCompletions { -# reply=( -# abandon - #branch -# branches -# checkout -# checkout-manifest -# cherry-pick -# diff - #download -# format-patch -# forall -# grep -# help -# init -# list - #overview -# prune -# push -# rebase -# smartsync -# stage -# start -# status - #sync -# tag-manifest -# upload -# ); -#} - -###compctl -K listRepoCompletions repo - From 41918f381c40446408e4eeff297fd8b7f111495c Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Fri, 15 Feb 2013 00:17:21 +0100 Subject: [PATCH 31/42] Added README.md into git-remote-branch plugin --- plugins/git-remote-branch/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/git-remote-branch/README.md diff --git a/plugins/git-remote-branch/README.md b/plugins/git-remote-branch/README.md new file mode 100644 index 000000000..e3f4c29b8 --- /dev/null +++ b/plugins/git-remote-branch/README.md @@ -0,0 +1,5 @@ +## git-remore-branch +**Maintainer:** [Stibbons](https://github.com/Stibbons) + +This plugin increase support for the 'git remote branch' completion function from zsh, adding the +following feature: From e49bdb393633c4468d3cbe908c286dd06eb411de Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Fri, 15 Feb 2013 00:18:52 +0100 Subject: [PATCH 32/42] added README.md into git plugin --- plugins/git/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/git/README.md diff --git a/plugins/git/README.md b/plugins/git/README.md new file mode 100644 index 000000000..8462dda1c --- /dev/null +++ b/plugins/git/README.md @@ -0,0 +1,4 @@ +## git +**Maintainer:** [Stibbons](https://github.com/Stibbons) + +This plugin adds several git aliases and increase the completion function provided by zsh From f7d706a073768c6b59f75480146d5a4e48b7d004 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Fri, 15 Feb 2013 09:33:31 +0100 Subject: [PATCH 33/42] added forall repo command Signed-off-by: Gaetan Semet --- plugins/repo/_repo | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plugins/repo/_repo b/plugins/repo/_repo index 7226aaceb..bbfea7102 100644 --- a/plugins/repo/_repo +++ b/plugins/repo/_repo @@ -27,6 +27,7 @@ _repo() 'diff:Show changes between commit and working tree' 'download:Download and checkout a change' 'format-patch:build patch sets for each project common to a manifest baseline' + 'forall:execute command on several project' 'grep:Print lines matching a pattern' 'help:Display detailed help on a command' 'init:Initialize repo in the current directory' @@ -155,6 +156,15 @@ _repo() ': :__repo_projects' \ && ret=0 ;; + (forall) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-v --verbose)"{-v,--verbose}"[Show command error messages]" \ + '(-p)-p[Show project headers before output]' \ + ': :__repo_projects_mandatory' \ + "(-c --command -h --help -v --verbose -p)"{-c,--command}"[Command (and arguments) to execute]" \ + && ret=0 + ;; *) ret=0 esac @@ -209,10 +219,17 @@ __repo_depth_prompt() __repo_projects() { _message -e depth 'Optional option : ...' - projects=("" $(repo list | cut -d' ' -f1)) + projects=($(repo list | cut -d' ' -f1)) _describe -t projects 'Select projects (keep empty for selecting all projects)' projects } +__repo_projects_mandatory() +{ + projects=($(repo list | cut -d' ' -f1)) + #_describe -t projects 'Select projects to apply commands' projects + _values -s ' ' "Select projects to apply commands" $projects +} + __repo_new__repo_branch_name() { branches=($(repo branches| cut -c4- | grep '|' | cut -d' ' -f1)) From 3700a46f668c2797994a11ff56e90fc0eebe4bac Mon Sep 17 00:00:00 2001 From: ChaYoung You Date: Sat, 23 Feb 2013 16:02:48 +0900 Subject: [PATCH 34/42] Add aliases 'grb*' for git-rebase (cherry picked from commit 2d3c7f0a8126bf73cabf17efa8568ff59d59fa0d) --- plugins/git/git.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e554d9cfa..d54080322 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -31,6 +31,12 @@ alias grset='git remote set-url' compdef _git grset=git-remote alias grup='git remote update' compdef _git grset=git-remote +alias grbi='git rebase -i' +compdef _git grbi=git-rebase +alias grbc='git rebase --continue' +compdef _git grbc=git-rebase +alias grba='git rebase --abort' +compdef _git grba=git-rebase alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' From 2b8d4782f61e2eba13a9395ed921fe9a40f08ac8 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 25 Feb 2013 14:49:08 +0100 Subject: [PATCH 35/42] updated 'gk' alias Signed-off-by: Gaetan Semet --- 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 e554d9cfa..98eda0d55 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -59,7 +59,7 @@ alias gf='git ls-files | grep' alias gpoat='git push origin --all && git push origin --tags' alias gg='git gui' -alias gk='gitk' +alias gk='gitk --all --branches' # Will cd into the top of the current repository # or submodule. From 6817a553a61d34a21206d6ba3be6714f52eca8e1 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 28 Feb 2013 14:59:59 +0100 Subject: [PATCH 36/42] gg and gga are now aliases dedicated to commit and only commit (and respectively amend commit) --- plugins/git/git.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index dbfa8b5bf..2f73d9755 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -64,7 +64,8 @@ alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' alias gf='git ls-files | grep' alias gpoat='git push origin --all && git push origin --tags' -alias gg='git gui' +alias gg='git gui citool' +alias gga='git gui citool --amend' alias gk='gitk --all --branches' # Will cd into the top of the current repository From 4ac576daf8527a9f7d741475a9eeebae014d186f Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 28 Feb 2013 15:01:36 +0100 Subject: [PATCH 37/42] Also commit custom plugins (but do not pull on upstream) --- .gitignore | 4 --- custom/plugins/intelbuildbot/_launch_trial.sh | 28 +++++++++++++++++++ .../intelbuildbot/intelbuildbot.plugin.zsh | 1 + 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 custom/plugins/intelbuildbot/_launch_trial.sh create mode 100644 custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh diff --git a/.gitignore b/.gitignore index 51a5ee6c3..c085ca126 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ locals.zsh log/.zsh_history projects.zsh -custom/* -!custom/example -!custom/example.zsh *.swp -!custom/example.zshcache cache/ diff --git a/custom/plugins/intelbuildbot/_launch_trial.sh b/custom/plugins/intelbuildbot/_launch_trial.sh new file mode 100644 index 000000000..268e5082d --- /dev/null +++ b/custom/plugins/intelbuildbot/_launch_trial.sh @@ -0,0 +1,28 @@ +#compdef -P (|./)launch_trial.sh + +__launch_trial_list_tests() +{ + tests=($(./launch_trial.sh --list-tests)) + _describe -t tests 'Select test to run' tests +} + +_launch_trial() +{ + typeset -A opt_args + local context state line curcontext="$curcontext" + + local ret=1 + + _arguments -C : \ + '(- 1 *)--help[show usage]'\ + '(- 1 *)--htmlcov[generate html coverage report in htmlcov surbdirectory]'\ + '(- 1 *)--list-tests[list all tests]'\ + ':projects:__launch_trial_list_tests' \ + && ret=0 + + return $ret +} + +_launch_trial "$@" +return $? + diff --git a/custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh b/custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh new file mode 100644 index 000000000..1487a25f2 --- /dev/null +++ b/custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh @@ -0,0 +1 @@ +# Aliases \ No newline at end of file From a6d3350197d57d05adb712e755b47f27cd0a845f Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Thu, 28 Feb 2013 16:20:05 +0100 Subject: [PATCH 38/42] Fixed bugs in repo, added missing command 'rebase' --- plugins/repo/_repo | 35 ++++++++++++++++++++++++++++++++--- plugins/repo/repo.plugin.zsh | 2 +- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/plugins/repo/_repo b/plugins/repo/_repo index bbfea7102..62e8387a7 100644 --- a/plugins/repo/_repo +++ b/plugins/repo/_repo @@ -1,5 +1,21 @@ #compdef repo + +__git_apply_whitespace_strategies () +{ + declare -a strategies + + strategies=( + 'nowarn:turn off the trailing-whitespace warning' + 'warn:output trailing-whitespace warning, but apply patch' + 'fix:output trailing-whitespace warning and strip trailing whitespace' + 'error:output trailing-whitespace warning and refuse to apply patch' + 'error-all:same as "error", but output warnings for all files') + + _describe -t strategies 'trailing-whitespace resolution strategy' strategies $* +} + + _repo() { local context state state_descr line curcontext="$curcontext" @@ -34,11 +50,12 @@ _repo() 'list:List projects and their associated directories' 'overview:Display overview of unmerged project branches' 'prune:Prune (delete) already merged topics' - 'push:Push the local branch rebase:Rebase local branches on upstream branch' + 'push:Push the local branch' + 'rebase:Rebase local branches on upstream branch' 'smartsync:Update working tree to the latest known good revision' - 'stage:Stage file(s) for commit start:Start a new branch for development' + 'stage:Stage file(s) for commit' 'start:Start a new branch for development' - 'status:Show the working tree status sync:Update working tree to the latest revision' + 'status:Show the working tree status' 'sync:Update working tree to the latest revision' 'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it' 'upload:Upload changes for code review' @@ -105,6 +122,18 @@ _repo() ':projects:__repo_projects_or_all' \ && ret=0 ;; + (rebase) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-i --interactive)"{-i,--interactive}"[interactive rebase (single project only)]: :__repo_projects" \ + "(-f --force-rebase)"{-f,--force-rebase}"[Pass --force-rebase to git rebase]" \ + "(--no-ff)--no-ff=[Pass --no-ff to git rebase]"\ + "(-q --quiet)"{-q,--quiet}"[Pass --quiet to git rebase]" \ + "(--autosquash)--no-ff[Pass --autosquash to git rebase]"\ + "(--whitespace=)--whitespace=[Pass --whitespace to git rebase]: :__git_apply_whitespace_strategies"\ + "(--auto-stash)--auto-stash[Stash local modifications before starting]"\ + && ret=0 + ;; (checkout) _arguments : \ "(-h --help)"{-h,--help}"[Show help]" \ diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh index 6d19c4999..9cc336959 100644 --- a/plugins/repo/repo.plugin.zsh +++ b/plugins/repo/repo.plugin.zsh @@ -1,2 +1,2 @@ # Aliases -#alias r='repo' +alias r='repo' From af36224882b186baae09c4dc3c8ba66b098db103 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 4 Mar 2013 10:49:16 +0100 Subject: [PATCH 39/42] Reworked custom script completion (launch_trial) Signed-off-by: Gaetan Semet --- custom/plugins/{intelbuildbot => launch_trial}/_launch_trial.sh | 0 .../launch_trial.plugin.zsh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename custom/plugins/{intelbuildbot => launch_trial}/_launch_trial.sh (100%) rename custom/plugins/{intelbuildbot/intelbuildbot.plugin.zsh => launch_trial/launch_trial.plugin.zsh} (100%) diff --git a/custom/plugins/intelbuildbot/_launch_trial.sh b/custom/plugins/launch_trial/_launch_trial.sh similarity index 100% rename from custom/plugins/intelbuildbot/_launch_trial.sh rename to custom/plugins/launch_trial/_launch_trial.sh diff --git a/custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh b/custom/plugins/launch_trial/launch_trial.plugin.zsh similarity index 100% rename from custom/plugins/intelbuildbot/intelbuildbot.plugin.zsh rename to custom/plugins/launch_trial/launch_trial.plugin.zsh From e040ce8c128da6dc7123c41bb5dd5335abcf8186 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 4 Mar 2013 10:49:38 +0100 Subject: [PATCH 40/42] New plugin : common aliases Signed-off-by: Gaetan Semet --- .../common-aliases/common-aliases-plugin.zsh | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 custom/plugins/common-aliases/common-aliases-plugin.zsh diff --git a/custom/plugins/common-aliases/common-aliases-plugin.zsh b/custom/plugins/common-aliases/common-aliases-plugin.zsh new file mode 100644 index 000000000..70936498d --- /dev/null +++ b/custom/plugins/common-aliases/common-aliases-plugin.zsh @@ -0,0 +1,90 @@ +#Aliases +##ls, the common ones I use a lot shortened for rapid fire usage +alias ls='ls --color' #I like color +alias l='ls -lFh' #size,show type,human readable +alias la='ls -lAFh' #long list,show almost all,show type,human readable +alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable +alias lt='ls -ltFh' #long list,sorted by date,show type,human readable +alias ll='ls -l' #long list +alias ldot='ls -ld .*' +alias lS='ls -1FSsh' +alias lart='ls -1Fcart' +alias lrt='ls -1Fcrt' + +alias zshrc='vim ~/.zshrc' + +alias grep='grep --color' +alias sgrep='grep -R -n -H -C 5' + +alias cdb='cd ~/projects/buildbot/' + +# cd, because typing the backslash is A LOT of work!! +alias ..='cd ../' +alias ...='cd ../../' +alias ....='cd ../../../' +alias .....='cd ../../../../' + +# Command line head / tail shortcuts +alias -g H='| head' +alias -g T='| tail' +alias -g G='| grep' +alias -g L="| less" +alias -g M="| most" +alias -g LL="2>&1 | less" +alias -g CA="2>&1 | cat -A" +alias -g NE="2> /dev/null" +alias -g NUL="> /dev/null 2>&1" +alias -g P="2>&1| pygmentize -l pytb" + +alias dud='du --max-depth=1 -h' +alias duf='du -sh *' +alias fd='find . -type d -name' +alias ff='find . -type f -name' + +alias h='history' +alias hgrep="fc -El 0 | grep" +alias help='man' +alias j='jobs' +alias p='ps -f' +alias sortnr='sort -n -r' +alias unexport='unset' + +alias whereami=display_info + +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' + +# zsh is able to auto-do some kungfoo +# depends on the SUFFIX :) +if [ ${ZSH_VERSION//\./} -ge 420 ]; then + # open browser on urls + _browser_fts=(htm html de org net com at cx nl se dk dk php) + for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done + + _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex) + for ft in $_editor_fts ; do alias -s $ft=$EDITOR ; done + + _image_fts=(jpg jpeg png gif mng tiff tif xpm) + for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done + + _media_fts=(avi mpg mpeg ogm mp3 wav ogg ape rm mov mkv) + for ft in $_media_fts ; do alias -s $ft=mplayer ; done + + #read documents + alias -s pdf=acroread + alias -s ps=gv + alias -s dvi=xdvi + alias -s chm=xchm + alias -s djvu=djview + + #list whats inside packed file + alias -s zip="unzip -l" + alias -s rar="unrar l" + alias -s tar="tar tf" + alias -s tar.gz="echo " + alias -s ace="unace l" +fi + +zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' + From 657800ce3f2b0125d4e58bbde7ba952f013fc554 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 4 Mar 2013 11:00:34 +0100 Subject: [PATCH 41/42] Fixed file name issues Signed-off-by: Gaetan Semet --- .../{common-aliases-plugin.zsh => common-aliases.plugin.zsh} | 0 tools/install.sh | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename custom/plugins/common-aliases/{common-aliases-plugin.zsh => common-aliases.plugin.zsh} (100%) diff --git a/custom/plugins/common-aliases/common-aliases-plugin.zsh b/custom/plugins/common-aliases/common-aliases.plugin.zsh similarity index 100% rename from custom/plugins/common-aliases/common-aliases-plugin.zsh rename to custom/plugins/common-aliases/common-aliases.plugin.zsh diff --git a/tools/install.sh b/tools/install.sh index 41f83e354..6d3c1a0be 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,7 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { +hash git >/dev/null && /usr/bin/env git clone https://github.com/stibbons/oh-my-zsh.git ~/.oh-my-zsh || { echo "git not installed" exit } @@ -32,6 +32,7 @@ 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"' (Forked version) '"\033[0m" echo "\n\n \033[0;32m....is now installed.\033[0m" /usr/bin/env zsh From b86edde752cdb3f2d53ff67e64a03aa90bfc8394 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 4 Mar 2013 16:41:32 +0100 Subject: [PATCH 42/42] Renamed gsemet theme to stibbons theme Signed-off-by: Gaetan Semet --- themes/{gsemet.zsh-theme => stibbons.zsh-theme} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename themes/{gsemet.zsh-theme => stibbons.zsh-theme} (100%) diff --git a/themes/gsemet.zsh-theme b/themes/stibbons.zsh-theme similarity index 100% rename from themes/gsemet.zsh-theme rename to themes/stibbons.zsh-theme