From c40964f304062780ce9aca4847fa4b07c246428d Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sat, 26 Nov 2011 20:30:46 +1100 Subject: [PATCH 001/203] Added my blue theme for zshell! Personal changes. ( cleaner for AUR controlled oh-my-zsh ) --- themes/james-blue.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 themes/james-blue.zsh-theme diff --git a/themes/james-blue.zsh-theme b/themes/james-blue.zsh-theme new file mode 100644 index 000000000..aec2263a4 --- /dev/null +++ b/themes/james-blue.zsh-theme @@ -0,0 +1,2 @@ +PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[blue]%}%m:%{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' +RPROMPT='$(git_prompt_info)' From 27653a75242d3c7cc2143cbae929a452d5319452 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sat, 26 Nov 2011 22:21:50 +1100 Subject: [PATCH 002/203] Example /etc/zsh/zshrc or ~/.zsh file. --- templates/zshrc | 113 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 templates/zshrc diff --git a/templates/zshrc b/templates/zshrc new file mode 100755 index 000000000..5b8ecbc7d --- /dev/null +++ b/templates/zshrc @@ -0,0 +1,113 @@ +################### +# Options for Zsh # + +export HISTFILE=~/.zsh_history +export HISTSIZE=50000 +export SAVEHIST=50000 +eval `dircolors -b` +bindkey -e + +autoload -U colors && colors +autoload -U compinit compinit +setopt autopushd pushdminus pushdsilent pushdtohome +setopt autocd +setopt cdablevars +#setopt ignoreeof +setopt interactivecomments +setopt nobanghist +#setopt noclobber +setopt HIST_REDUCE_BLANKS +setopt HIST_IGNORE_SPACE +setopt SH_WORD_SPLIT +#setopt nohup + +# Vars used later on by Zsh +export EDITOR=/usr/bin/vim +export BROWSER=/usr/bin/firefox +export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" +export PAGER=/bin/less + +################################ +# Stuff to make my life easier # + +# allow approximate +zstyle ':completion:*' completer _complete _match _approximate +zstyle ':completion:*:match:*' original only +zstyle ':completion:*:approximate:*' max-errors 1 numeric + +# tab completion for PID :D +zstyle ':completion:*:*:kill:*' menu yes select +zstyle ':completion:*:kill:*' force-list always + +# cd not select parent dir +zstyle ':completion:*:cd:*' ignore-parents parent pwd + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +################################################################## +# Key bindings +# http://mundy.yazzy.org/unix/zsh.php +# http://www.zsh.org/mla/users/2000/msg00727.html + +typeset -g -A key +bindkey '^?' backward-delete-char +bindkey '^[[1~' beginning-of-line +bindkey '^[[5~' up-line-or-history +bindkey '^[[3~' delete-char +bindkey '^[[4~' end-of-line +bindkey '^[[6~' down-line-or-history +bindkey '^[[A' up-line-or-search +bindkey '^[[D' backward-char +bindkey '^[[B' down-line-or-search +bindkey '^[[C' forward-char +bindkey '^[w' backward-delete-to-slash +# completion in the middle of a line +bindkey '^i' expand-or-complete-prefix + +############## +# My aliases # + +# Set up auto +alias -s html=$BROWSER +alias -s zip='tar -xzvf' +alias -s tar='tar -xzvf' +alias -s tgz='tar -xzvf' +alias -s gz='tar -xzvf' +alias -s xz='tar -xzvf' +alias -s txt=$EDITOR +alias -s PKGBUILD=$EDITOR + +# Normal aliases +alias ls='ls --color=auto -F' +alias lsd='ls -ld *(-/DN)' +alias lsa='ls -ld .*' +alias l='ls -Glarth' +alias f='find|grep' +alias svim="sudo $EDITOR" +alias updatedb="sudo updatedb" +alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" +alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" + +# command DN equivalent todevnulldevnullmand &> /dev/null & +alias -g DN='&> /dev/null &' + +pacman() { + case $1 in + -S | -S[^sih]* | -R* | -U*) /usr/bin/su -c"/usr/bin/pacman-color \"$@\"" || /usr/bin/su -c"/usr/bin/pacman \"$@\"" ;; + *) /usr/bin/pacman-color "$@" || /usr/bin/pacman "$@" ;; + esac +} + +/usr/local/share/oh-my-zsh.sh From 0dd83bd3aa5d5d6cf3c7b0639cd0e32aeac5e3b8 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 00:12:03 +1100 Subject: [PATCH 003/203] This is nothing. got deleted! moved to zshrc.arch-zsh-template and edited. Was zshrc, but modified --- templates/zshrc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 templates/zshrc diff --git a/templates/zshrc b/templates/zshrc old mode 100755 new mode 100644 index 5b8ecbc7d..0f857cb9c --- a/templates/zshrc +++ b/templates/zshrc @@ -81,11 +81,11 @@ bindkey '^i' expand-or-complete-prefix # Set up auto alias -s html=$BROWSER -alias -s zip='tar -xzvf' -alias -s tar='tar -xzvf' -alias -s tgz='tar -xzvf' -alias -s gz='tar -xzvf' -alias -s xz='tar -xzvf' +alias -s zip='tar -xf' +alias -s tar='tar -xf' +alias -s tgz='tar -xf' +alias -s gz='tar -xf' +alias -s xz='tar -xf' alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR @@ -104,10 +104,10 @@ alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\ alias -g DN='&> /dev/null &' pacman() { + pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} + sudo_bin==sudo case $1 in - -S | -S[^sih]* | -R* | -U*) /usr/bin/su -c"/usr/bin/pacman-color \"$@\"" || /usr/bin/su -c"/usr/bin/pacman \"$@\"" ;; - *) /usr/bin/pacman-color "$@" || /usr/bin/pacman "$@" ;; + -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; + *) $pacman_bin "$@" ;; esac } - -/usr/local/share/oh-my-zsh.sh From 3585c734dd34b911563fe651316be63492f6d7d2 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 00:15:14 +1100 Subject: [PATCH 004/203] Was zshrc. Also modified. moved to zsh.arch-zsh-template. --- templates/zshrc.arch-zsh-template | 143 ++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 templates/zshrc.arch-zsh-template diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template new file mode 100644 index 000000000..cd13e1514 --- /dev/null +++ b/templates/zshrc.arch-zsh-template @@ -0,0 +1,143 @@ +# Path to your oh-my-zsh configuration. +ZSH=/usr/local/share/oh-my-zsh + +# Set name of the theme to load. +# Look in /usr/local/share/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="james-blue" + +# 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/*) +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# Options for Zsh # + +export HISTFILE=~/.zsh_history +export HISTSIZE=50000 +export SAVEHIST=50000 +eval `dircolors -b` +bindkey -v +bindkey -e + +autoload -U colors && colors +autoload -U compinit compinit +setopt autopushd pushdminus pushdsilent pushdtohome +setopt autocd +setopt cdablevars +#setopt ignoreeof +setopt interactivecomments +setopt nobanghist +#setopt noclobber +setopt HIST_REDUCE_BLANKS +setopt HIST_IGNORE_SPACE +setopt SH_WORD_SPLIT +#setopt nohup + +# Vars used later on by Zsh +export EDITOR=/usr/bin/vim +export BROWSER=/usr/bin/firefox +export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" +export PAGER=/bin/less + +################################ +# Stuff to make my life easier # + +# allow approximate +zstyle ':completion:*' completer _complete _match _approximate +zstyle ':completion:*:match:*' original only +zstyle ':completion:*:approximate:*' max-errors 1 numeric + +# tab completion for PID :D +zstyle ':completion:*:*:kill:*' menu yes select +zstyle ':completion:*:kill:*' force-list always + +# cd not select parent dir +zstyle ':completion:*:cd:*' ignore-parents parent pwd + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +################################################################## +# Key bindings +# http://mundy.yazzy.org/unix/zsh.php +# http://www.zsh.org/mla/users/2000/msg00727.html + +typeset -g -A key +bindkey '^?' backward-delete-char +bindkey '^[[1~' beginning-of-line +bindkey '^[[5~' up-line-or-history +bindkey '^[[3~' delete-char +bindkey '^[[4~' end-of-line +bindkey '^[[6~' down-line-or-history +bindkey '^[[A' up-line-or-search +bindkey '^[[D' backward-char +bindkey '^[[B' down-line-or-search +bindkey '^[[C' forward-char +bindkey '^[w' backward-delete-to-slash +# completion in the middle of a line +bindkey '^i' expand-or-complete-prefix + +############## +# My aliases # + +# Set up auto +alias -s html=$BROWSER +alias -s zip='tar -xf' +alias -s tar='tar -xf' +alias -s tgz='tar -xf' +alias -s gz='tar -xf' +alias -s xz='tar -xf' +alias -s txt=$EDITOR +alias -s PKGBUILD=$EDITOR + +# Normal aliases +alias ls='ls --color=auto -F' +alias lsd='ls -ld *(-/DN)' +alias lsa='ls -ld .*' +alias l='ls -Glarth' +alias f='find|grep' +alias svim="sudo $EDITOR" +alias updatedb="sudo updatedb" +alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" +alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" + +# command DN equivalent todevnulldevnullmand &> /dev/null & +alias -g DN='&> /dev/null &' + +pacman() { + pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} + sudo_bin==sudo + case $1 in + -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; + *) $pacman_bin "$@" ;; + esac +} From bb73103527c4dd37a0cbcd6563b3a01f03698624 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 00:17:06 +1100 Subject: [PATCH 005/203] DELETE! --- templates/zshrc | 113 ------------------------------------------------ 1 file changed, 113 deletions(-) delete mode 100644 templates/zshrc diff --git a/templates/zshrc b/templates/zshrc deleted file mode 100644 index 0f857cb9c..000000000 --- a/templates/zshrc +++ /dev/null @@ -1,113 +0,0 @@ -################### -# Options for Zsh # - -export HISTFILE=~/.zsh_history -export HISTSIZE=50000 -export SAVEHIST=50000 -eval `dircolors -b` -bindkey -e - -autoload -U colors && colors -autoload -U compinit compinit -setopt autopushd pushdminus pushdsilent pushdtohome -setopt autocd -setopt cdablevars -#setopt ignoreeof -setopt interactivecomments -setopt nobanghist -#setopt noclobber -setopt HIST_REDUCE_BLANKS -setopt HIST_IGNORE_SPACE -setopt SH_WORD_SPLIT -#setopt nohup - -# Vars used later on by Zsh -export EDITOR=/usr/bin/vim -export BROWSER=/usr/bin/firefox -export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" -export PAGER=/bin/less - -################################ -# Stuff to make my life easier # - -# allow approximate -zstyle ':completion:*' completer _complete _match _approximate -zstyle ':completion:*:match:*' original only -zstyle ':completion:*:approximate:*' max-errors 1 numeric - -# tab completion for PID :D -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:kill:*' force-list always - -# cd not select parent dir -zstyle ':completion:*:cd:*' ignore-parents parent pwd - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -################################################################## -# Key bindings -# http://mundy.yazzy.org/unix/zsh.php -# http://www.zsh.org/mla/users/2000/msg00727.html - -typeset -g -A key -bindkey '^?' backward-delete-char -bindkey '^[[1~' beginning-of-line -bindkey '^[[5~' up-line-or-history -bindkey '^[[3~' delete-char -bindkey '^[[4~' end-of-line -bindkey '^[[6~' down-line-or-history -bindkey '^[[A' up-line-or-search -bindkey '^[[D' backward-char -bindkey '^[[B' down-line-or-search -bindkey '^[[C' forward-char -bindkey '^[w' backward-delete-to-slash -# completion in the middle of a line -bindkey '^i' expand-or-complete-prefix - -############## -# My aliases # - -# Set up auto -alias -s html=$BROWSER -alias -s zip='tar -xf' -alias -s tar='tar -xf' -alias -s tgz='tar -xf' -alias -s gz='tar -xf' -alias -s xz='tar -xf' -alias -s txt=$EDITOR -alias -s PKGBUILD=$EDITOR - -# Normal aliases -alias ls='ls --color=auto -F' -alias lsd='ls -ld *(-/DN)' -alias lsa='ls -ld .*' -alias l='ls -Glarth' -alias f='find|grep' -alias svim="sudo $EDITOR" -alias updatedb="sudo updatedb" -alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" -alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" - -# command DN equivalent todevnulldevnullmand &> /dev/null & -alias -g DN='&> /dev/null &' - -pacman() { - pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} - sudo_bin==sudo - case $1 in - -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; - *) $pacman_bin "$@" ;; - esac -} From fde3b948ebb3641889569ac3798b40de6d6160ed Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 16:50:58 +1100 Subject: [PATCH 006/203] Cleaned, testing, and will be optimized for /etc/zshrc/zshrc & ~/zshrc working together. Backup of the file. (mv'd) --- templates/zshrc.arch-zsh-template | 122 ++---------------------------- 1 file changed, 5 insertions(+), 117 deletions(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index cd13e1514..1ab40aba6 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,17 +1,17 @@ # Path to your oh-my-zsh configuration. -ZSH=/usr/local/share/oh-my-zsh +ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. -# Look in /usr/local/share/oh-my-zsh/themes/ +# 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="james-blue" +ZSH_THEME="robbyrussell" # Set to this to use case-sensitive completion # 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" @@ -28,116 +28,4 @@ plugins=(git) source $ZSH/oh-my-zsh.sh -# Options for Zsh # - -export HISTFILE=~/.zsh_history -export HISTSIZE=50000 -export SAVEHIST=50000 -eval `dircolors -b` -bindkey -v -bindkey -e - -autoload -U colors && colors -autoload -U compinit compinit -setopt autopushd pushdminus pushdsilent pushdtohome -setopt autocd -setopt cdablevars -#setopt ignoreeof -setopt interactivecomments -setopt nobanghist -#setopt noclobber -setopt HIST_REDUCE_BLANKS -setopt HIST_IGNORE_SPACE -setopt SH_WORD_SPLIT -#setopt nohup - -# Vars used later on by Zsh -export EDITOR=/usr/bin/vim -export BROWSER=/usr/bin/firefox -export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" -export PAGER=/bin/less - -################################ -# Stuff to make my life easier # - -# allow approximate -zstyle ':completion:*' completer _complete _match _approximate -zstyle ':completion:*:match:*' original only -zstyle ':completion:*:approximate:*' max-errors 1 numeric - -# tab completion for PID :D -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:kill:*' force-list always - -# cd not select parent dir -zstyle ':completion:*:cd:*' ignore-parents parent pwd - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -################################################################## -# Key bindings -# http://mundy.yazzy.org/unix/zsh.php -# http://www.zsh.org/mla/users/2000/msg00727.html - -typeset -g -A key -bindkey '^?' backward-delete-char -bindkey '^[[1~' beginning-of-line -bindkey '^[[5~' up-line-or-history -bindkey '^[[3~' delete-char -bindkey '^[[4~' end-of-line -bindkey '^[[6~' down-line-or-history -bindkey '^[[A' up-line-or-search -bindkey '^[[D' backward-char -bindkey '^[[B' down-line-or-search -bindkey '^[[C' forward-char -bindkey '^[w' backward-delete-to-slash -# completion in the middle of a line -bindkey '^i' expand-or-complete-prefix - -############## -# My aliases # - -# Set up auto -alias -s html=$BROWSER -alias -s zip='tar -xf' -alias -s tar='tar -xf' -alias -s tgz='tar -xf' -alias -s gz='tar -xf' -alias -s xz='tar -xf' -alias -s txt=$EDITOR -alias -s PKGBUILD=$EDITOR - -# Normal aliases -alias ls='ls --color=auto -F' -alias lsd='ls -ld *(-/DN)' -alias lsa='ls -ld .*' -alias l='ls -Glarth' -alias f='find|grep' -alias svim="sudo $EDITOR" -alias updatedb="sudo updatedb" -alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" -alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" - -# command DN equivalent todevnulldevnullmand &> /dev/null & -alias -g DN='&> /dev/null &' - -pacman() { - pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} - sudo_bin==sudo - case $1 in - -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; - *) $pacman_bin "$@" ;; - esac -} +# Customize to your needs... From 1232b688e18167bc2adc459bdcf7d15770645a89 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 16:52:10 +1100 Subject: [PATCH 007/203] moved/renamed --- templates/zshrc.arch-zsh-template.bk | 144 +++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 templates/zshrc.arch-zsh-template.bk diff --git a/templates/zshrc.arch-zsh-template.bk b/templates/zshrc.arch-zsh-template.bk new file mode 100644 index 000000000..a714103bc --- /dev/null +++ b/templates/zshrc.arch-zsh-template.bk @@ -0,0 +1,144 @@ +# Path to your oh-my-zsh configuration. +ZSH=/usr/local/share/oh-my-zsh + +# Set name of the theme to load. +# Look in /usr/local/share/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="james-blue" + +# 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/*) +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# Options for Zsh # + +export HISTFILE=~/.zsh_history +export HISTSIZE=50000 +export SAVEHIST=50000 +eval `dircolors -b` +bindkey -v +bindkey -e + +autoload -U colors && colors +autoload -U compinit compinit +setopt autopushd pushdminus pushdsilent pushdtohome +setopt autocd +setopt cdablevars +#setopt ignoreeof +setopt interactivecomments +setopt nobanghist +#setopt noclobber +setopt HIST_REDUCE_BLANKS +setopt HIST_IGNORE_SPACE +setopt SH_WORD_SPLIT +#setopt nohup + +# Vars used later on by Zsh +export EDITOR=/usr/bin/vim +export BROWSER=/usr/bin/firefox +export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" +export PAGER=/bin/less + +################################ +# Stuff to make my life easier # + +# allow approximate +zstyle ':completion:*' completer _complete _match _approximate +zstyle ':completion:*:match:*' original only +zstyle ':completion:*:approximate:*' max-errors 1 numeric + +# tab completion for PID :D +zstyle ':completion:*:*:kill:*' menu yes select +zstyle ':completion:*:kill:*' force-list always + +# cd not select parent dir +zstyle ':completion:*:cd:*' ignore-parents parent pwd + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +# useful for path editing ? backward-delete-word, but with / as additional delimiter +backward-delete-to-slash () { + local WORDCHARS=${WORDCHARS//\//} + zle .backward-delete-word +} +zle -N backward-delete-to-slash + +################################################################## +# Key bindings +# http://mundy.yazzy.org/unix/zsh.php +# http://www.zsh.org/mla/users/2000/msg00727.html + +typeset -g -A key +bindkey '^?' backward-delete-char +bindkey '^[[1~' beginning-of-line +bindkey '^[[5~' up-line-or-history +bindkey '^[[3~' delete-char +bindkey '^[[4~' end-of-line +bindkey '^[[6~' down-line-or-history +bindkey '^[[A' up-line-or-search +bindkey '^[[D' backward-char +bindkey '^[[B' down-line-or-search +bindkey '^[[C' forward-char +bindkey '^[w' backward-delete-to-slash +# completion in the middle of a line +bindkey '^i' expand-or-complete-prefix + +############## +# My aliases # + +# Set up auto +alias -s html=$BROWSER +alias -s zip='tar -xf' +alias -s tar='tar -xf' +alias -s tgz='tar -xf' +alias -s gz='tar -xf' +alias -s xz='tar -xf' +alias -s txt=$EDITOR +alias -s PKGBUILD=$EDITOR + +# Normal aliases +alias ls='ls --color=auto -F' +alias lsd='ls -ld *(-/DN)' +alias lsa='ls -ld .*' +alias l='ls -Glarth' +alias f='find|grep' +alias svim="sudo $EDITOR" +alias updatedb="sudo updatedb" +alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" +alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" +alias list-pkg='expac "${fg[cyan]}%n${fg[green]}\t${reset_color}%d"' + +# command DN equivalent todevnulldevnullmand &> /dev/null & +alias -g DN='&> /dev/null &' + +pacman() { + pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} + sudo_bin==sudo + case $1 in + -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; + *) $pacman_bin "$@" ;; + esac +} From eb7f8409f50b5f39d250a9842ad0e2a9dcedcedb Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 16:55:46 +1100 Subject: [PATCH 008/203] Modified for AUR PKGBUILD. --- templates/zshrc.arch-zsh-template | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 1ab40aba6..e6c388ee5 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,17 +1,17 @@ # Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh +ZSH=/usr/local/share/oh-my-zsh/ # Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ +# Look in /usr/local/share/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="james-blue" # Set to this to use case-sensitive completion # 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" @@ -22,10 +22,12 @@ ZSH_THEME="robbyrussell" # 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/*) +# Which plugins would you like to load? (plugins can be found in /usr/local/share/oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) -source $ZSH/oh-my-zsh.sh +load_oh_my_zshell(){ + source $ZSH/oh-my-zsh.sh +} # Customize to your needs... From 8556c5db76b0baba0527b7f69848660e2c59a93f Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 18:25:23 +1100 Subject: [PATCH 009/203] fixed path to oh-my-zsh for the PKGBUILD/AUR for ArchLinux! --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index e6c388ee5..97653b16e 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,5 +1,5 @@ # Path to your oh-my-zsh configuration. -ZSH=/usr/local/share/oh-my-zsh/ +ZSH=/usr/share/oh-my-zsh/ # Set name of the theme to load. # Look in /usr/local/share/oh-my-zsh/themes/ From 9f4d13d0325d10ab5bbd69c10ace102451b4dd7c Mon Sep 17 00:00:00 2001 From: "Evan LeCompte (Home)" Date: Sun, 27 Nov 2011 02:59:01 -0500 Subject: [PATCH 010/203] add sprunge plugin -- pull request #703 --- plugins/sprunge.plugin.zsh | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/sprunge.plugin.zsh diff --git a/plugins/sprunge.plugin.zsh b/plugins/sprunge.plugin.zsh new file mode 100644 index 000000000..9f9432ac8 --- /dev/null +++ b/plugins/sprunge.plugin.zsh @@ -0,0 +1,64 @@ +# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf +# Created by the blogger at the URL below...I don't know where to find his/her name +# Original found at http://www.shellperson.net/sprunge-pastebin-script/ + +usage() { +description | fmt -s >&2 +} + +description() { +cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 text string + $0 < filename.txt + piped_data | $0 + +NOTES +-------------------------------------------------------------------------- +* INPUT METHODS * +$0 can accept piped data, STDIN redirection [&2 + if [ "$*" ]; then + echo Arguments present... >&2 + if [ -f "$*" ]; then + echo Uploading the contents of "$*"... >&2 + cat "$*" + else + echo Uploading the text: \""$*"\"... >&2 + echo "$*" + fi | curl -F 'sprunge=<-' http://sprunge.us + else + echo No arguments found, printing USAGE and exiting. >&2 + usage + fi + else + echo Using input from a pipe or STDIN redirection... >&2 + while read -r line ; do + echo $line + done | curl -F 'sprunge=<-' http://sprunge.us + fi +} From 3991df1eeaba328cf3da8cc881b93fa8dc4b5ba3 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 19:20:02 +1100 Subject: [PATCH 011/203] good bye! You served as a good backup. --- templates/zshrc.arch-zsh-template.bk | 144 --------------------------- 1 file changed, 144 deletions(-) delete mode 100644 templates/zshrc.arch-zsh-template.bk diff --git a/templates/zshrc.arch-zsh-template.bk b/templates/zshrc.arch-zsh-template.bk deleted file mode 100644 index a714103bc..000000000 --- a/templates/zshrc.arch-zsh-template.bk +++ /dev/null @@ -1,144 +0,0 @@ -# Path to your oh-my-zsh configuration. -ZSH=/usr/local/share/oh-my-zsh - -# Set name of the theme to load. -# Look in /usr/local/share/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="james-blue" - -# 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/*) -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) - -source $ZSH/oh-my-zsh.sh - -# Options for Zsh # - -export HISTFILE=~/.zsh_history -export HISTSIZE=50000 -export SAVEHIST=50000 -eval `dircolors -b` -bindkey -v -bindkey -e - -autoload -U colors && colors -autoload -U compinit compinit -setopt autopushd pushdminus pushdsilent pushdtohome -setopt autocd -setopt cdablevars -#setopt ignoreeof -setopt interactivecomments -setopt nobanghist -#setopt noclobber -setopt HIST_REDUCE_BLANKS -setopt HIST_IGNORE_SPACE -setopt SH_WORD_SPLIT -#setopt nohup - -# Vars used later on by Zsh -export EDITOR=/usr/bin/vim -export BROWSER=/usr/bin/firefox -export XTERM="/usr/bin/urxvt -e /usr/bin/tmux" -export PAGER=/bin/less - -################################ -# Stuff to make my life easier # - -# allow approximate -zstyle ':completion:*' completer _complete _match _approximate -zstyle ':completion:*:match:*' original only -zstyle ':completion:*:approximate:*' max-errors 1 numeric - -# tab completion for PID :D -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:kill:*' force-list always - -# cd not select parent dir -zstyle ':completion:*:cd:*' ignore-parents parent pwd - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -# useful for path editing ? backward-delete-word, but with / as additional delimiter -backward-delete-to-slash () { - local WORDCHARS=${WORDCHARS//\//} - zle .backward-delete-word -} -zle -N backward-delete-to-slash - -################################################################## -# Key bindings -# http://mundy.yazzy.org/unix/zsh.php -# http://www.zsh.org/mla/users/2000/msg00727.html - -typeset -g -A key -bindkey '^?' backward-delete-char -bindkey '^[[1~' beginning-of-line -bindkey '^[[5~' up-line-or-history -bindkey '^[[3~' delete-char -bindkey '^[[4~' end-of-line -bindkey '^[[6~' down-line-or-history -bindkey '^[[A' up-line-or-search -bindkey '^[[D' backward-char -bindkey '^[[B' down-line-or-search -bindkey '^[[C' forward-char -bindkey '^[w' backward-delete-to-slash -# completion in the middle of a line -bindkey '^i' expand-or-complete-prefix - -############## -# My aliases # - -# Set up auto -alias -s html=$BROWSER -alias -s zip='tar -xf' -alias -s tar='tar -xf' -alias -s tgz='tar -xf' -alias -s gz='tar -xf' -alias -s xz='tar -xf' -alias -s txt=$EDITOR -alias -s PKGBUILD=$EDITOR - -# Normal aliases -alias ls='ls --color=auto -F' -alias lsd='ls -ld *(-/DN)' -alias lsa='ls -ld .*' -alias l='ls -Glarth' -alias f='find|grep' -alias svim="sudo $EDITOR" -alias updatedb="sudo updatedb" -alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" -alias pkg-list="pacman -Qei \$(pacman -Qq)|awk 'BEGIN {FS=\":\"}/^Name/{printf(\"\033[1;36m%s\033[1;37m\", \$2)}/^Description/{print \$2}'" -alias list-pkg='expac "${fg[cyan]}%n${fg[green]}\t${reset_color}%d"' - -# command DN equivalent todevnulldevnullmand &> /dev/null & -alias -g DN='&> /dev/null &' - -pacman() { - pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} - sudo_bin==sudo - case $1 in - -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; - *) $pacman_bin "$@" ;; - esac -} From 81bf1e929f3758f6364dd817d80362c166cdfdfc Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 19:25:55 +1100 Subject: [PATCH 012/203] just a rename --- themes/{james-blue.zsh-theme => arch-blue.zsh-theme} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename themes/{james-blue.zsh-theme => arch-blue.zsh-theme} (100%) diff --git a/themes/james-blue.zsh-theme b/themes/arch-blue.zsh-theme similarity index 100% rename from themes/james-blue.zsh-theme rename to themes/arch-blue.zsh-theme From 435a3045240dd1681db74358b195be81aa482b34 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 19:26:36 +1100 Subject: [PATCH 013/203] modified for the arch-blue theme --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 97653b16e..27f4d2e09 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -5,7 +5,7 @@ ZSH=/usr/share/oh-my-zsh/ # Look in /usr/local/share/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="james-blue" +ZSH_THEME="arch-blue" # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" From 62a9c259f1f88c4726f61c690360c519d8fb4905 Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Sun, 27 Nov 2011 19:35:02 +1100 Subject: [PATCH 014/203] Updated as we are using our own PKGBUILD for the auto-installer! --- README.textile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.textile b/README.textile index 2dbfbe5a6..2717cd368 100644 --- a/README.textile +++ b/README.textile @@ -1,3 +1,5 @@ +@NOTE: This fork is specifically for Archlinux.@ + A handful of functions, auto-complete helpers, and stuff that makes you shout... bq. "OH MY ZSHELL!" @@ -6,12 +8,11 @@ h2. Setup @oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. -h3. The automatic installer... (do you trust me?) +h4. Installing using cower -@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ - -h3. The manual way +@cower -dd oh-my-zsh-git@ +h3. The manual way. ( unrecommended, as it isn't complete ) 1. Clone the repository From ad7c07a202d69bab87ec934a55e17df0892b532f Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Sun, 27 Nov 2011 20:00:36 +1100 Subject: [PATCH 015/203] Made some things more up to date! --- plugins/archlinux/archlinux.plugin.zsh | 48 ++++++++------------------ 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b5e519036..22c8d5b90 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,36 +1,6 @@ # Archlinux zsh aliases and functions # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins -# Look for yaourt, and add some useful functions if we have it. -if [[ -x `which yaourt` ]]; then - upgrade () { - yaourt -Syu - } - alias yaconf='yaourt -C' # Fix all configuration files with vimdiff - # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips - alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. - alias yain='yaourt -S' # Install specific package(s) from the repositories - alias yains='yaourt -U' # Install specific package not from the repositories but from a file - alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies - alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies - alias yarep='yaourt -Si' # Display information about a given package in the repositories - alias yareps='yaourt -Ss' # Search for package(s) in the repositories - alias yaloc='yaourt -Qi' # Display information about a given package in the local database - alias yalocs='yaourt -Qs' # Search for package(s) in the local database - # Additional yaourt alias examples - if [[ -x `which abs` ]]; then - alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories - else - alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories - fi - alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package - alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist -else - upgrade() { - sudo pacman -Syu - } -fi - # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. alias pacin='sudo pacman -S' # Install specific package(s) from the repositories @@ -52,12 +22,13 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li # https://bbs.archlinux.org/viewtopic.php?id=93683 paclist() { - sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' + [[ -x $(which expac) ]] && expac "${fg[cyan]}%n${fg[green]}: ${reset_color}%d" || ( + read -p "You don't have 'expac' installed, install? [y,N]" install_expac + # fixme! + echo "Sorry, this isn't yet implemented, please run 'pacman -S expac' manually! (fixme!)" + ) } -alias paclsorphans='sudo pacman -Qdt' -alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' - pacdisowned() { tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ db=$tmp/db @@ -74,3 +45,12 @@ pacdisowned() { comm -23 "$fs" "$db" } + +pacman() { + pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} + sudo_bin==sudo + case $1 in + -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; + *) $pacman_bin "$@" ;; + esac +} \ No newline at end of file From 8224455bd9f36b2a6c08b514e5c08f3150807de1 Mon Sep 17 00:00:00 2001 From: "Evan LeCompte (Home)" Date: Sun, 27 Nov 2011 03:46:03 -0500 Subject: [PATCH 016/203] sprunge plugin -- needs to be in own folder plugins/sprunge --- plugins/{ => sprunge}/sprunge.plugin.zsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/{ => sprunge}/sprunge.plugin.zsh (100%) diff --git a/plugins/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh similarity index 100% rename from plugins/sprunge.plugin.zsh rename to plugins/sprunge/sprunge.plugin.zsh From 3f3da1eb475be77da5ca420cc708c156510594ac Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 02:46:41 -0700 Subject: [PATCH 017/203] Sprunge plugin detects the syntax --- plugins/sprunge/sprunge.plugin.zsh | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 9f9432ac8..66297e31f 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,62 +1,62 @@ # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf # Created by the blogger at the URL below...I don't know where to find his/her name # Original found at http://www.shellperson.net/sprunge-pastebin-script/ - + usage() { description | fmt -s >&2 } - + description() { cat << HERE - + DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us - + USAGE $0 filename.txt $0 text string $0 < filename.txt piped_data | $0 - + NOTES -------------------------------------------------------------------------- * INPUT METHODS * $0 can accept piped data, STDIN redirection [&2 if [ "$*" ]; then - echo Arguments present... >&2 if [ -f "$*" ]; then - echo Uploading the contents of "$*"... >&2 + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) + except: + print('text')" | python) cat "$*" else - echo Uploading the text: \""$*"\"... >&2 echo "$*" fi | curl -F 'sprunge=<-' http://sprunge.us else - echo No arguments found, printing USAGE and exiting. >&2 usage fi else - echo Using input from a pipe or STDIN redirection... >&2 while read -r line ; do echo $line done | curl -F 'sprunge=<-' http://sprunge.us From d20f46ef12fda4bb0eae9943fecd8f8a7ca31534 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 02:49:08 -0700 Subject: [PATCH 018/203] Remove support for 'sprunge "blah blah posted text"' --- plugins/sprunge/sprunge.plugin.zsh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 66297e31f..de31e7f57 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -14,7 +14,6 @@ DESCRIPTION USAGE $0 filename.txt - $0 text string $0 < filename.txt piped_data | $0 @@ -24,7 +23,7 @@ NOTES $0 can accept piped data, STDIN redirection [ Date: Sun, 27 Nov 2011 02:53:44 -0700 Subject: [PATCH 019/203] Consistent indention levels. --- plugins/sprunge/sprunge.plugin.zsh | 45 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index de31e7f57..b298f3c9e 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -3,11 +3,11 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ usage() { -description | fmt -s >&2 + description | fmt -s >&2 } description() { -cat << HERE + cat << HERE DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us @@ -35,27 +35,28 @@ If a filename is misspelled or doesn't have the necessary path description, it w -------------------------------------------------------------------------- HERE -exit + exit } sprunge() { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then - # Use python to attempt to detect the syntax - syntax=$(echo "try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$*').aliases[0]) - except: - print('text')" | python) - cat "$*" | curl -F 'sprunge=<-' http://sprunge.us - fi - else - usage - fi - else - while read -r line ; do - echo $line - done | curl -F 'sprunge=<-' http://sprunge.us - fi + if [ -t 0 ]; then + if [ "$*" ]; then + if [ -f "$*" ]; then + # Use python to attempt to detect the syntax + syntax=$(echo " + try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) + except: + print('text')" | python) + cat "$*" | curl -F 'sprunge=<-' http://sprunge.us + fi + else + usage + fi + else + while read -r line ; do + echo $line + done | curl -F 'sprunge=<-' http://sprunge.us + fi } From f498551664d1977f9943f6eb3002755759c615fa Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:06:49 -0700 Subject: [PATCH 020/203] Capture url output, output syntax if we know what it is. --- plugins/sprunge/sprunge.plugin.zsh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index b298f3c9e..a3c3af2a4 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -49,14 +49,21 @@ sprunge() { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - cat "$*" | curl -F 'sprunge=<-' http://sprunge.us + url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) fi else usage fi else - while read -r line ; do + syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! + url=$(while read -r line ; do echo $line - done | curl -F 'sprunge=<-' http://sprunge.us + done | curl -F 'sprunge=<-' http://sprunge.us) + fi + + if [ "$syntax" -ne "text" ]; then + echo "$url?$syntax" + else + echo $url fi } From b9d853a8f414a22d564b98a3cd167b97e166740d Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:16:59 -0700 Subject: [PATCH 021/203] Fix python indentation error. --- plugins/sprunge/sprunge.plugin.zsh | 46 +++++++++++++----------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index a3c3af2a4..87b20e924 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,14 +1,25 @@ # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf # Created by the blogger at the URL below...I don't know where to find his/her name # Original found at http://www.shellperson.net/sprunge-pastebin-script/ +# +# Modified by Evaryont to: +# - Detect syntax via pygments +# - Behave nicely as a plugin -usage() { - description | fmt -s >&2 -} - -description() { - cat << HERE - +sprunge() { + if [ -t 0 ]; then + if [ "$*" ]; then + if [ -f "$*" ]; then + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) + except: + print('text')" | python) + url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + fi + else + cat << HERE DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us @@ -34,25 +45,8 @@ In this example, the contents of file_as_stdin_redirection.txt would be uploaded If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it. -------------------------------------------------------------------------- -HERE - exit -} - -sprunge() { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then - # Use python to attempt to detect the syntax - syntax=$(echo " - try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$*').aliases[0]) - except: - print('text')" | python) - url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) - fi - else - usage +HERE | fmt -s >&2 + return 0 fi else syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! From e584cf2f7d5c79edd755c5e49dfbf97a831f346e Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:28:13 -0700 Subject: [PATCH 022/203] Revert merging the functions together. Silly me. Instead, make it statically wrapped. Why not? Why call `fmt`! Trying to be 'cool'? --- plugins/sprunge/sprunge.plugin.zsh | 77 +++++++++++++++++------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 87b20e924..9bea79eb9 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,10 +1,50 @@ # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf # Created by the blogger at the URL below...I don't know where to find his/her name # Original found at http://www.shellperson.net/sprunge-pastebin-script/ -# -# Modified by Evaryont to: -# - Detect syntax via pygments -# - Behave nicely as a plugin + +usage() { + cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 < filename.txt + piped_data | $0 + +INPUT METHODS + +$0 can accept piped data, STDIN redirection [&2 - return 0 + usage fi else syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! From 597841868139959de7917c48f74cb4086b393719 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:29:13 -0700 Subject: [PATCH 023/203] Fix the if condition. Strings vs numbers. --- plugins/sprunge/sprunge.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 9bea79eb9..4e7f347f8 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -68,7 +68,7 @@ sprunge() { done | curl -F 'sprunge=<-' http://sprunge.us) fi - if [ "$syntax" -ne "text" ]; then + if [ "$syntax" != "text" ]; then echo "$url?$syntax" else echo $url From e66b827e614134f316e1517fb449413dd82ea107 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:31:50 -0700 Subject: [PATCH 024/203] Exit, not return, per original author. --- plugins/sprunge/sprunge.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 4e7f347f8..23bb9ffa8 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -42,8 +42,7 @@ description, it will NOT generate an error, but will instead treat it as a text string and upload it. HERE - #exit - return 0 + exit } sprunge() { @@ -59,6 +58,7 @@ sprunge() { url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) fi else + syntax="text" usage fi else From a00085fb042ca6b028a0a1b256df287a7234d0e0 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:32:23 -0700 Subject: [PATCH 025/203] Sprunge is better off as a script in ~/bin/, not a omz plugin. --- plugins/sprunge/sprunge.plugin.zsh | 76 ------------------------------ 1 file changed, 76 deletions(-) delete mode 100644 plugins/sprunge/sprunge.plugin.zsh diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh deleted file mode 100644 index 23bb9ffa8..000000000 --- a/plugins/sprunge/sprunge.plugin.zsh +++ /dev/null @@ -1,76 +0,0 @@ -# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf -# Created by the blogger at the URL below...I don't know where to find his/her name -# Original found at http://www.shellperson.net/sprunge-pastebin-script/ - -usage() { - cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - -USAGE - $0 filename.txt - $0 < filename.txt - piped_data | $0 - -INPUT METHODS - -$0 can accept piped data, STDIN redirection [ Date: Sun, 27 Nov 2011 03:38:01 -0700 Subject: [PATCH 026/203] Sprunge smart alias. Like a plugin should. --- plugins/sprunge/sprunge.plugin.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/sprunge/sprunge.plugin.zsh diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh new file mode 100644 index 000000000..ca7e77b33 --- /dev/null +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -0,0 +1,8 @@ +# A simple alias for sprunge, but only if there isn't a smarter, better one out +# there in $PATH +# +# A good one to add is the sprunge script in this directory. + +if [ -z "${commands[sprunge]}" ]; then + alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" +fi From d5ab3fb62cd250a09a8dca8ee375e1e1ef69db05 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:40:49 -0700 Subject: [PATCH 027/203] Restore the sprunge script --- plugins/sprunge/sprunge | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 plugins/sprunge/sprunge diff --git a/plugins/sprunge/sprunge b/plugins/sprunge/sprunge new file mode 100755 index 000000000..d033d61c9 --- /dev/null +++ b/plugins/sprunge/sprunge @@ -0,0 +1,77 @@ +#!/bin/zsh + +# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf +# Created by the blogger at the URL below...I don't know where to find his/her name +# Original found at http://www.shellperson.net/sprunge-pastebin-script/ + +usage() { + cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 < filename.txt + piped_data | $0 + +INPUT METHODS + +$0 can accept piped data, STDIN redirection [ Date: Sun, 27 Nov 2011 03:41:31 -0700 Subject: [PATCH 028/203] This is a shell script, not a function anymore --- plugins/sprunge/sprunge | 46 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/plugins/sprunge/sprunge b/plugins/sprunge/sprunge index d033d61c9..10af8e2b3 100755 --- a/plugins/sprunge/sprunge +++ b/plugins/sprunge/sprunge @@ -47,31 +47,29 @@ HERE exit } -sprunge() { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then - # Use python to attempt to detect the syntax - syntax=$(echo "try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$*').aliases[0]) - except: - print('text')" | python) - url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) - fi - else - usage +if [ -t 0 ]; then + if [ "$*" ]; then + if [ -f "$*" ]; then + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) + except: + print('text')" | python) + url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) fi else - syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! - url=$(while read -r line ; do - echo $line - done | curl -F 'sprunge=<-' http://sprunge.us) + usage fi +else + syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! + url=$(while read -r line ; do + echo $line + done | curl -F 'sprunge=<-' http://sprunge.us) +fi - if [ "$syntax" != "text" ]; then - echo "$url?$syntax" - else - echo $url - fi -} +if [ "$syntax" != "text" ]; then + echo "$url?$syntax" +else + echo $url +fi From d973665df02737e3dc7f33b83bc1ad64a90f605e Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:51:35 -0700 Subject: [PATCH 029/203] sprunge command has a setting! --- plugins/sprunge/sprunge.plugin.zsh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index ca7e77b33..4532e96de 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,8 +1,17 @@ -# A simple alias for sprunge, but only if there isn't a smarter, better one out -# there in $PATH +# Smart sprunge alias/script. # -# A good one to add is the sprunge script in this directory. +# To add the sprunge script to your path, add this to your .zshrc file: +# +# zstyle :omz:plugins:sprunge add-path on +# +# Otherwise, a simple alias for sprunge, but only if there isn't a smarter, +# better one out there in $PATH, will be added. -if [ -z "${commands[sprunge]}" ]; then +zstyle -b :omz:plugins:sprunge add-path _plugin__path +if [[ ${_plugin__path} == "on" ]]; then + # Plugin setting: Add this plugin directory to the path + export PATH=$PATH:$ZSH/plugins/sprunge +elif [ -z "${commands[sprunge]}" ]; then + # Nope. No `sprunge` command, period. So, dumb/simple alias, here we go! alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" fi From 85694649accdd07be96d9238538c07e55f9ef356 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:02:38 -0700 Subject: [PATCH 030/203] README, explaining the plugin. Sheesh, 200 words?!? --- plugins/sprunge/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/sprunge/README.md diff --git a/plugins/sprunge/README.md b/plugins/sprunge/README.md new file mode 100644 index 000000000..7bf0ba196 --- /dev/null +++ b/plugins/sprunge/README.md @@ -0,0 +1,39 @@ +# sprunge alias + +This plugin adds at least an alias to zsh. However, you can use the smarter +script, provided as part of the plugin, instead. To enable it, add the following +to your `.zshrc`: + + zstyle :omz:plugins:sprunge add-path on + +The plugin will modify your path, adding `$ZSH/plugins/sprunge` to the end of +it. This plugin presumes you set `$ZSH` to the directory where oh-my-zsh is +installed to. This is the default if you used the template zshrc. + +# Note + +The plugin does not overwrite anything. If you had an alias, or there is another +binary in your system that is called 'sprunge', this plugin will do **nothing**. + +The script also depends on pygments, and python >= 2.7. Pygments is used to +detect what language you have uploaded. If it is detected, the url will +automatically be appended with `?lang`, where 'lang' is language. + +## Usage + +If you let the plugin add the sprunge script to your $PATH, you can call +`sprunge` in any of the following ways: + + sprunge filename.txt + sprunge < filename.txt + piped_data | sprunge + +Otherwise, the alias defined by the script can only be called the following way: + + piped_data | sprunge + +# Copyright, license, etc. + +This plugin is released under the MIT license. The script is presumed to be +released into the public domain, as the original announcement had no explicit +announcement. From de189ebd605242e62f9add493e0be1cee579ec2f Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:08:02 -0700 Subject: [PATCH 031/203] Reword the header. I just wanted an excuse to try out the IRC service hook from Github. :-P --- plugins/sprunge/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/README.md b/plugins/sprunge/README.md index 7bf0ba196..480707e84 100644 --- a/plugins/sprunge/README.md +++ b/plugins/sprunge/README.md @@ -32,7 +32,7 @@ Otherwise, the alias defined by the script can only be called the following way: piped_data | sprunge -# Copyright, license, etc. +# Copyright & License This plugin is released under the MIT license. The script is presumed to be released into the public domain, as the original announcement had no explicit From cbba35abbb6656edd29bcb718d8917a0be954793 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:10:51 -0700 Subject: [PATCH 032/203] Have the heading be the same weight Another simple change, used to test the IRC notification. Again. --- README.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.textile b/README.textile index 2717cd368..523be5f39 100644 --- a/README.textile +++ b/README.textile @@ -8,7 +8,7 @@ h2. Setup @oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. -h4. Installing using cower +h3. Installing using cower @cower -dd oh-my-zsh-git@ From cac19ccefac36e79a991b6896ef805e2a2fbf8e7 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:21:30 -0700 Subject: [PATCH 033/203] Delete a step in the install. - Based on the PKGBUILD, we presume zsh is already installed. Not only is it installed, but the user is actually using it, thus the desire to use oh-my-zsh. - Also, test IRC notification. Again. Again. --- README.textile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.textile b/README.textile index 523be5f39..38a3f0fe0 100644 --- a/README.textile +++ b/README.textile @@ -24,11 +24,7 @@ h3. The manual way. ( unrecommended, as it isn't complete ) @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ -3. Set zsh as your default shell: - - @chsh -s /bin/zsh@ - -4. Start / restart zsh (open a new terminal is easy enough...) +3. Start / restart zsh (open a new terminal is easy enough...) h3. Problems? From 08ec448c6d27b753cd5851b4ce7ba5a74bc39a84 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:25:44 -0700 Subject: [PATCH 034/203] irc notify test. again. again. again. --- dummy | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dummy diff --git a/dummy b/dummy new file mode 100644 index 000000000..e69de29bb From cee0e8ed270e781e7f2845f630695d63b3f63874 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:27:10 -0700 Subject: [PATCH 035/203] no dummy, since irc notifications work! --- dummy | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 dummy diff --git a/dummy b/dummy deleted file mode 100644 index e69de29bb..000000000 From 49a729b1b498750d885c66a6c8e7078db84fdccd Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 04:31:37 -0700 Subject: [PATCH 036/203] Revert "no dummy, since irc notifications work!" This reverts commit cee0e8ed270e781e7f2845f630695d63b3f63874. IRC notifications broke. --- dummy | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dummy diff --git a/dummy b/dummy new file mode 100644 index 000000000..e69de29bb From d91b80c5ec28d2567e043631933d1f3853cb1183 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 23:06:05 +1100 Subject: [PATCH 037/203] testing irc.notifications and this directory is worthless now! --- tools/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/README.md diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 000000000..5029f3f3f --- /dev/null +++ b/tools/README.md @@ -0,0 +1 @@ +This directory is worthless to our fork, Remove? From 1e47d6b27dc26ec31e3b39b3ffccb6d86edfec99 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 23:18:27 +1100 Subject: [PATCH 038/203] testing --- tools/test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/test.txt diff --git a/tools/test.txt b/tools/test.txt new file mode 100644 index 000000000..e69de29bb From fa1b08e2f79401c0b2105b32e7e2cab0b2561077 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 27 Nov 2011 23:18:56 +1100 Subject: [PATCH 039/203] testing more --- tools/test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/test.txt diff --git a/tools/test.txt b/tools/test.txt deleted file mode 100644 index e69de29bb..000000000 From 3ef56efa37c1a6a53b66ae88cae0815f052acdf4 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:01:22 +1100 Subject: [PATCH 040/203] Fixed a bug. --- plugins/archlinux/archlinux.plugin.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 22c8d5b90..db44a63fb 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -48,9 +48,8 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} - sudo_bin==sudo case $1 in - -S | -S[^sih]* | -R* | -U*) $sudo_bin /bin/su -c"$pacman_bin \"$@\"" ;; + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c"$pacman_bin $@" ;; *) $pacman_bin "$@" ;; esac -} \ No newline at end of file +} From 6db2294072c0991a13fea130030c591800818259 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:04:58 +1100 Subject: [PATCH 041/203] fixed the fix! :P --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index db44a63fb..b6c1149eb 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,7 +49,7 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c"$pacman_bin $@" ;; + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c"$pacman_bin '$@'" ;; *) $pacman_bin "$@" ;; esac } From 07c6e2da62ce5bb108da48e10f28d86820639b72 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:18:43 +1100 Subject: [PATCH 042/203] Offically patched this bug! --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b6c1149eb..0b7d87924 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,7 +49,7 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c"$pacman_bin '$@'" ;; + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin \"$@\"\"" ;; *) $pacman_bin "$@" ;; esac } From 7710cde55556badb8fc86513f9f03745bc7bcf97 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:24:36 +1100 Subject: [PATCH 043/203] FIXED! --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 0b7d87924..b584ee2d2 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,7 +49,7 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin \"$@\"\"" ;; + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin '$@'\"" ;; *) $pacman_bin "$@" ;; esac } From 1e30824979c8fc4fc169747762d321bd7f5d365e Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:27:09 +1100 Subject: [PATCH 044/203] FIXED! :D --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b584ee2d2..c1c30adc5 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,7 +49,7 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin '$@'\"" ;; + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin $@\"" ;; *) $pacman_bin "$@" ;; esac } From e44222638cc61d99e2de32da43386e011c9d5271 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 02:52:10 +1100 Subject: [PATCH 045/203] Not patched :'( --- plugins/archlinux/archlinux.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index c1c30adc5..4422dcfb1 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,7 +49,8 @@ pacdisowned() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "\"$pacman_bin $@\"" ;; +# The following line is a pure bug, Please fix! + -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "$pacman_bin $@" ;; *) $pacman_bin "$@" ;; esac } From f44ff0c0723131a3e3ad291d55e8b949729533a4 Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Mon, 28 Nov 2011 22:28:10 +1100 Subject: [PATCH 046/203] Made it more clear that this fork isn't like the other forks, It's patched for system-wide; Not for a single-user install! (however that may come at a later date) --- README.textile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.textile b/README.textile index 38a3f0fe0..6835f431e 100644 --- a/README.textile +++ b/README.textile @@ -1,4 +1,5 @@ -@NOTE: This fork is specifically for Archlinux.@ +**NOTE: This fork is specifically for Archlinux and has been patched for a system-wide install; Don't attempt to install to ~/.oh-my-zsh!! There will be a user specifc wrapper later on, but for now. system wide or use robby's official master ( not optimized for arch nor as patched; He is too lazy to merge some pull requests. )** +**This documentation/wiki isn't finished nor official!** A handful of functions, auto-complete helpers, and stuff that makes you shout... @@ -12,19 +13,19 @@ h3. Installing using cower @cower -dd oh-my-zsh-git@ -h3. The manual way. ( unrecommended, as it isn't complete ) +h4. Enableing for a user. -1. Clone the repository +The user must first have zsh set as their shell. +@[[ $SHELL == '/bin/zsh' ]] && su -c'chsh -s $(which zsh) '@ - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ +For each user who wishes to use oh-my-zsh they must append/copy the user.zsh-template to their .zshrc. +@>$HOME/.zshrc@ +If the above command doesn't run please try.. +@cat /usr/share/oh-my-zsh/templates/user.zsh-template>>$HOME/.zshrc@ +If that doesn't work and you don't have anything in your .zshrc file. simply copy the file accross. -2. Create a new zsh config by copying the zsh template we've provided. - - *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings. - - @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ - -3. Start / restart zsh (open a new terminal is easy enough...) +The .zshrc file must be executable! +@chmod +x .zshrc@ h3. Problems? From 6ae1d4c1ff37a8696b1143fe176b282040d8ae0f Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 22:31:54 +1100 Subject: [PATCH 047/203] Added the user.zsh-template file for users to enable zsh and use it!o --- templates/user.zsh-template | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 templates/user.zsh-template diff --git a/templates/user.zsh-template b/templates/user.zsh-template new file mode 100644 index 000000000..c5d4e3a8c --- /dev/null +++ b/templates/user.zsh-template @@ -0,0 +1,5 @@ +# Check /etc/zsh/zshrc for system defaults. Eg. plugins=(git) + +plugins+=(archlinux sprunge github) + +load_oh_my_zshell From e718695e462f702dc59e2e424a87611a0e164f99 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 22:34:07 +1100 Subject: [PATCH 048/203] fixed a little mistake! --- README.textile | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.textile b/README.textile index 6835f431e..b60c59f6b 100644 --- a/README.textile +++ b/README.textile @@ -24,9 +24,6 @@ If the above command doesn't run please try.. @cat /usr/share/oh-my-zsh/templates/user.zsh-template>>$HOME/.zshrc@ If that doesn't work and you don't have anything in your .zshrc file. simply copy the file accross. -The .zshrc file must be executable! -@chmod +x .zshrc@ - h3. Problems? You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_. From 7579840bf020adc49450ea860530c9fbac8894de Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 22:38:15 +1100 Subject: [PATCH 049/203] Fixed that pesky bug and started the aur-helpersG --- plugins/archlinux/archlinux.plugin.zsh | 7 +++++-- plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh | 0 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 4422dcfb1..fbb8e7706 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -46,11 +46,14 @@ pacdisowned() { comm -23 "$fs" "$db" } +asroot() { + whence sudo && sudo $@ || su -c "$@" +} + pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in -# The following line is a pure bug, Please fix! - -S | -S[^sih]* | -R* | -U*) =sudo /bin/su -c "$pacman_bin $@" ;; + -S | -S[^sih]* | -R* | -U*) asroot $pacman_bin $@ ;; *) $pacman_bin "$@" ;; esac } diff --git a/plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh b/plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh new file mode 100644 index 000000000..e69de29bb From ea1e8a98309f1b28bb70f5007ac78e882944dc40 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 28 Nov 2011 22:48:52 +1100 Subject: [PATCH 050/203] Modified archlinux.plugin.zsh so it has the skeleton idea for how aur-helpers will/can be managed. got two blank files that will be filled with handy aliases, etc. --- plugins/archlinux/archlinux.plugin.zsh | 4 ++++ .../aur-helper-meat.zsh => aur-helpers/aur-helper-cower.zsh} | 0 plugins/archlinux/aur-helpers/aur-helper-meat.zsh | 0 3 files changed, 4 insertions(+) rename plugins/archlinux/{aur-helper-meat/aur-helper-meat.zsh => aur-helpers/aur-helper-cower.zsh} (100%) create mode 100644 plugins/archlinux/aur-helpers/aur-helper-meat.zsh diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index fbb8e7706..67a7d593e 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,3 +1,7 @@ +# This isn't finished, but shows how the aur-helpers will/can be managed +# zstyle :omz:plugins:aur-helper aur_helper {cower,meat} +#zstyle -b :omz:plugins:aur-helper aur_helper _plugin__aur_helper + # Archlinux zsh aliases and functions # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins diff --git a/plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh b/plugins/archlinux/aur-helpers/aur-helper-cower.zsh similarity index 100% rename from plugins/archlinux/aur-helper-meat/aur-helper-meat.zsh rename to plugins/archlinux/aur-helpers/aur-helper-cower.zsh diff --git a/plugins/archlinux/aur-helpers/aur-helper-meat.zsh b/plugins/archlinux/aur-helpers/aur-helper-meat.zsh new file mode 100644 index 000000000..e69de29bb From 00f5e827d246e1fe6e1d803443520f1621037ffc Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Mon, 28 Nov 2011 22:53:53 +1100 Subject: [PATCH 051/203] Silenced whence! --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 67a7d593e..10a84866a 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -51,7 +51,7 @@ pacdisowned() { } asroot() { - whence sudo && sudo $@ || su -c "$@" + whence sudo &>/dev/null && sudo $@ || su -c "$@" } pacman() { From a812654cbed305398a078cac3d23e6a498da4f15 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 09:24:49 -0500 Subject: [PATCH 052/203] Swapped out ZSH_THEME for two functions, set_theme and random_theme. At the moment I dropped ZSH_THEME variable too. Auto completion to come. Function makes it easier to change themes on-the-fly. --- oh-my-zsh.sh | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 891e8d467..460399fc4 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -40,19 +40,12 @@ done # Load all of your custom configurations from custom/ for config_file ($ZSH_CUSTOM/*.zsh) source $config_file -# Load the theme -if [ "$ZSH_THEME" = "random" ] -then - themes=($ZSH/themes/*zsh-theme) - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." -else - if [ ! "$ZSH_THEME" = "" ] - then - source "$ZSH/themes/$ZSH_THEME.zsh-theme" - fi -fi +set_theme() { + source "$ZSH/themes/$ZSH_THEME.zsh-theme" +} +random_theme() { + local themes + themes=($ZSH/themes/*zsh-theme) + source "$themes[$RANDOM%$#themes+1]" +} From 9e17fe1fc1cbedf8017d60390abcfe7ef1a20d6c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 09:27:22 -0500 Subject: [PATCH 053/203] Updated templates to reflect how themeing is set at the moment. Not quite happy with it yet. --- templates/zshrc.arch-zsh-template | 19 ++++++++++--------- templates/zshrc.zsh-template | 11 +++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 27f4d2e09..b9322b0b9 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,11 +1,9 @@ # Path to your oh-my-zsh configuration. ZSH=/usr/share/oh-my-zsh/ -# Set name of the theme to load. -# Look in /usr/local/share/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="arch-blue" +load_oh_my_zshell(){ + source $ZSH/oh-my-zsh.sh +} # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" @@ -24,10 +22,13 @@ DISABLE_AUTO_UPDATE="true" # Which plugins would you like to load? (plugins can be found in /usr/local/share/oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) +plugins=(archlinux sprung git) -load_oh_my_zshell(){ - source $ZSH/oh-my-zsh.sh -} +load_oh_my_zshell + +# Load a theme +# Look in /usr/local/share/oh-my-zsh/themes/ +set_theme "arch-blue" +# random_theme # Customize to your needs... diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..6d1db51ed 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,12 +1,6 @@ # 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="robbyrussell" - # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" @@ -28,4 +22,9 @@ plugins=(git) source $ZSH/oh-my-zsh.sh +# Load a theme +# Look in $ZSH/themes/ +set_theme "robbyrussell" +# random_theme + # Customize to your needs... From 70a5374692ee3ff7a3da9ebc5cb78a1436e1bc1c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 09:39:48 -0500 Subject: [PATCH 054/203] No awk-grep, ditch that alias. --- lib/aliases.zsh | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 0555be264..e99d2f95d 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -19,6 +19,3 @@ alias lsa='ls -lah' alias l='ls -la' alias ll='ls -l' alias sl=ls # often screw this up - -alias afind='ack-grep -il' - From 6eea8dd17aae29b089b966b2203f0e7c95fafb2d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 09:43:17 -0500 Subject: [PATCH 055/203] Removed nocorrect settings for some commands. Some are irrelevant for archlinux (ie. ebuild), others would be better served, if needed, by packaging them with the corresponding plugin (ie. hpodder). Lib should be minimal as possible, IMHO. Feel free to revert this change. --- lib/correction.zsh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/correction.zsh b/lib/correction.zsh index fc60dcdbd..cab442d08 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -2,9 +2,4 @@ setopt correct_all alias man='nocorrect man' alias mv='nocorrect mv' -alias mysql='nocorrect mysql' alias mkdir='nocorrect mkdir' -alias gist='nocorrect gist' -alias heroku='nocorrect heroku' -alias ebuild='nocorrect ebuild' -alias hpodder='nocorrect hpodder' From 01d48a874941c3396d30f6750bc442f437f38028 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 09:53:08 -0500 Subject: [PATCH 056/203] Move my theming functions into lib/ --- lib/theming.zsh | 9 +++++++++ oh-my-zsh.sh | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 lib/theming.zsh diff --git a/lib/theming.zsh b/lib/theming.zsh new file mode 100644 index 000000000..cd88d08af --- /dev/null +++ b/lib/theming.zsh @@ -0,0 +1,9 @@ +set_theme() { + source "$ZSH/themes/$ZSH_THEME.zsh-theme" +} + +random_theme() { + local themes + themes=($ZSH/themes/*zsh-theme) + source "$themes[$RANDOM%$#themes+1]" +} diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 460399fc4..d0c77e457 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -39,13 +39,3 @@ done # Load all of your custom configurations from custom/ for config_file ($ZSH_CUSTOM/*.zsh) source $config_file - -set_theme() { - source "$ZSH/themes/$ZSH_THEME.zsh-theme" -} - -random_theme() { - local themes - themes=($ZSH/themes/*zsh-theme) - source "$themes[$RANDOM%$#themes+1]" -} From 1e2cf116b773233e7f453ef85826de871e24e0ef Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 10:23:29 -0500 Subject: [PATCH 057/203] Why the hell does oh-my-zsh have an .sh extension and not .zsh? --- oh-my-zsh.sh => oh-my-zsh.zsh | 0 templates/zshrc.arch-zsh-template | 2 +- templates/zshrc.zsh-template | 2 +- tools/theme_chooser.sh | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename oh-my-zsh.sh => oh-my-zsh.zsh (100%) diff --git a/oh-my-zsh.sh b/oh-my-zsh.zsh similarity index 100% rename from oh-my-zsh.sh rename to oh-my-zsh.zsh diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index b9322b0b9..0e5201f13 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -2,7 +2,7 @@ ZSH=/usr/share/oh-my-zsh/ load_oh_my_zshell(){ - source $ZSH/oh-my-zsh.sh + source $ZSH/oh-my-zsh.zsh } # Set to this to use case-sensitive completion diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 6d1db51ed..bbec3a9d2 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -20,7 +20,7 @@ ZSH=$HOME/.oh-my-zsh # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh # Load a theme # Look in $ZSH/themes/ diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 4d7047444..cbf0f6d53 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -9,7 +9,7 @@ THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh function noyes() { read "a?$1 [y/N] " From aa1d7ad0125a0f15831affffac551cc830d7e104 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 10:23:29 -0500 Subject: [PATCH 058/203] Why the hell does oh-my-zsh have an .sh extension and not .zsh? Conflicts: templates/zshrc.arch-zsh-template --- oh-my-zsh.sh => oh-my-zsh.zsh | 0 templates/zshrc.zsh-template | 2 +- tools/theme_chooser.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename oh-my-zsh.sh => oh-my-zsh.zsh (100%) diff --git a/oh-my-zsh.sh b/oh-my-zsh.zsh similarity index 100% rename from oh-my-zsh.sh rename to oh-my-zsh.zsh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..f422f89b2 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -26,6 +26,6 @@ ZSH_THEME="robbyrussell" # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh # Customize to your needs... diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 4d7047444..cbf0f6d53 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -9,7 +9,7 @@ THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh function noyes() { read "a?$1 [y/N] " From f755d3d538a820f3240b220160c7aff3cba2829a Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 10:27:32 -0500 Subject: [PATCH 059/203] =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0,=20arch-zsh-templ?= =?UTF-8?q?ate=20needs=20to=20source=20oh-my-zsh.zsh...=20How=20did=20I=20?= =?UTF-8?q?mess=20this=20up=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 27f4d2e09..1fe66bf29 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -27,7 +27,7 @@ DISABLE_AUTO_UPDATE="true" plugins=(git) load_oh_my_zshell(){ - source $ZSH/oh-my-zsh.sh + source $ZSH/oh-my-zsh.zsh } # Customize to your needs... From 3fb01c95317bd64a9fb2f15bedb048af886f2e2f Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 12:17:02 -0500 Subject: [PATCH 060/203] If pkgfile is installed, add a "command not found" hook. This hook is of better quality than the one that's pre-packaged with pkgtools (it won't run when a command is part of a pipe or subshell). I should see about getting this hook accepted in pkgtools. --- lib/notfound.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/notfound.zsh diff --git a/lib/notfound.zsh b/lib/notfound.zsh new file mode 100644 index 000000000..6a2afb5e9 --- /dev/null +++ b/lib/notfound.zsh @@ -0,0 +1,20 @@ +if [[ -x /usr/bin/pkgfile ]]; then + command_not_found_handler() { + local pkg p + local pid ppid pgrp session tty_nr tpgid + + # double check pkgfile exists + [[ ! -x /usr/bin/pkgfile ]] && return 127 + + # do not run when within a pipe or subshell + [[ ! -t 1 ]] && return 127 + read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat + [[ $$ -eq $tpgid ]] && return 127 + + pkg=$(pkgfile -b -v -- $1) + if [[ -z $pkg ]] && return 127 + + echo "The command \"$1\" can be found in the following packages:" + for p in $pkg; echo " $p" + } +fi From 7dc0913219730e3f6e4b6c35e9119368cf56e3e2 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 13:10:14 -0500 Subject: [PATCH 061/203] Fixed slight gaff in set_theme --- lib/theming.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theming.zsh b/lib/theming.zsh index cd88d08af..b20306a90 100644 --- a/lib/theming.zsh +++ b/lib/theming.zsh @@ -1,5 +1,5 @@ set_theme() { - source "$ZSH/themes/$ZSH_THEME.zsh-theme" + source "$ZSH/themes/$1.zsh-theme" } random_theme() { From 3527b4cad4bfa58c4289a1931f4baa5bbced3068 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:14:45 -0500 Subject: [PATCH 062/203] My pkgfile hook wasn't handling multiple results properly. Should be fixed now. --- lib/notfound.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/notfound.zsh b/lib/notfound.zsh index 6a2afb5e9..570976197 100644 --- a/lib/notfound.zsh +++ b/lib/notfound.zsh @@ -11,10 +11,13 @@ if [[ -x /usr/bin/pkgfile ]]; then read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat [[ $$ -eq $tpgid ]] && return 127 - pkg=$(pkgfile -b -v -- $1) + saveIFS=$IFS; IFS=$'\n'; + pkg=($(pkgfile -b -v -- $1)) + IFS=$saveIFS + if [[ -z $pkg ]] && return 127 echo "The command \"$1\" can be found in the following packages:" - for p in $pkg; echo " $p" + for p in $pkg; echo " $p" } fi From 4fa59516046525cae2dc5b348ddf49ead9f67dcc Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:33:26 -0500 Subject: [PATCH 063/203] Useless, it just sources the (non-existent) ubuntu file --- plugins/command-not-found/command-not-found.plugin.zsh | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 plugins/command-not-found/command-not-found.plugin.zsh diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh deleted file mode 100644 index 5ab03d5a9..000000000 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Uses the command-not-found package zsh support -# as seen in http://www.porcheron.info/command-not-found-for-zsh/ -# this is installed in Ubuntu - -source /etc/zsh_command_not_found From 0657c9b36411a5d2933b0436934f3a927812d30f Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:34:49 -0500 Subject: [PATCH 064/203] No apt-get on archlinux. --- plugins/debian/debian.plugin.zsh | 149 ------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 plugins/debian/debian.plugin.zsh diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh deleted file mode 100644 index 09771881d..000000000 --- a/plugins/debian/debian.plugin.zsh +++ /dev/null @@ -1,149 +0,0 @@ -# Authors: -# https://github.com/AlexBio -# https://github.com/dbb -# -# Debian-related zsh aliases and functions for zsh - -# Use aptitude if installed, or apt-get if not. -# You can just set apt_pref='apt-get' to override it. -if [[ -e $( which aptitude ) ]]; then - apt_pref='aptitude' -else - apt_pref='apt-get' -fi - -# Use sudo by default if it's installed -if [[ -e $( which sudo ) ]]; then - use_sudo=1 -fi - -# Aliases ################################################################### -# These are for more obscure uses of apt-get and aptitude that aren't covered -# below. -alias ag='apt-get' -alias at='aptitude' - -# Some self-explanatory aliases -alias acs="apt-cache search" -alias aps='aptitude search' -alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ - --no-gui --disable-columns search" # search package - -# apt-file -alias afs='apt-file search --regexp' - - -# These are apt-get only -alias asrc='apt-get source' -alias ap='apt-cache policy' - -# superuser operations ###################################################### -if [[ $use_sudo -eq 1 ]]; then -# commands using sudo ####### - alias aac="sudo $apt_pref autoclean" - alias abd="sudo $apt_pref build-dep" - alias ac="sudo $apt_pref clean" - alias ad="sudo $apt_pref update" - alias adg="sudo $apt_pref update && sudo $apt_pref upgrade" - alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" - alias afu='sudo apt-file update' - alias ag="sudo $apt_pref upgrade" - alias ai="sudo $apt_pref install" - alias ap="sudo $apt_pref purge" - alias ar="sudo $apt_pref remove" - - # apt-get only - alias ads="sudo $apt_pref dselect-upgrade" - - # Install all .deb files in the current directory. - # Warning: you will need to put the glob in single quotes if you use: - # glob_subst - alias di='sudo dpkg -i ./*.deb' - - # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ - ?not(~n`uname -r`))' - - -# commands using su ######### -else - alias aac='su -ls "'"$apt_pref"' autoclean" root' - abd() { - cmd="su -lc '$apt_pref build-dep $@' root" - print "$cmd" - eval "$cmd" - } - alias ac='su -ls "'"$apt_pref"' clean" root' - alias ad='su -lc "'"$apt_pref"' update" root' - alias adg='su -lc "'"$apt_pref"' update && aptitude safe-upgrade" root' - alias adu='su -lc "'"$apt_pref"' update && aptitude dist-upgrade" root' - alias afu='su -lc "apt-file update"' - alias ag='su -lc "'"$apt_pref"' safe-upgrade" root' - ai() { - cmd="su -lc 'aptitude -P install $@' root" - print "$cmd" - eval "$cmd" - } - ap() { - cmd="su -lc '$apt_pref -P purge $@' root" - print "$cmd" - eval "$cmd" - } - ar() { - cmd="su -lc '$apt_pref -P remove $@' root" - print "$cmd" - eval "$cmd" - } - - # Install all .deb files in the current directory - # Assumes glob_subst is off - alias di='su -lc "dpkg -i ./*.deb" root' - - # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \ - ?not(~n`uname -r`))'\'' root' -fi - - -# Misc. ##################################################################### -# print all installed packages -alias allpkgs='aptitude search -F "%p" --disable-columns ~i' - -# Create a basic .deb package -alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' - - - - - -# Functions ################################################################# -# create a simple script that can be used to 'duplicate' a system -apt-copy() { - print '#!/bin/sh'"\n" > apt-copy.sh - - cmd="$apt_pref install " - - for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; { - cmd="${cmd} ${p}" - } - - print $cmd "\n" >> apt-copy.sh - - chmod +x apt-copy.sh -} - - -# Kernel-package building shortcut -kerndeb () { - # temporarily unset MAKEFLAGS ( '-j3' will fail ) - MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) - print '$MAKEFLAGS set to '"'$MAKEFLAGS'" - appendage='-custom' # this shows up in $ (uname -r ) - revision=$(date +"%Y%m%d") # this shows up in the .deb file name - - make-kpkg clean - - time fakeroot make-kpkg --append-to-version "$appendage" --revision \ - "$revision" kernel_image kernel_headers -} - From 97f6f3bdf75ccc549ba78b9b2da4eb860136181a Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:36:30 -0500 Subject: [PATCH 065/203] Archlinux isn't mac, either. --- .../apache2-macports.plugin.zsh | 6 -- plugins/macports/_port | 89 ----------------- plugins/macports/macports.plugin.zsh | 8 -- .../mysql-macports/mysql-macports.plugin.zsh | 8 -- plugins/osx/_man-preview | 5 - plugins/osx/osx.plugin.zsh | 99 ------------------- plugins/textmate/textmate.plugin.zsh | 12 --- 7 files changed, 227 deletions(-) delete mode 100644 plugins/apache2-macports/apache2-macports.plugin.zsh delete mode 100644 plugins/macports/_port delete mode 100644 plugins/macports/macports.plugin.zsh delete mode 100644 plugins/mysql-macports/mysql-macports.plugin.zsh delete mode 100644 plugins/osx/_man-preview delete mode 100644 plugins/osx/osx.plugin.zsh delete mode 100644 plugins/textmate/textmate.plugin.zsh diff --git a/plugins/apache2-macports/apache2-macports.plugin.zsh b/plugins/apache2-macports/apache2-macports.plugin.zsh deleted file mode 100644 index 1caa4cf9d..000000000 --- a/plugins/apache2-macports/apache2-macports.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# commands to control local apache2 server installation -# paths are for osx installation via macports - -alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start' -alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop' -alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart' diff --git a/plugins/macports/_port b/plugins/macports/_port deleted file mode 100644 index 06d7fb426..000000000 --- a/plugins/macports/_port +++ /dev/null @@ -1,89 +0,0 @@ -#compdef port - -local subcmds - -# we cache the list of ports -# we shall use some cache policy to avoid problems with new ports -if (( ! $+portlist )); then - portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated")) -fi - -subcmds=( -'activate' -'archive' -'build' -'cat' -'clean' -'configure' -'contents' -'deactivate' -'dependents' -'deps' -'destroot' -'dir' -'distcheck' -'distclean' -'dmg' -'echo' -'edit' -'extract' -'fetch' -'file' -'help' -'info' -'install' -'installed' -'list' -'livecheck' -'location' -'mpkg' -'outdated' -'patch' -'pkg' -'provides' -'rpmpackage' -'search' -'selfupdate' -'sync' -'test' -'unarchive' -'uninstall' -'upgrade' -'variants' -'version' -) - -_arguments -C \ -'-v[verbose mode (generate verbose messages)]' \ -'-d[debug mode (generate debugging messages)]' \ -'-q[quiet mode (suppress messages)]' \ -'-D[specify portdir]' \ -'-k[keep mode (do not autoclean after install)]' \ -'-n[dont follow dependencies in upgrade (only for upgrading)]' \ -'-a[upgrade all installed ports (only for upgrading)]' \ -'-u[uninstall non-active ports when upgrading and uninstalling]' \ -'-f[force mode (ignore state file)]' \ -'-s[source-only mode]' \ -'-b[binary-only mode]' \ -'-o[honor state files older than Portfile]' \ -'*::command:->command' \ -&& return 0 - -case $state in - command) - if ((CURRENT == 1)); then - state=subcommands - else - state=portname - fi - ;; -esac - -case $state in - subcommands) - _describe -t commands 'port commands' subcmds - ;; - portname) - _describe -t commands 'available ports' portlist - ;; -esac diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh deleted file mode 100644 index 277352e32..000000000 --- a/plugins/macports/macports.plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -#Aliases -alias pc="sudo port clean --all installed" -alias pi="sudo port install $1" -alias psu="sudo port selfupdate" -alias puni="sudo port uninstall inactive" -alias puo="sudo port upgrade outdated" -alias pup="psu && puo" - diff --git a/plugins/mysql-macports/mysql-macports.plugin.zsh b/plugins/mysql-macports/mysql-macports.plugin.zsh deleted file mode 100644 index c39563fe4..000000000 --- a/plugins/mysql-macports/mysql-macports.plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -# commands to control local mysql-server installation -# paths are for osx installation via macports - -alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start' -alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop' -alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart' - -alias mysqlstatus='mysqladmin5 -u root -p ping' diff --git a/plugins/osx/_man-preview b/plugins/osx/_man-preview deleted file mode 100644 index 6cc344ad4..000000000 --- a/plugins/osx/_man-preview +++ /dev/null @@ -1,5 +0,0 @@ -#compdef man-preview -#autoload - -_man - diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh deleted file mode 100644 index 682bb2667..000000000 --- a/plugins/osx/osx.plugin.zsh +++ /dev/null @@ -1,99 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: osx.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.1 -# ------------------------------------------------------------------------------ - - -function tab() { - local command="cd \\\"$PWD\\\"" - (( $# > 0 )) && command="${command}; $*" - - the_app=$( - osascript 2>/dev/null </dev/null </dev/null </dev/null </dev/null < 0 )) && qlmanage -p $* &>/dev/null & -} - -function man-preview() { - man -t "$@" | open -f -a Preview -} - -function trash() { - local trash_dir="${HOME}/.Trash" - local temp_ifs=$IFS - IFS=$'\n' - for item in "$@"; do - if [[ -e "$item" ]]; then - item_name="$(basename $item)" - if [[ -e "${trash_dir}/${item_name}" ]]; then - mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")" - else - mv -f "$item" "${trash_dir}/" - fi - fi - done - IFS=$temp_ifs -} - diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh deleted file mode 100644 index a11a097f5..000000000 --- a/plugins/textmate/textmate.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -alias et='mate .' -alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo' -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' - -# Edit Ruby app in TextMate -alias mr='mate CHANGELOG app config db lib public script spec test' - -function tm() { - cd $1 - mate $1 -} From 638e4f13f0b80b66a33fa304c66ceb4de5f335df Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:38:24 -0500 Subject: [PATCH 066/203] And archlinux doesn't know yum. --- plugins/yum/yum.plugin.zsh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 plugins/yum/yum.plugin.zsh diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh deleted file mode 100644 index d6ba7ed62..000000000 --- a/plugins/yum/yum.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -## Aliases - -alias ys="yum search" # search package -alias yp="yum info" # show package info -alias yl="yum list" # list packages -alias yli="yum list installed" # print all installed packages - -alias yu="sudo yum update" # upgrate packages -alias yi="sudo yum install" # install package -alias yr="sudo yum remove" # remove package -alias yrl="sudo yum remove --remove-leaves" # remove package and leaves -alias yc="sudo yum clean all" # clean cache From f5c1a957d33c05752dc60908f63541de5770cfe7 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 14:42:50 -0500 Subject: [PATCH 067/203] I said, archlinux isn't mac! --- plugins/brew/_brew | 80 ---------------------------- plugins/brew/brew.plugin.zsh | 1 - plugins/cloudapp/cloudapp.plugin.zsh | 2 - plugins/cloudapp/cloudapp.rb | 60 --------------------- 4 files changed, 143 deletions(-) delete mode 100644 plugins/brew/_brew delete mode 100644 plugins/brew/brew.plugin.zsh delete mode 100644 plugins/cloudapp/cloudapp.plugin.zsh delete mode 100755 plugins/cloudapp/cloudapp.rb diff --git a/plugins/brew/_brew b/plugins/brew/_brew deleted file mode 100644 index 1dcf0a4bf..000000000 --- a/plugins/brew/_brew +++ /dev/null @@ -1,80 +0,0 @@ -#compdef brew -#autoload - -# imported from the latest homebrew contributions - -_brew_all_formulae() { - formulae=(`brew search`) -} - -_brew_installed_formulae() { - installed_formulae=(`brew list`) -} - -local -a _1st_arguments -_1st_arguments=( - 'cat:display formula file for a formula' - 'cleanup:uninstall unused and old versions of packages' - 'create:create a new formula' - 'deps:list dependencies and dependants of a formula' - 'doctor:audits your installation for common issues' - 'edit:edit a formula' - 'home:visit the homepage of a formula or the brew project' - 'info:information about a formula' - 'install:install a formula' - 'link:link a formula' - 'list:list files in a formula or not-installed formulae' - 'log:git commit log for a formula' - 'missing:check all installed formuale for missing dependencies.' - 'outdated:list formulas for which a newer version is available' - 'prune:remove dead links' - 'remove:remove a formula' - 'search:search for a formula (/regex/ or string)' - 'server:start a local web app that lets you browse formulae (requires Sinatra)' - 'unlink:unlink a formula' - 'update:freshen up links' - 'upgrade:upgrade outdated formulae' - 'uses:show formulas which depend on a formula' -) - -local expl -local -a formulae installed_formulae - -_arguments \ - '(-v)-v[verbose]' \ - '(--cellar)--cellar[brew cellar]' \ - '(--config)--config[brew configuration]' \ - '(--env)--env[brew environment]' \ - '(--repository)--repository[brew repository]' \ - '(--version)--version[version information]' \ - '(--prefix)--prefix[where brew lives on this system]' \ - '(--cache)--cache[brew cache]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "brew subcommand" _1st_arguments - return -fi - -case "$words[1]" in - search|-S) - _arguments \ - '(--macports)--macports[search the macports repository]' \ - '(--fink)--fink[search the fink repository]' ;; - list|ls) - _arguments \ - '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ - '(--versions)--versions[list all installed versions of a formula]' \ - '1: :->forms' && return 0 - - if [[ "$state" == forms ]]; then - _brew_installed_formulae - _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae - fi ;; - install|home|homepage|log|info|abv|uses|cat|deps|edit|options) - _brew_all_formulae - _wanted formulae expl 'all formulae' compadd -a formulae ;; - remove|rm|uninstall|unlink|cleanup|link|ln) - _brew_installed_formulae - _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; -esac diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh deleted file mode 100644 index c2e95884e..000000000 --- a/plugins/brew/brew.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -alias brews='brew list -1' diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh deleted file mode 100644 index 99252f690..000000000 --- a/plugins/cloudapp/cloudapp.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/zsh -alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb deleted file mode 100755 index a11cfdb32..000000000 --- a/plugins/cloudapp/cloudapp.rb +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env ruby -# -# cloudapp -# Zach Holman / @holman -# -# Uploads a file from the command line to CloudApp, drops it into your -# clipboard (on a Mac, at least). -# -# Example: -# -# cloudapp drunk-blake.png -# -# This requires Aaron Russell's cloudapp_api gem: -# -# gem install cloudapp_api -# -# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: -# -# email -# password - -require 'rubygems' -begin - require 'cloudapp_api' -rescue LoadError - puts "You need to install cloudapp_api: gem install cloudapp_api" - exit!(1) -end - -config_file = "#{ENV['HOME']}/.cloudapp" -unless File.exist?(config_file) - puts "You need to type your email and password (one per line) into "+ - "`~/.cloudapp`" - exit!(1) -end - -email,password = File.read(config_file).split("\n") - -class HTTParty::Response - # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU - # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT - def ok? ; true end -end - -if ARGV[0].nil? - puts "You need to specify a file to upload." - exit!(1) -end - -CloudApp.authenticate(email,password) -url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url - -# Say it for good measure. -puts "Uploaded to #{url}." - -# Get the embed link. -url = "#{url}/#{ARGV[0].split('/').last}" - -# Copy it to your (Mac's) clipboard. -`echo '#{url}' | tr -d "\n" | pbcopy` From 0234005a3e0df6de8d967c2a8a85001662291603 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 15:39:40 -0500 Subject: [PATCH 068/203] Support colours in less --- lib/less.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/less.zsh diff --git a/lib/less.zsh b/lib/less.zsh new file mode 100644 index 000000000..f55bc1968 --- /dev/null +++ b/lib/less.zsh @@ -0,0 +1,8 @@ +# support colors in less +export LESS_TERMCAP_mb=$'\E[01;31m' +export LESS_TERMCAP_md=$'\E[01;31m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;44;33m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;32m' From 45c698c099ad293ca79d6f458585e113db801480 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 16:19:11 -0500 Subject: [PATCH 069/203] Reworked the sprunge script into a zsh function. There's no need to manipulate $PATH to get a zsh script loading. --- plugins/sprunge/sprunge | 75 -------------------------- plugins/sprunge/sprunge.plugin.zsh | 84 +++++++++++++++++++++++++++--- 2 files changed, 78 insertions(+), 81 deletions(-) delete mode 100755 plugins/sprunge/sprunge diff --git a/plugins/sprunge/sprunge b/plugins/sprunge/sprunge deleted file mode 100755 index 10af8e2b3..000000000 --- a/plugins/sprunge/sprunge +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/zsh - -# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf -# Created by the blogger at the URL below...I don't know where to find his/her name -# Original found at http://www.shellperson.net/sprunge-pastebin-script/ - -usage() { - cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - -USAGE - $0 filename.txt - $0 < filename.txt - piped_data | $0 - -INPUT METHODS - -$0 can accept piped data, STDIN redirection [ +# Created by the blogger at the URL below...I don't know where to find his/her name +# Original found at http://www.shellperson.net/sprunge-pastebin-script/ + +sprunge () { + if [ -t 0 ]; then + if [ "$*" ]; then + if [ -f "$*" ]; then + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) +except: + print('text')" | python) + url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + fi + else + cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 < filename.txt + piped_data | $0 + +INPUT METHODS + +$0 can accept piped data, STDIN redirection [ Date: Mon, 28 Nov 2011 16:23:46 -0500 Subject: [PATCH 070/203] Sprunge should call return, not exit on failure now. Otherwise it kills the shell... doh. --- plugins/sprunge/sprunge.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 20204b156..208e381e7 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -72,7 +72,7 @@ description, it will NOT generate an error, but will instead treat it as a text string and upload it. HERE - exit + return 1 fi else syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! From c5404482a516d7b697afa700cccbca94151c11bb Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 17:06:13 -0500 Subject: [PATCH 071/203] Its better practise to use [[ and ]] rather than [ and ] --- plugins/sprunge/sprunge.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 208e381e7..32da7b12f 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -11,7 +11,7 @@ # if [[ ${_plugin__path} == "on" ]]; then # Plugin setting: Add this plugin directory to the path # export PATH=$PATH:$ZSH/plugins/sprunge -# elif [ -z "${commands[sprunge]}" ]; then +# elif [[ -z "${commands[sprunge]}" ]]; then # Nope. No `sprunge` command, period. So, dumb/simple alias, here we go! # alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" # fi @@ -21,9 +21,9 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ sprunge () { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then + if [[ -t 0 ]]; then + if [[ "$*" ]]; then + if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: from pygments.lexers import get_lexer_for_filename @@ -81,7 +81,7 @@ HERE done | curl -F 'sprunge=<-' http://sprunge.us) fi - if [ "$syntax" != "text" ]; then + if [[ "$syntax" != "text" ]]; then echo "$url?$syntax" else echo $url From 30d95b2bc991dcf99816695f035d8abe6b8087c7 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 18:08:17 -0500 Subject: [PATCH 072/203] Add colour to cower. How aur wrappers are managed at the moment is not ideal. --- plugins/archlinux/archlinux.plugin.zsh | 5 ++++- plugins/archlinux/aur-helpers/aur-helper-cower.zsh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 10a84866a..ffda84bf7 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -8,7 +8,7 @@ # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. alias pacin='sudo pacman -S' # Install specific package(s) from the repositories -alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file +alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies alias pacrep='pacman -Si' # Display information about a given package in the repositories @@ -61,3 +61,6 @@ pacman() { *) $pacman_bin "$@" ;; esac } + +# TODO There needs to be a better way to support this +[[ -x /usr/bin/cower ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-cower.zsh diff --git a/plugins/archlinux/aur-helpers/aur-helper-cower.zsh b/plugins/archlinux/aur-helpers/aur-helper-cower.zsh index e69de29bb..229af7653 100644 --- a/plugins/archlinux/aur-helpers/aur-helper-cower.zsh +++ b/plugins/archlinux/aur-helpers/aur-helper-cower.zsh @@ -0,0 +1 @@ +alias cower='cower --color=auto' From 1a5e86d9a693922415f204bd4bde698f85518a51 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 21:20:06 -0500 Subject: [PATCH 073/203] Variables here should be marked local. --- plugins/sprunge/sprunge.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 32da7b12f..55dff180b 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -21,6 +21,8 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ sprunge () { + local url syntax + if [[ -t 0 ]]; then if [[ "$*" ]]; then if [[ -f "$*" ]]; then From e0535cce8bed4be88a76ed7b769f620335dce925 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 21:28:02 -0500 Subject: [PATCH 074/203] One bug fix, one removal of an unnecessary cat. --- plugins/sprunge/sprunge.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 55dff180b..41c4c2671 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -24,7 +24,7 @@ sprunge () { local url syntax if [[ -t 0 ]]; then - if [[ "$*" ]]; then + if [[ -n "$*" ]]; then if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: @@ -32,7 +32,7 @@ sprunge () { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*") fi else cat << HERE From fad4edbf2e2e89b876514e7c90afb869f23723a3 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 29 Nov 2011 16:40:38 +1100 Subject: [PATCH 075/203] This was saved from tools, as those tools are worthless for arch! AUR/pkgbuild ftw! was a dummy file. tools removed tools removed tools removed tools removed tools removed tools removed tools removed --- themes/theme_chooser.sh | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 themes/theme_chooser.sh diff --git a/themes/theme_chooser.sh b/themes/theme_chooser.sh new file mode 100755 index 000000000..2f0760a2b --- /dev/null +++ b/themes/theme_chooser.sh @@ -0,0 +1,99 @@ +#!/bin/zsh + +# Zsh Theme Chooser by fox (fox91 at anche dot no) +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. + +# the zsh script won't take the current enviroment variables :( +ZSH="/usr/share/oh-my-zsh" + +THEMES_DIR="$ZSH/themes" +FAVLIST="${HOME}/.zsh_favlist" +source $ZSH/oh-my-zsh.zsh + +function noyes() { + read "a?$1 [y/N] " + if [[ $a == "N" || $a == "n" || $a = "" ]]; then + return 0 + fi + return 1 +} + +function theme_preview() { + THEME=$1 + THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` + print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color" + source "$THEMES_DIR/$THEME" + print -P $PROMPT +} + +function banner() { + echo + echo "╺━┓┏━┓╻ ╻ ╺┳╸╻ ╻┏━╸┏┳┓┏━╸ ┏━╸╻ ╻┏━┓┏━┓┏━┓┏━╸┏━┓" + echo "┏━┛┗━┓┣━┫ ┃ ┣━┫┣╸ ┃┃┃┣╸ ┃ ┣━┫┃ ┃┃ ┃┗━┓┣╸ ┣┳┛" + echo "┗━╸┗━┛╹ ╹ ╹ ╹ ╹┗━╸╹ ╹┗━╸ ┗━╸╹ ╹┗━┛┗━┛┗━┛┗━╸╹┗╸" + echo +} + +function usage() { + echo "Usage: $0 [options] [theme]" + echo + echo "Options" + echo " -l List available themes" + echo " -s Show all themes" + echo " -h Get this help message" + exit 1 +} + +function list_themes() { + for THEME in $(ls $THEMES_DIR); do + THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` + echo $THEME_NAME + done +} + +function insert_favlist() { + if grep -q "$THEME_NAME" $FAVLIST 2> /dev/null ; then + echo "Already in favlist" + else + echo $THEME_NAME >> $FAVLIST + echo "Saved to favlist" + fi + +} + +function theme_chooser() { + for THEME in $(ls $THEMES_DIR); do + echo + theme_preview $THEME + echo + if [[ -z $1 ]]; then + noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ + insert_favlist $THEME_NAME + echo + fi + done +} + +while getopts ":lhs" Option +do + case $Option in + l ) list_themes ;; + s ) theme_chooser 0 ;; + h ) usage ;; + * ) usage ;; # Default. + esac +done + +if [[ -z $Option ]]; then + if [[ -z $1 ]]; then + banner + echo + theme_chooser + else + theme_preview $1".zsh-theme" + fi +fi From f6fb5366ff5a3358c8bd7550502ef89b98a298bc Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 29 Nov 2011 16:44:05 +1100 Subject: [PATCH 076/203] Git didn't run everything I expected. now it should have.. --- dummy | 0 tools/README.md | 1 - tools/check_for_upgrade.sh | 35 -------- tools/install.sh | 36 --------- tools/require_tool.sh | 161 ------------------------------------- tools/theme_chooser.sh | 96 ---------------------- tools/uninstall.sh | 20 ----- tools/upgrade.sh | 12 --- 8 files changed, 361 deletions(-) delete mode 100644 dummy delete mode 100644 tools/README.md delete mode 100644 tools/check_for_upgrade.sh delete mode 100755 tools/install.sh delete mode 100755 tools/require_tool.sh delete mode 100755 tools/theme_chooser.sh delete mode 100644 tools/uninstall.sh delete mode 100644 tools/upgrade.sh diff --git a/dummy b/dummy deleted file mode 100644 index e69de29bb..000000000 diff --git a/tools/README.md b/tools/README.md deleted file mode 100644 index 5029f3f3f..000000000 --- a/tools/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory is worthless to our fork, Remove? diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh deleted file mode 100644 index aeaa0e415..000000000 --- a/tools/check_for_upgrade.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -function _current_epoch() { - echo $(($(date +%s) / 60 / 60 / 24)) -} - -function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update -} - -if [ -f ~/.zsh-update ] -then - . ~/.zsh-update - - if [[ -z "$LAST_EPOCH" ]]; then - _update_zsh_update && return 0; - fi - - epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) - if [ $epoch_diff -gt 6 ] - then - echo "[Oh My Zsh] Would you like to check for updates?" - echo "Type Y to update oh-my-zsh: \c" - read line - if [ "$line" = Y ] || [ "$line" = y ] - then - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh - # update the zsh file - _update_zsh_update - fi - fi -else - # create the zsh file - _update_zsh_update -fi diff --git a/tools/install.sh b/tools/install.sh deleted file mode 100755 index aedb706da..000000000 --- a/tools/install.sh +++ /dev/null @@ -1,36 +0,0 @@ -if [ -d ~/.oh-my-zsh ] -then - echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" - exit -fi - -echo "\033[0;34mCloning Oh My Zsh...\033[0m" -/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh - -echo "\033[0;34mLooking for an existing zsh config...\033[0m" -if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] -then - echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32]Backing up to ~/.zshrc.pre-oh-my-zsh\033[0m"; - cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh; - rm ~/.zshrc; -fi - -echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc - -echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -echo "export PATH=$PATH" >> ~/.zshrc - -echo "\033[0;34mTime to change your default shell to zsh!\033[0m" -chsh -s `which zsh` - -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" - -echo "\n\n \033[0;32m....is now installed.\033[0m" -/usr/bin/env zsh -source ~/.zshrc diff --git a/tools/require_tool.sh b/tools/require_tool.sh deleted file mode 100755 index 1fa77f77a..000000000 --- a/tools/require_tool.sh +++ /dev/null @@ -1,161 +0,0 @@ -__require_tool_version_compare () -{ - ( - # Locally ignore failures, otherwise we'll exit whenever $1 and $2 - # are not equal! - set +e - -awk_strverscmp=' - # Use only awk features that work with 7th edition Unix awk (1978). - # My, what an old awk you have, Mr. Solaris! - END { - while (length(v1) || length(v2)) { - # Set d1 to be the next thing to compare from v1, and likewise for d2. - # Normally this is a single character, but if v1 and v2 contain digits, - # compare them as integers and fractions as strverscmp does. - if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { - # Split v1 and v2 into their leading digit string components d1 and d2, - # and advance v1 and v2 past the leading digit strings. - for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue - for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue - d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) - d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) - if (d1 ~ /^0/) { - if (d2 ~ /^0/) { - # Compare two fractions. - while (d1 ~ /^0/ && d2 ~ /^0/) { - d1 = substr(d1, 2); len1-- - d2 = substr(d2, 2); len2-- - } - if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { - # The two components differ in length, and the common prefix - # contains only leading zeros. Consider the longer to be less. - d1 = -len1 - d2 = -len2 - } else { - # Otherwise, compare as strings. - d1 = "x" d1 - d2 = "x" d2 - } - } else { - # A fraction is less than an integer. - exit 1 - } - } else { - if (d2 ~ /^0/) { - # An integer is greater than a fraction. - exit 2 - } else { - # Compare two integers. - d1 += 0 - d2 += 0 - } - } - } else { - # The normal case, without worrying about digits. - if (v1 == "") d1 = v1; else { d1 = substr(v1, 1, 1); v1 = substr(v1,2) } - if (v2 == "") d2 = v2; else { d2 = substr(v2, 1, 1); v2 = substr(v2,2) } - } - if (d1 < d2) exit 1 - if (d1 > d2) exit 2 - } - } -' - awk "$awk_strverscmp" v1="$1" v2="$2" /dev/null - case $? in - 1) echo '<';; - 0) echo '=';; - 2) echo '>';; - esac - ) -} - - -__require_tool_fatal () -{ - echo $@ >/dev/stderr - return 1 -} - -# Usage: require_tool program version -# Returns: 0 if $1 version if greater equals than $2, 1 otherwise. -# In case of error, message is written on error output. -# -# Example: require_tool gcc 4.6 -# Use GCC environment variable if defined instead of lookup for the tool -# in the environment. -require_tool () -{ - envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') - tool=$(printenv $envvar_name || echo $1) - local version=$($tool --version 2>/dev/null| \ - sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q') - if test x"$version" = x ; then - echo "$tool is required" >/dev/stderr - return 1 - fi - case $(__require_tool_version_compare "$2" "$version") in - '>') - echo "$1 $2 or better is required: this is $tool $version" >/dev/stderr - return 1 - ;; - esac -} - -usage() { - cat < /dev/null ; then - echo "Already in favlist" - else - echo $THEME_NAME >> $FAVLIST - echo "Saved to favlist" - fi - -} - -function theme_chooser() { - for THEME in $(ls $THEMES_DIR); do - echo - theme_preview $THEME - echo - if [[ -z $1 ]]; then - noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - insert_favlist $THEME_NAME - echo - fi - done -} - -while getopts ":lhs" Option -do - case $Option in - l ) list_themes ;; - s ) theme_chooser 0 ;; - h ) usage ;; - * ) usage ;; # Default. - esac -done - -if [[ -z $Option ]]; then - if [[ -z $1 ]]; then - banner - echo - theme_chooser - else - theme_preview $1".zsh-theme" - fi -fi diff --git a/tools/uninstall.sh b/tools/uninstall.sh deleted file mode 100644 index 8ff583322..000000000 --- a/tools/uninstall.sh +++ /dev/null @@ -1,20 +0,0 @@ -echo "Removing ~/.oh-my-zsh" -if [[ -d ~/.oh-my-zsh ]] -then - rm -rf ~/.oh-my-zsh -fi - -echo "Looking for an existing zsh config..." -if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ] -then - echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh"; - rm ~/.zshrc; - cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc; - source ~/.zshrc; -else - echo "Switching back to bash" - chsh -s /bin/bash - source /etc/profile -fi - -echo "Thanks for trying out Oh My Zsh. It's been uninstalled." \ No newline at end of file diff --git a/tools/upgrade.sh b/tools/upgrade.sh deleted file mode 100644 index 52a8cc4da..000000000 --- a/tools/upgrade.sh +++ /dev/null @@ -1,12 +0,0 @@ -current_path=`pwd` -echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" -( cd $ZSH && git pull origin master ) -echo -e "\033[0;32m"' __ __ '"\033[0m" -echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo -e "\033[0;32m"' /____/ '"\033[0m" -echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" -cd "$current_path" From 053982e0f0d0f42a907c6a6ca35b60cda344386c Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Tue, 29 Nov 2011 17:04:31 +1100 Subject: [PATCH 077/203] Added a fallback for paclist(). --- plugins/archlinux/archlinux.plugin.zsh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index ffda84bf7..b5ff41f41 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,7 +1,3 @@ -# This isn't finished, but shows how the aur-helpers will/can be managed -# zstyle :omz:plugins:aur-helper aur_helper {cower,meat} -#zstyle -b :omz:plugins:aur-helper aur_helper _plugin__aur_helper - # Archlinux zsh aliases and functions # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins @@ -27,9 +23,8 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li # https://bbs.archlinux.org/viewtopic.php?id=93683 paclist() { [[ -x $(which expac) ]] && expac "${fg[cyan]}%n${fg[green]}: ${reset_color}%d" || ( - read -p "You don't have 'expac' installed, install? [y,N]" install_expac - # fixme! - echo "Sorry, this isn't yet implemented, please run 'pacman -S expac' manually! (fixme!)" + pacman -Qqei|awk 'BEGIN {FS=": "}/^Name/{printf("\033[36m%s\033[32m:\033[37m ", $2)}/^Description/{print $2}' && \ + echo "Please install expac! Awk used with pacman -Qqei; expac is faster!" >&2 ) } From 4f570b5396ff673906ef5beb0b301f29ee856535 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 29 Nov 2011 17:08:21 +1100 Subject: [PATCH 078/203] User default to use awesome sprunge! --- templates/user.zsh-template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/user.zsh-template b/templates/user.zsh-template index c5d4e3a8c..b6b0a6fd0 100644 --- a/templates/user.zsh-template +++ b/templates/user.zsh-template @@ -1,5 +1,7 @@ # Check /etc/zsh/zshrc for system defaults. Eg. plugins=(git) +# Enable for awesome sprunge! +zstyle :omz:plugins:sprunge add-path on plugins+=(archlinux sprunge github) load_oh_my_zshell From 5c9bb77e5dd0ca07399d2d6e846e68f4f3f8384f Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 29 Nov 2011 17:20:37 +1100 Subject: [PATCH 079/203] corrected tiny typo. --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 1fe66bf29..c944596db 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,5 +1,5 @@ # Path to your oh-my-zsh configuration. -ZSH=/usr/share/oh-my-zsh/ +ZSH=/usr/share/oh-my-zsh # Set name of the theme to load. # Look in /usr/local/share/oh-my-zsh/themes/ From 8c6241876d51cdfb5676167d73e6ecc1eafabd40 Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Tue, 29 Nov 2011 17:45:09 +1100 Subject: [PATCH 080/203] fixed typo. --- README.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.textile b/README.textile index b60c59f6b..290dc990b 100644 --- a/README.textile +++ b/README.textile @@ -16,7 +16,7 @@ h3. Installing using cower h4. Enableing for a user. The user must first have zsh set as their shell. -@[[ $SHELL == '/bin/zsh' ]] && su -c'chsh -s $(which zsh) '@ +@[[ $SHELL != '/bin/zsh' ]] && su -c'chsh -s $(which zsh) '@ For each user who wishes to use oh-my-zsh they must append/copy the user.zsh-template to their .zshrc. @>$HOME/.zshrc@ From 4028becca3cc8630a49143ee5b761ec93a22c904 Mon Sep 17 00:00:00 2001 From: "Evan LeCompte (Home)" Date: Tue, 29 Nov 2011 04:14:38 -0500 Subject: [PATCH 081/203] copy sprunge $url to clipboard automatically if user has xclip or xsel installed --- plugins/sprunge/sprunge.plugin.zsh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 41c4c2671..691a94069 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -32,7 +32,7 @@ sprunge () { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*") + url=$(curl -s -F 'sprunge=<-' http://sprunge.us < "$*") fi else cat << HERE @@ -40,6 +40,11 @@ except: DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us + In addition to printing the returned URL, if the xset or xsel + programs are available (on $PATH), the URL will also be copied to the + PRIMARY selection and the CLIPBOARD selection (allowing to quickly + paste the url into IRC client for example). + USAGE $0 filename.txt $0 < filename.txt @@ -80,12 +85,25 @@ HERE syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! url=$(while read -r line ; do echo $line - done | curl -F 'sprunge=<-' http://sprunge.us) + done | curl -s -F 'sprunge=<-' http://sprunge.us) fi if [[ "$syntax" != "text" ]]; then - echo "$url?$syntax" + # if stdout is not a tty, suppress trailing newline + if [[ ! -t 1 ]] ; then local flags='-n' ; fi + echo $flags "$url?$syntax" else - echo $url + # if stdout is not a tty, suppress trailing newline + if [[ ! -t 1 ]] ; then local flags='-n' ; fi + echo $flags $url + fi + + #copy url to primary and clipboard (middle-mouse & shift+ins/Ctrl+v) + if (( $+commands[xclip] )); then + echo -n "$url?$syntax" | xclip -sel primary + echo -n "$url?$syntax" | xclip -sel clipboard + elif (( $+commands[xsel] )); then + echo -n "$url?$syntax" | xsel -ip #primary + echo -n "$url?$syntax" | xsel -ib #clipboard fi } From e04b21fafa1fb354bd80fdb8995554e165119ee6 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 16:19:11 -0500 Subject: [PATCH 082/203] Reworked the sprunge script into a zsh function. There's no need to manipulate $PATH to get a zsh script loading. --- plugins/sprunge/sprunge | 75 -------------------------- plugins/sprunge/sprunge.plugin.zsh | 84 +++++++++++++++++++++++++++--- 2 files changed, 78 insertions(+), 81 deletions(-) delete mode 100755 plugins/sprunge/sprunge diff --git a/plugins/sprunge/sprunge b/plugins/sprunge/sprunge deleted file mode 100755 index 10af8e2b3..000000000 --- a/plugins/sprunge/sprunge +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/zsh - -# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf -# Created by the blogger at the URL below...I don't know where to find his/her name -# Original found at http://www.shellperson.net/sprunge-pastebin-script/ - -usage() { - cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - -USAGE - $0 filename.txt - $0 < filename.txt - piped_data | $0 - -INPUT METHODS - -$0 can accept piped data, STDIN redirection [ +# Created by the blogger at the URL below...I don't know where to find his/her name +# Original found at http://www.shellperson.net/sprunge-pastebin-script/ + +sprunge () { + if [ -t 0 ]; then + if [ "$*" ]; then + if [ -f "$*" ]; then + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) +except: + print('text')" | python) + url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + fi + else + cat << HERE + +DESCRIPTION + Upload data and fetch URL from the pastebin http://sprunge.us + +USAGE + $0 filename.txt + $0 < filename.txt + piped_data | $0 + +INPUT METHODS + +$0 can accept piped data, STDIN redirection [ Date: Mon, 28 Nov 2011 16:23:46 -0500 Subject: [PATCH 083/203] Sprunge should call return, not exit on failure now. Otherwise it kills the shell... doh. --- plugins/sprunge/sprunge.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 20204b156..208e381e7 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -72,7 +72,7 @@ description, it will NOT generate an error, but will instead treat it as a text string and upload it. HERE - exit + return 1 fi else syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! From 0117c93a539ed0a13762f4ea6e2be4a72c127f29 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 17:06:13 -0500 Subject: [PATCH 084/203] Its better practise to use [[ and ]] rather than [ and ] --- plugins/sprunge/sprunge.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 208e381e7..32da7b12f 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -11,7 +11,7 @@ # if [[ ${_plugin__path} == "on" ]]; then # Plugin setting: Add this plugin directory to the path # export PATH=$PATH:$ZSH/plugins/sprunge -# elif [ -z "${commands[sprunge]}" ]; then +# elif [[ -z "${commands[sprunge]}" ]]; then # Nope. No `sprunge` command, period. So, dumb/simple alias, here we go! # alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" # fi @@ -21,9 +21,9 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ sprunge () { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then + if [[ -t 0 ]]; then + if [[ "$*" ]]; then + if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: from pygments.lexers import get_lexer_for_filename @@ -81,7 +81,7 @@ HERE done | curl -F 'sprunge=<-' http://sprunge.us) fi - if [ "$syntax" != "text" ]; then + if [[ "$syntax" != "text" ]]; then echo "$url?$syntax" else echo $url From 1471e5d70bda5832c55249588a0020f8bfb29481 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 21:20:06 -0500 Subject: [PATCH 085/203] Variables here should be marked local. --- plugins/sprunge/sprunge.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 32da7b12f..55dff180b 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -21,6 +21,8 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ sprunge () { + local url syntax + if [[ -t 0 ]]; then if [[ "$*" ]]; then if [[ -f "$*" ]]; then From bfe6d22bdac75873b06baff79fadbbd58da41e30 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 21:28:02 -0500 Subject: [PATCH 086/203] One bug fix, one removal of an unnecessary cat. --- plugins/sprunge/sprunge.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 55dff180b..41c4c2671 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -24,7 +24,7 @@ sprunge () { local url syntax if [[ -t 0 ]]; then - if [[ "$*" ]]; then + if [[ -n "$*" ]]; then if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: @@ -32,7 +32,7 @@ sprunge () { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*") fi else cat << HERE From 404ffffc0e7808826f49c5965940088dad2532c3 Mon Sep 17 00:00:00 2001 From: "Evan LeCompte (Home)" Date: Tue, 29 Nov 2011 04:14:38 -0500 Subject: [PATCH 087/203] copy sprunge $url to clipboard automatically if user has xclip or xsel installed --- plugins/sprunge/sprunge.plugin.zsh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 41c4c2671..691a94069 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -32,7 +32,7 @@ sprunge () { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*") + url=$(curl -s -F 'sprunge=<-' http://sprunge.us < "$*") fi else cat << HERE @@ -40,6 +40,11 @@ except: DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us + In addition to printing the returned URL, if the xset or xsel + programs are available (on $PATH), the URL will also be copied to the + PRIMARY selection and the CLIPBOARD selection (allowing to quickly + paste the url into IRC client for example). + USAGE $0 filename.txt $0 < filename.txt @@ -80,12 +85,25 @@ HERE syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! url=$(while read -r line ; do echo $line - done | curl -F 'sprunge=<-' http://sprunge.us) + done | curl -s -F 'sprunge=<-' http://sprunge.us) fi if [[ "$syntax" != "text" ]]; then - echo "$url?$syntax" + # if stdout is not a tty, suppress trailing newline + if [[ ! -t 1 ]] ; then local flags='-n' ; fi + echo $flags "$url?$syntax" else - echo $url + # if stdout is not a tty, suppress trailing newline + if [[ ! -t 1 ]] ; then local flags='-n' ; fi + echo $flags $url + fi + + #copy url to primary and clipboard (middle-mouse & shift+ins/Ctrl+v) + if (( $+commands[xclip] )); then + echo -n "$url?$syntax" | xclip -sel primary + echo -n "$url?$syntax" | xclip -sel clipboard + elif (( $+commands[xsel] )); then + echo -n "$url?$syntax" | xsel -ip #primary + echo -n "$url?$syntax" | xsel -ib #clipboard fi } From 258fda38d005aa5e0e9ceedc0c209ebb8490db2d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 05:16:15 -0500 Subject: [PATCH 088/203] Fixed up sprunge command. Condensed it and fixed the whitespace. --- plugins/sprunge/sprunge.plugin.zsh | 36 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 691a94069..f59647990 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -41,9 +41,9 @@ DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us In addition to printing the returned URL, if the xset or xsel - programs are available (on $PATH), the URL will also be copied to the + programs are available (on $PATH), the URL will also be copied to the PRIMARY selection and the CLIPBOARD selection (allowing to quickly - paste the url into IRC client for example). + paste the url into IRC client for example). USAGE $0 filename.txt @@ -88,22 +88,28 @@ HERE done | curl -s -F 'sprunge=<-' http://sprunge.us) fi - if [[ "$syntax" != "text" ]]; then - # if stdout is not a tty, suppress trailing newline - if [[ ! -t 1 ]] ; then local flags='-n' ; fi - echo $flags "$url?$syntax" - else - # if stdout is not a tty, suppress trailing newline - if [[ ! -t 1 ]] ; then local flags='-n' ; fi - echo $flags $url - fi + local flags + + # trim whitespaces and add syntax info + url=${url//[[:space:]]} + [[ $syntax != text ]] && url=${url}?${syntax} + + # if stdout is not a tty, suppress trailing newline + # XXX: i don't think this is the right thing to do + # [[ ! -t 1 ]] && flags='-n' + + # output + echo $flags $url + + # don't copy to clipboad if piped + [[ ! -t 1 ]] && return 0 #copy url to primary and clipboard (middle-mouse & shift+ins/Ctrl+v) if (( $+commands[xclip] )); then - echo -n "$url?$syntax" | xclip -sel primary - echo -n "$url?$syntax" | xclip -sel clipboard + echo -n $url | xclip -sel primary + echo -n $url | xclip -sel clipboard elif (( $+commands[xsel] )); then - echo -n "$url?$syntax" | xsel -ip #primary - echo -n "$url?$syntax" | xsel -ib #clipboard + echo -n $url | xsel -ip #primary + echo -n $url | xsel -ib #clipboard fi } From e915a1111cf6757b29d02556d9252bcb90b65776 Mon Sep 17 00:00:00 2001 From: "Evan LeCompte (Home)" Date: Tue, 29 Nov 2011 05:19:06 -0500 Subject: [PATCH 089/203] Don't check for tools/check_for_upgrade.sh (its gone now) --- oh-my-zsh.zsh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 891e8d467..6aa016198 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,9 +1,3 @@ -# Check for updates on initial load... -if [ "$DISABLE_AUTO_UPDATE" != "true" ] -then - /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh -fi - # Initializes Oh My Zsh # add a function path From 6262677a96db8f314f0b72667e20d41d3be00dc6 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 05:31:59 -0500 Subject: [PATCH 090/203] Better to use $+commands here. --- lib/notfound.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/notfound.zsh b/lib/notfound.zsh index 570976197..6ec65c881 100644 --- a/lib/notfound.zsh +++ b/lib/notfound.zsh @@ -1,4 +1,4 @@ -if [[ -x /usr/bin/pkgfile ]]; then +if (( $+commands[pkgfile] )); then command_not_found_handler() { local pkg p local pid ppid pgrp session tty_nr tpgid From e5a3d116387fdaabb85bf2f7bf4235a0ada78932 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 06:17:21 -0500 Subject: [PATCH 091/203] More flags that for pacman that shouldn't trigger root. --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b5ff41f41..395c692a4 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -52,7 +52,7 @@ asroot() { pacman() { pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} case $1 in - -S | -S[^sih]* | -R* | -U*) asroot $pacman_bin $@ ;; + -S | -S[^sihgl]* | -R* | -U*) asroot $pacman_bin $@ ;; *) $pacman_bin "$@" ;; esac } From f3292101da6404ed169e5f18f50b16cde0733f79 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 06:24:13 -0500 Subject: [PATCH 092/203] Comment out pacman wrapper. It needs to be rewritten. --- plugins/archlinux/archlinux.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 395c692a4..1cee735c6 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -49,13 +49,13 @@ asroot() { whence sudo &>/dev/null && sudo $@ || su -c "$@" } -pacman() { - pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} - case $1 in - -S | -S[^sihgl]* | -R* | -U*) asroot $pacman_bin $@ ;; - *) $pacman_bin "$@" ;; - esac -} +# pacman() { +# pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} +# case $1 in +# -S | -S[^sihgl]* | -R* | -U*) asroot $pacman_bin $@ ;; +# *) $pacman_bin "$@" ;; +# esac +# } # TODO There needs to be a better way to support this [[ -x /usr/bin/cower ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-cower.zsh From 83a3121974a007ba28115a37013ac5c4575fe95b Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 06:33:00 -0500 Subject: [PATCH 093/203] Naive first attempt to split /usr/share/oh-my-zsh/ with ~/.oh-my-zsh/. Proper overriding needs to be done. --- oh-my-zsh.zsh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 6aa016198..fa0864826 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,15 +1,19 @@ # Initializes Oh My Zsh +ZSH=${ZSH:-/usr/share/oh-my-zsh/} # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) +fpath=(~/.oh-my-zsh/functions ~/.oh-my-zsh/completions $fpath) # Load all of the config files in ~/oh-my-zsh that end in .zsh # TIP: Add files you don't want in git to .gitignore for config_file ($ZSH/lib/*.zsh) source $config_file +for config_file (~/.oh-my-zsh/lib/*.zsh) source $config_file # Add all defined plugins to fpath plugin=${plugin:=()} for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +for plugin ($plugins) fpath=(~/.oh-my-zsh/plugins/$plugin $fpath) # Load and run compinit autoload -U compinit @@ -17,22 +21,22 @@ compinit -i # Set ZSH_CUSTOM to the path where your custom config files # and plugins exists, or else we will use the default custom/ -if [ "$ZSH_CUSTOM" = "" ] -then - ZSH_CUSTOM="$ZSH/custom" -fi +# if [ "$ZSH_CUSTOM" = "" ] +# then +# ZSH_CUSTOM="$ZSH/custom" +# fi # Load all of the plugins that were defined in ~/.zshrc -for plugin ($plugins); do - if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh - elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh - fi -done +# for plugin ($plugins); do +# if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then +# source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh +# elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then +# source $ZSH/plugins/$plugin/$plugin.plugin.zsh +# fi +# done # Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh) source $config_file +# for config_file ($ZSH_CUSTOM/*.zsh) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] @@ -49,4 +53,3 @@ else source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi fi - From 6c7183f364119263e58ecc73e846f4140a6ffb89 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 07:00:05 -0500 Subject: [PATCH 094/203] Better split. Local directory is ~/.omz --- oh-my-zsh.zsh | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index fa0864826..0b5db7fca 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,43 +1,31 @@ # Initializes Oh My Zsh ZSH=${ZSH:-/usr/share/oh-my-zsh/} +local config_file plugin + # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) -fpath=(~/.oh-my-zsh/functions ~/.oh-my-zsh/completions $fpath) - -# Load all of the config files in ~/oh-my-zsh that end in .zsh -# TIP: Add files you don't want in git to .gitignore for config_file ($ZSH/lib/*.zsh) source $config_file -for config_file (~/.oh-my-zsh/lib/*.zsh) source $config_file - -# Add all defined plugins to fpath plugin=${plugin:=()} for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) -for plugin ($plugins) fpath=(~/.oh-my-zsh/plugins/$plugin $fpath) + +if [[ -d ~/.omz ]]; then + [[ -d ~/.omz/functions ]] && fpath=(~/.omz/functions $fpath) + [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) + + if [[ -d ~/.omz/lib ]]; then + for config_file (~/.omz/lib/*.zsh) source $config_file + fi + + if [[ -d ~/.omz/plugins ]]; then + for plugin ($plugins) fpath=(~/.omz/plugins/$plugin $fpath) + fi +fi # Load and run compinit autoload -U compinit compinit -i -# Set ZSH_CUSTOM to the path where your custom config files -# and plugins exists, or else we will use the default custom/ -# if [ "$ZSH_CUSTOM" = "" ] -# then -# ZSH_CUSTOM="$ZSH/custom" -# fi - -# Load all of the plugins that were defined in ~/.zshrc -# for plugin ($plugins); do -# if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then -# source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh -# elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then -# source $ZSH/plugins/$plugin/$plugin.plugin.zsh -# fi -# done - -# Load all of your custom configurations from custom/ -# for config_file ($ZSH_CUSTOM/*.zsh) source $config_file - # Load the theme if [ "$ZSH_THEME" = "random" ] then From 7161dcb2b4a5add3b46c354f6a640b3335781584 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 07:01:52 -0500 Subject: [PATCH 095/203] Making command-not-found support a plugin. --- lib/notfound.zsh => plugins/notfound/notfound.plugin.zsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/notfound.zsh => plugins/notfound/notfound.plugin.zsh (100%) diff --git a/lib/notfound.zsh b/plugins/notfound/notfound.plugin.zsh similarity index 100% rename from lib/notfound.zsh rename to plugins/notfound/notfound.plugin.zsh From 45b9fb9b070329335df784e8d7afbd6f1d45b050 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 07:30:09 -0500 Subject: [PATCH 096/203] I may have broken plugin loading. This should restore it. It will load a plugin out of ~/.omz first and if its not there /usr/share/oh-my-zsh --- oh-my-zsh.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 0b5db7fca..614db82c5 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -22,6 +22,15 @@ if [[ -d ~/.omz ]]; then fi fi +# load plugins +for plugin ($plugins); do + if [[ -f ~/.omz/plugins/$plugin/$plugin.plugin.zsh ]]; then + source ~/.omz/plugins/$plugin/$plugin.plugin.zsh + elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then + source $ZSH/plugins/$plugin/$plugin.plugin.zsh + fi +done + # Load and run compinit autoload -U compinit compinit -i From b84ff8f11939a3552efc0a675d83a77fd3e6db02 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 07:35:14 -0500 Subject: [PATCH 097/203] Order is important here. Opps. --- oh-my-zsh.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 0b5db7fca..1ee639c5c 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -3,6 +3,10 @@ ZSH=${ZSH:-/usr/share/oh-my-zsh/} local config_file plugin +# Load and run compinit +autoload -U compinit +compinit -i + # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) for config_file ($ZSH/lib/*.zsh) source $config_file @@ -22,10 +26,6 @@ if [[ -d ~/.omz ]]; then fi fi -# Load and run compinit -autoload -U compinit -compinit -i - # Load the theme if [ "$ZSH_THEME" = "random" ] then From 160761fbfeb3129fd3030f755d80d0ac19ddde8b Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 07:37:50 -0500 Subject: [PATCH 098/203] This really fixes everything! --- oh-my-zsh.zsh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 614db82c5..09ea98919 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -5,23 +5,31 @@ local config_file plugin # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) -for config_file ($ZSH/lib/*.zsh) source $config_file -plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) if [[ -d ~/.omz ]]; then [[ -d ~/.omz/functions ]] && fpath=(~/.omz/functions $fpath) [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) +fi +for config_file ($ZSH/lib/*.zsh) source $config_file +if [[ -d ~/.omz ]]; then if [[ -d ~/.omz/lib ]]; then for config_file (~/.omz/lib/*.zsh) source $config_file fi +fi +plugin=${plugin:=()} +for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +if [[ -d ~/.omz ]]; then if [[ -d ~/.omz/plugins ]]; then for plugin ($plugins) fpath=(~/.omz/plugins/$plugin $fpath) fi fi +# Load and run compinit +autoload -U compinit +compinit -i + # load plugins for plugin ($plugins); do if [[ -f ~/.omz/plugins/$plugin/$plugin.plugin.zsh ]]; then @@ -31,10 +39,6 @@ for plugin ($plugins); do fi done -# Load and run compinit -autoload -U compinit -compinit -i - # Load the theme if [ "$ZSH_THEME" = "random" ] then From 65c9751b92f46fe43164186193bdac2acb294dd2 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 00:59:16 +1100 Subject: [PATCH 099/203] minimal plugins now! --- plugins/ant/ant.plugin.zsh | 26 - plugins/archlinux/archlinux.plugin.zsh | 1 + plugins/autojump/autojump.plugin.zsh | 3 - plugins/bundler/_bundler | 82 --- plugins/bundler/bundler.plugin.zsh | 46 -- plugins/cake/cake.plugin.zsh | 36 - plugins/cap/cap.plugin.zsh | 21 - plugins/compleat/compleat.plugin.zsh | 20 - plugins/cpanm/_cpanm | 67 -- plugins/dirpersist/dirpersist.plugin.zsh | 39 -- plugins/django/django.plugin.zsh | 222 ------ plugins/extract/_extract | 8 - plugins/extract/extract.plugin.zsh | 85 --- plugins/gas/_gas | 34 - plugins/gem/_gem | 64 -- plugins/git-flow/git-flow.plugin.zsh | 332 --------- plugins/gnu-utils/gnu-utils.plugin.zsh | 80 --- plugins/gpg-agent/gpg-agent.plugin.zsh | 26 - plugins/gradle/gradle.plugin.zsh | 119 ---- plugins/grails/grails.plugin.zsh | 54 -- plugins/heroku/_heroku | 158 ----- plugins/history-substring-search/README | 7 - .../history-substring-search.plugin.zsh | 12 - .../history-substring-search.zsh | 642 ------------------ plugins/kate/kate.plugin.zsh | 9 - plugins/knife/_knife | 174 ----- plugins/lein/lein.plugin.zsh | 27 - plugins/lighthouse/lighthouse.plugin.zsh | 16 - plugins/lol/lol.plugin.zsh | 37 - plugins/mercurial/mercurial.plugin.zsh | 14 - plugins/node/node.plugin.zsh | 5 - plugins/npm/npm.plugin.zsh | 1 - plugins/perl/perl.plugin.zsh | 62 -- plugins/phing/phing.plugin.zsh | 19 - plugins/pip/_pip | 46 -- plugins/pow/pow.plugin.zsh | 10 - plugins/powder/_powder | 4 - plugins/python/python.plugin.zsh | 5 - plugins/rails/rails.plugin.zsh | 13 - plugins/rails3/rails3.plugin.zsh | 19 - plugins/redis-cli/_redis-cli | 142 ---- plugins/ruby/ruby.plugin.zsh | 6 - plugins/rvm/_rvm | 147 ---- plugins/rvm/rvm.plugin.zsh | 44 -- plugins/ssh-agent/ssh-agent.plugin.zsh | 62 -- plugins/svn/svn.plugin.zsh | 42 -- plugins/taskwarrior/_task | 280 -------- plugins/taskwarrior/taskwarrior.plugin.zsh | 21 - plugins/terminitor/_terminitor | 38 -- plugins/thor/_thor | 4 - plugins/vagrant/_vagrant | 104 --- plugins/vi-mode/vi-mode.plugin.zsh | 22 - plugins/vundle/vundle.plugin.zsh | 23 - 53 files changed, 1 insertion(+), 3579 deletions(-) delete mode 100644 plugins/ant/ant.plugin.zsh delete mode 100644 plugins/autojump/autojump.plugin.zsh delete mode 100644 plugins/bundler/_bundler delete mode 100644 plugins/bundler/bundler.plugin.zsh delete mode 100644 plugins/cake/cake.plugin.zsh delete mode 100644 plugins/cap/cap.plugin.zsh delete mode 100644 plugins/compleat/compleat.plugin.zsh delete mode 100644 plugins/cpanm/_cpanm delete mode 100644 plugins/dirpersist/dirpersist.plugin.zsh delete mode 100644 plugins/django/django.plugin.zsh delete mode 100644 plugins/extract/_extract delete mode 100644 plugins/extract/extract.plugin.zsh delete mode 100644 plugins/gas/_gas delete mode 100644 plugins/gem/_gem delete mode 100644 plugins/git-flow/git-flow.plugin.zsh delete mode 100644 plugins/gnu-utils/gnu-utils.plugin.zsh delete mode 100644 plugins/gpg-agent/gpg-agent.plugin.zsh delete mode 100644 plugins/gradle/gradle.plugin.zsh delete mode 100755 plugins/grails/grails.plugin.zsh delete mode 100644 plugins/heroku/_heroku delete mode 100644 plugins/history-substring-search/README delete mode 100644 plugins/history-substring-search/history-substring-search.plugin.zsh delete mode 100644 plugins/history-substring-search/history-substring-search.zsh delete mode 100644 plugins/kate/kate.plugin.zsh delete mode 100644 plugins/knife/_knife delete mode 100644 plugins/lein/lein.plugin.zsh delete mode 100644 plugins/lighthouse/lighthouse.plugin.zsh delete mode 100644 plugins/lol/lol.plugin.zsh delete mode 100644 plugins/mercurial/mercurial.plugin.zsh delete mode 100644 plugins/node/node.plugin.zsh delete mode 100644 plugins/npm/npm.plugin.zsh delete mode 100644 plugins/perl/perl.plugin.zsh delete mode 100644 plugins/phing/phing.plugin.zsh delete mode 100644 plugins/pip/_pip delete mode 100644 plugins/pow/pow.plugin.zsh delete mode 100644 plugins/powder/_powder delete mode 100644 plugins/python/python.plugin.zsh delete mode 100644 plugins/rails/rails.plugin.zsh delete mode 100644 plugins/rails3/rails3.plugin.zsh delete mode 100644 plugins/redis-cli/_redis-cli delete mode 100644 plugins/ruby/ruby.plugin.zsh delete mode 100644 plugins/rvm/_rvm delete mode 100644 plugins/rvm/rvm.plugin.zsh delete mode 100644 plugins/ssh-agent/ssh-agent.plugin.zsh delete mode 100644 plugins/svn/svn.plugin.zsh delete mode 100644 plugins/taskwarrior/_task delete mode 100644 plugins/taskwarrior/taskwarrior.plugin.zsh delete mode 100644 plugins/terminitor/_terminitor delete mode 100644 plugins/thor/_thor delete mode 100644 plugins/vagrant/_vagrant delete mode 100644 plugins/vi-mode/vi-mode.plugin.zsh delete mode 100644 plugins/vundle/vundle.plugin.zsh diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh deleted file mode 100644 index 691d4d2db..000000000 --- a/plugins/ant/ant.plugin.zsh +++ /dev/null @@ -1,26 +0,0 @@ -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 -} - -_ant () { - if [ -f build.xml ]; then - if _ant_does_target_list_need_generating; then - sed -n '/ .ant_targets - fi - compadd `cat .ant_targets` - fi -} - -compdef _ant ant diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 1cee735c6..5aa54878b 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -59,3 +59,4 @@ asroot() { # TODO There needs to be a better way to support this [[ -x /usr/bin/cower ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-cower.zsh +[[ -x /usr/bin/meat ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-meat.zsh diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh deleted file mode 100644 index da0a12765..000000000 --- a/plugins/autojump/autojump.plugin.zsh +++ /dev/null @@ -1,3 +0,0 @@ -if [ -f `brew --prefix`/etc/autojump ]; then - . `brew --prefix`/etc/autojump -fi diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler deleted file mode 100644 index 5d22cac9a..000000000 --- a/plugins/bundler/_bundler +++ /dev/null @@ -1,82 +0,0 @@ -#compdef bundle - -local curcontext="$curcontext" state line _gems _opts ret=1 - -_arguments -C -A "-v" -A "--version" \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - _values "bundle command" \ - "install[Install the gems specified by the Gemfile or Gemfile.lock]" \ - "update[Update dependencies to their latest versions]" \ - "package[Package the .gem files required by your application]" \ - "exec[Execute a script in the context of the current bundle]" \ - "config[Specify and read configuration options for bundler]" \ - "check[Determine whether the requirements for your application are installed]" \ - "list[Show all of the gems in the current bundle]" \ - "show[Show the source location of a particular gem in the bundle]" \ - "console[Start an IRB session in the context of the current bundle]" \ - "open[Open an installed gem in the editor]" \ - "viz[Generate a visual representation of your dependencies]" \ - "init[Generate a simple Gemfile, placed in the current directory]" \ - "gem[Create a simple gem, suitable for development with bundler]" \ - "help[Describe available tasks or one specific task]" - ret=0 - ;; - args) - case $line[1] in - help) - _values 'commands' \ - 'install' \ - 'update' \ - 'package' \ - 'exec' \ - 'config' \ - 'check' \ - 'list' \ - 'show' \ - 'console' \ - 'open' \ - 'viz' \ - 'init' \ - 'gem' \ - 'help' && ret=0 - ;; - install) - _arguments \ - '(--no-color)--no-color[disable colorization in output]' \ - '(--local)--local[do not attempt to connect to rubygems.org]' \ - '(--quiet)--quiet[only output warnings and errors]' \ - '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ - '(--system)--system[install to the system location]' \ - '(--deployment)--deployment[install using defaults tuned for deployment environments]' \ - '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ - '(--path)--path=-[specify a different path than the system default]:path:_files' \ - '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ - '(--without)--without=-[exclude gems that are part of the specified named group]:groups' - ret=0 - ;; - exec) - _normal && ret=0 - ;; - (open|show) - _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) - if [[ $_gems != "" ]]; then - _values 'gems' $_gems && ret=0 - fi - ;; - *) - _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) - _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) - if [[ $_opts != "" ]]; then - _values 'options' $_opts && ret=0 - fi - ;; - esac - ;; -esac - -return ret diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh deleted file mode 100644 index 3c96b8da9..000000000 --- a/plugins/bundler/bundler.plugin.zsh +++ /dev/null @@ -1,46 +0,0 @@ -fpath=($ZSH/plugins/bundler $fpath) -autoload -U compinit -compinit -i - -alias be="bundle exec" -alias bi="bundle install" -alias bl="bundle list" -alias bp="bundle package" -alias bu="bundle update" - -# The following is based on https://github.com/gma/bundler-exec - -bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) - -## Functions - -_bundler-installed() { - which bundle > /dev/null 2>&1 -} - -_within-bundled-project() { - local check_dir=$PWD - while [ "$(dirname $check_dir)" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return - check_dir="$(dirname $check_dir)" - done - false -} - -_run-with-bundler() { - if _bundler-installed && _within-bundled-project; then - bundle exec $@ - else - $@ - fi -} - -## Main program -for cmd in $bundled_commands; do - eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}" - alias $cmd=bundled_$cmd - - if which _$cmd > /dev/null 2>&1; then - compdef _$cmd bundled_$cmd - fi -done diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh deleted file mode 100644 index 1d0d196ee..000000000 --- a/plugins/cake/cake.plugin.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# Set this to 1 if you want to cache the tasks -_cake_cache_task_list=1 - -# Cache filename -_cake_task_cache_file='.cake_task_cache' - -_cake_get_target_list () { - cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' -} - -_cake_does_target_list_need_generating () { - - if [ ${_cake_cache_task_list} -eq 0 ]; then - 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 -} - -_cake () { - if [ -f Cakefile ]; then - if _cake_does_target_list_need_generating; then - _cake_get_target_list > ${_cake_task_cache_file} - compadd `cat ${_cake_task_cache_file}` - else - compadd `_cake_get_target_list` - fi - fi -} - -compdef _cake cake \ No newline at end of file diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh deleted file mode 100644 index 8336182d5..000000000 --- a/plugins/cap/cap.plugin.zsh +++ /dev/null @@ -1,21 +0,0 @@ -function _cap_does_task_list_need_generating () { - if [ ! -f .cap_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .cap_tasks~) - changed=$(stat -f%m config/deploy.rb) - return $(expr $accurate '>=' $changed) - fi -} - -function _cap () { - if [ -f config/deploy.rb ]; then - if _cap_does_task_list_need_generating; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' -> .cap_tasks~ - fi - compadd `cat .cap_tasks~` - fi -} - -compctl -K _cap cap diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh deleted file mode 100644 index 38f1b396a..000000000 --- a/plugins/compleat/compleat.plugin.zsh +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: compleat.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.0 -# ------------------------------------------------------------------------------ - -if (( ${+commands[compleat]} )); then - local prefix="${commands[compleat]:h:h}" - local setup="${prefix}/share/compleat-1.0/compleat_setup" - - if [[ -f "$setup" ]]; then - if ! bashcompinit >/dev/null 2>&1; then - autoload -U bashcompinit - bashcompinit -i - fi - - source "$setup" - fi -fi diff --git a/plugins/cpanm/_cpanm b/plugins/cpanm/_cpanm deleted file mode 100644 index 58451d35a..000000000 --- a/plugins/cpanm/_cpanm +++ /dev/null @@ -1,67 +0,0 @@ -#compdef cpanm - -## -# cpanminus Z Shell completion script -## -# -# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011) -# -# The latest code is always located at: -# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm -# - -local arguments curcontext="$curcontext" -typeset -A opt_args - - -arguments=( - -# Commands -# '(--install -i)'{--install,-i}'[Installs the modules]' - '(- :)--self-upgrade[Upgrades itself]' - '(- :)--info[Displays distribution info on CPAN]' - '(--installdeps)--installdeps[Only install dependencies]' - '(--look)--look[Download/unpack the distribution and then open the directory with your shell]' - '(- :)'{--help,-h}'[Displays help information]' - '(- :)'{--version,-V}'[Displays software version]' - -# Options - {--force,-f}'[Force install]' - {--notest,-n}'[Do not run unit tests]' - {--sudo,-S}'[sudo to run install commands]' - '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]' - '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]' - {--local-lib,-l}'[Specify the install base to install modules]' - {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]' - '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls' - '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]' - '--prompt[Prompt when configure/build/test fails]' - '--reinstall[Reinstall the distribution even if you already have the latest version installed]' - '--interactive[Turn on interactive configure]' - - '--scandeps[Scan the depencencies of given modules and output the tree in a text format]' - '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)' - - '--save-dists[Specify the optional directory path to copy downloaded tarballs]' -# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]' - - '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]' - '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]' - '(--man-pages)--no-man-pages[Do not generate man pages]' - - - # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP, - # Wget, cURL and HTTP::Tiny (in that order) and uses the first one available. - # (So that the exclusions are not enabled here for the completion) - '(--lwp)--lwp[Use LWP module to download stuff]' - '(--wget)--wget[Use GNU Wget (if available) to download stuff]' - '(--curl)--curl[Use cURL (if available) to download stuff]' - -# Other completions - '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"' - # '*::args: _normal' # this looks for default files (any files) -) -_arguments -s $arguments \ - && return 0 - -return 1 diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh deleted file mode 100644 index 6a2b289a2..000000000 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/zsh -# -# Make the dirstack more persistant -# -# Add dirpersist to $plugins in ~/.zshrc to load -# - -# $zdirstore is the file used to persist the stack -zdirstore=~/.zdirstore - -dirpersistinstall () { - if grep 'dirpersiststore' ~/.zlogout > /dev/null; then - else - if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then - echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout - else - echo "If you don't want this message to appear, remove dirspersist from \$plugins" - fi - fi -} - -dirpersiststore () { - dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore -} - -dirpersistrestore () { - if [ -f $zdirstore ]; then - source $zdirstore - fi -} - -DIRSTACKSIZE=10 -setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups - -dirpersistinstall -dirpersistrestore - -# Make popd changes permanent without having to wait for logout -alias popd="popd;dirpersiststore" diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh deleted file mode 100644 index 1d72a2f2c..000000000 --- a/plugins/django/django.plugin.zsh +++ /dev/null @@ -1,222 +0,0 @@ -#compdef manage.py - -typeset -ga nul_args -nul_args=( - '--settings=-[the Python path to a settings module.]:file:_files' - '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' - '--traceback[print traceback on exception.]' - "--version[show program's version number and exit.]" - {-h,--help}'[show this help message and exit.]' -) - -_managepy-adminindex(){ - _arguments -s : \ - $nul_args \ - '*::directory:_directories' && ret=0 -} - -_managepy-createcachetable(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-dbshell(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-diffsettings(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-dumpdata(){ - _arguments -s : \ - '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \ - '--indent=-[specifies the indent level to use when pretty-printing output.]:' \ - $nul_args \ - '*::appname:_applist' && ret=0 -} - -_managepy-flush(){ - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - $nul_args && ret=0 -} - -_managepy-help(){ - _arguments -s : \ - '*:command:_managepy_cmds' \ - $nul_args && ret=0 -} - -_managepy_cmds(){ - local line - local -a cmd - _call_program help-command ./manage.py help \ - |& sed -n '/^ /s/[(), ]/ /gp' \ - | while read -A line; do cmd=($line $cmd) done - _describe -t managepy-command 'manage.py command' cmd -} - -_managepy-inspectdb(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-loaddata(){ - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '*::file:_files' \ - $nul_args && ret=0 -} - -_managepy-reset(){ - _arguments -s : \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - '*::appname:_applist' \ - $nul_args && ret=0 -} - -_managepy-runfcgi(){ - local state - - local fcgi_opts - fcgi_opts=( - 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)' - 'host[hostname to listen on..]:' - 'port[port to listen on.]:' - 'socket[UNIX socket to listen on.]::file:_files' - 'method[prefork or threaded (default prefork)]:method:(prefork threaded)' - 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:' - 'maxspare[max number of spare processes / threads.]:' - 'minspare[min number of spare processes / threads.]:' - 'maxchildren[hard limit number of processes / threads.]:' - 'daemonize[whether to detach from terminal.]:boolean:(False True)' - 'pidfile[write the spawned process-id to this file.]:file:_files' - 'workdir[change to this directory when daemonizing.]:directory:_files' - 'outlog[write stdout to this file.]:file:_files' - 'errlog[write stderr to this file.]:file:_files' - ) - - _arguments -s : \ - $nul_args \ - '*: :_values "FCGI Setting" $fcgi_opts' && ret=0 -} - -_managepy-runserver(){ - _arguments -s : \ - '--noreload[tells Django to NOT use the auto-reloader.]' \ - '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \ - $nul_args && ret=0 -} - -_managepy-shell(){ - _arguments -s : \ - '--plain[tells Django to use plain Python, not IPython.]' \ - $nul_args && ret=0 -} - -_managepy-sql(){} -_managepy-sqlall(){} -_managepy-sqlclear(){} -_managepy-sqlcustom(){} -_managepy-sqlflush(){} -_managepy-sqlindexes(){} -_managepy-sqlinitialdata(){} -_managepy-sqlreset(){} -_managepy-sqlsequencereset(){} -_managepy-startapp(){} - -_managepy-syncdb() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - $nul_args && ret=0 -} - -_managepy-test() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - '*::appname:_applist' \ - $nul_args && ret=0 -} - -_managepy-testserver() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--addrport=-[port number or ipaddr:port to run the server on.]' \ - '*::fixture:_files' \ - $nul_args && ret=0 -} - -_managepy-validate() { - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-commands() { - local -a commands - - commands=( - 'adminindex:prints the admin-index template snippet for the given app name(s).' - 'createcachetable:creates the table needed to use the SQL cache backend.' - 'dbshell:runs the command-line client for the current DATABASE_ENGINE.' - "diffsettings:displays differences between the current settings.py and Django's default settings." - 'dumpdata:Output the contents of the database as a fixture of the given format.' - 'flush:Executes ``sqlflush`` on the current database.' - 'help:manage.py help.' - 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.' - 'loaddata:Installs the named fixture(s) in the database.' - 'reset:Executes ``sqlreset`` for the given app(s) in the current database.' - 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,' - 'runserver:Starts a lightweight Web server for development.' - 'shell:Runs a Python interactive interpreter.' - 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).' - 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).' - 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).' - 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).' - 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.' - 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).' - "sqlinitialdata:RENAMED: see 'sqlcustom'" - 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).' - 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).' - "startapp:Creates a Django app directory structure for the given app name in this project's directory." - "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." - 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.' - 'testserver:Runs a development server with data from the given fixture(s).' - 'validate:Validates all installed models.' - ) - - _describe -t commands 'manage.py command' commands && ret=0 -} - -_applist() { - local line - local -a apps - _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\ - bn=op.basename(op.abspath(op.curdir));[sys\\ - .stdout.write(str(re.sub(r'^%s\.(.*?)$' % - bn, r'\1', i)) + '\n') for i in django.conf.settings.\\ - INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \ - | while read -A line; do apps=($line $apps) done - _values 'Application' $apps && ret=0 -} - -_managepy() { - local curcontext=$curcontext ret=1 - - if ((CURRENT == 2)); then - _managepy-commands - else - shift words - (( CURRENT -- )) - curcontext="${curcontext%:*:*}:managepy-$words[1]:" - _call_function ret _managepy-$words[1] - fi -} - -compdef _managepy manage.py -compdef _managepy django diff --git a/plugins/extract/_extract b/plugins/extract/_extract deleted file mode 100644 index dca890954..000000000 --- a/plugins/extract/_extract +++ /dev/null @@ -1,8 +0,0 @@ -#compdef extract -#autoload - -_arguments \ - '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 - - diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh deleted file mode 100644 index 8cc17f7d4..000000000 --- a/plugins/extract/extract.plugin.zsh +++ /dev/null @@ -1,85 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: extract.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.1 -# ------------------------------------------------------------------------------ - - -function extract() { - local remove_archive - local success - local file_name - local extract_dir - - if (( $# == 0 )); then - echo "Usage: extract [-option] [file ...]" - echo - echo Options: - echo " -r, --remove Remove archive." - echo - echo "Report bugs to ." - fi - - remove_archive=1 - if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 - shift - fi - - while (( $# > 0 )); do - if [[ ! -f "$1" ]]; then - echo "extract: '$1' is not a valid file" 1>&2 - shift - continue - fi - - success=0 - file_name="$( basename "$1" )" - extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )" - case "$1" in - (*.tar.gz|*.tgz) tar xvzf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ - && tar --xz -xvf "$1" \ - || xzcat "$1" | tar xvf - ;; - (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ - && tar --lzma -xvf "$1" \ - || lzcat "$1" | tar xvf - ;; - (*.tar) tar xvf "$1" ;; - (*.gz) gunzip "$1" ;; - (*.bz2) bunzip2 "$1" ;; - (*.xz) unxz "$1" ;; - (*.lzma) unlzma "$1" ;; - (*.Z) uncompress "$1" ;; - (*.zip) unzip "$1" -d $extract_dir ;; - (*.rar) unrar e -ad "$1" ;; - (*.7z) 7za x "$1" ;; - (*.deb) - mkdir -p "$extract_dir/control" - mkdir -p "$extract_dir/data" - cd "$extract_dir"; ar vx "../${1}" > /dev/null - cd control; tar xzvf ../control.tar.gz - cd ../data; tar xzvf ../data.tar.gz - cd ..; rm *.tar.gz debian-binary - cd .. - ;; - (*) - echo "extract: '$1' cannot be extracted" 1>&2 - success=1 - ;; - esac - - (( success = $success > 0 ? $success : $? )) - (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" - shift - done -} - -alias x=extract - -# add extract completion function to path -fpath=($ZSH/plugins/extract $fpath) -autoload -U compinit -compinit -i - diff --git a/plugins/gas/_gas b/plugins/gas/_gas deleted file mode 100644 index befdc9459..000000000 --- a/plugins/gas/_gas +++ /dev/null @@ -1,34 +0,0 @@ -#compdef gas - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '(-h|--help)'{-h,--help}'[show help information]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case $state in - cmds) - cmds=( - "version:Prints Gas's version" - "use:Uses author" - "show:Shows your current user" - "list:Lists your authors" - "import:Imports current user to gasconfig" - "help:Describe available tasks or one specific task" - "delete:Deletes author" - "add:Adds author to gasconfig" - ) - _describe -t commands 'gas command' cmds && ret=0 - ;; - args) - case $line[1] in - (use|delete) - _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 - ;; - esac - ;; -esac - -return ret diff --git a/plugins/gem/_gem b/plugins/gem/_gem deleted file mode 100644 index 83cba40d1..000000000 --- a/plugins/gem/_gem +++ /dev/null @@ -1,64 +0,0 @@ -#compdef gem -#autoload - -# gem zsh completion, based on homebrew completion - -_gem_installed() { - installed_gems=(`gem list --local --no-versions`) -} - -local -a _1st_arguments -_1st_arguments=( - 'cert:Manage RubyGems certificates and signing settings' - 'check:Check installed gems' - 'cleanup:Clean up old versions of installed gems in the local repository' - 'contents:Display the contents of the installed gems' - 'dependency:Show the dependencies of an installed gem' - 'environment:Display information about the RubyGems environment' - 'fetch:Download a gem and place it in the current directory' - 'generate_index:Generates the index files for a gem server directory' - 'help:Provide help on the `gem` command' - 'install:Install a gem into the local repository' - 'list:Display gems whose name starts with STRING' - 'lock:Generate a lockdown list of gems' - 'mirror:Mirror a gem repository' - 'outdated:Display all gems that need updates' - 'owner:Manage gem owners on RubyGems.org.' - 'pristine:Restores installed gems to pristine condition from files located in the gem cache' - 'push:Push a gem up to RubyGems.org' - 'query:Query gem information in local or remote repositories' - 'rdoc:Generates RDoc for pre-installed gems' - 'search:Display all gems whose name contains STRING' - 'server:Documentation and gem repository HTTP server' - 'sources:Manage the sources and cache file RubyGems uses to search for gems' - 'specification:Display gem specification (in yaml)' - 'stale:List gems along with access times' - 'uninstall:Uninstall gems from the local repository' - 'unpack:Unpack an installed gem to the current directory' - 'update:Update the named gems (or all installed gems) in the local repository' - 'which:Find the location of a library file you can require' -) - -local expl -local -a gems installed_gems - -_arguments \ - '(-v --version)'{-v,--version}'[show version]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "gem subcommand" _1st_arguments - return -fi - -case "$words[1]" in - list) - if [[ "$state" == forms ]]; then - _gem_installed - _requested installed_gems expl 'installed gems' compadd -a installed_gems - fi ;; - uninstall|update) - _gem_installed - _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;; -esac diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh deleted file mode 100644 index 270bcbe38..000000000 --- a/plugins/git-flow/git-flow.plugin.zsh +++ /dev/null @@ -1,332 +0,0 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - -_git-flow () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - ) - _describe -t commands 'git flow' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; - - (version) - ;; - - (hotfix) - __git-flow-hotfix - ;; - - (release) - __git-flow-release - ;; - - (feature) - __git-flow-feature - ;; - esac - ;; - esac -} - -__git-flow-release () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git flow release`)' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':version:__git_flow_version_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-hotfix () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':hotfix:__git_flow_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-feature () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new feature branch.' - 'finish:Finish a feature branch.' - 'list:List all your feature branches. (Alias to `git flow feature`)' - 'publish: public' - 'track: track' - 'diff: diff' - 'rebase: rebase' - 'checkout: checkout' - 'pull: pull' - ) - _describe -t commands 'git flow feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__git_flow_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; - - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git_flow_version_list () -{ - local expl - declare -a versions - - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted versions expl 'version' compadd $versions -} - -__git_flow_feature_list () -{ - local expl - declare -a features - - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted features expl 'feature' compadd $features -} - -__git_remotes () { - local expl gitdir remotes - - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return - - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return - - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi -} - -__git_flow_hotfix_list () -{ - local expl - declare -a hotfixes - - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'hotfix' compadd $hotfixes -} - -__git_branch_names () { - local expl - declare -a branch_names - - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - - _wanted branch-names expl branch-name compadd $* - $branch_names -} - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - -zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' \ No newline at end of file diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh deleted file mode 100644 index e59265d66..000000000 --- a/plugins/gnu-utils/gnu-utils.plugin.zsh +++ /dev/null @@ -1,80 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: gnu-utils.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.0 -# ------------------------------------------------------------------------------ - - -if [[ -x "${commands[gwhoami]}" ]]; then - __gnu_utils() { - emulate -L zsh - local gcmds - local gcmd - local cmd - local prefix - - # coreutils - gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod' - 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate' - 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand' - 'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid' - 'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum' - 'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc' - 'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd' - 'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum' - 'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort' - 'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest' - 'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname' - 'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho' - 'gwhoami' 'gyes') - - # Not part of coreutils, installed separately. - gcmds+=('gsed' 'gtar' 'gtime') - - for gcmd in "${gcmds[@]}"; do - # - # This method allows for builtin commands to be primary but it's - # lost if hash -r or rehash -f is executed. Thus, those two - # functions have to be wrapped. - # - (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]} - - # - # This method generates wrapper functions. - # It will override shell builtins. - # - # (( ${+commands[$gcmd]} )) && \ - # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }" - - # - # This method is inflexible since the aliases are at risk of being - # overriden resulting in the BSD coreutils being called. - # - # (( ${+commands[$gcmd]} )) && \ - # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}" - done - - return 0 - } - __gnu_utils; - - function hash() { - if [[ "$*" =~ "-(r|f)" ]]; then - builtin hash "$@" - __gnu_utils - else - builtin hash "$@" - fi - } - - function rehash() { - if [[ "$*" =~ "-f" ]]; then - builtin rehash "$@" - __gnu_utils - else - builtin rehash "$@" - fi - } -fi - diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh deleted file mode 100644 index 8cc71fd57..000000000 --- a/plugins/gpg-agent/gpg-agent.plugin.zsh +++ /dev/null @@ -1,26 +0,0 @@ -# Based on ssh-agent code - -local GPG_ENV=$HOME/.gnupg/gpg-agent.env - -function start_agent { - /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null - chmod 600 ${GPG_ENV} - . ${GPG_ENV} > /dev/null -} - -# Source GPG agent settings, if applicable -if [ -f "${GPG_ENV}" ]; then - . ${GPG_ENV} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { - start_agent; - } -else - start_agent; -fi - -export GPG_AGENT_INFO -export SSH_AUTH_SOCK -export SSH_AGENT_PID - -GPG_TTY=$(tty) -export GPG_TTY diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh deleted file mode 100644 index fc4c78c50..000000000 --- a/plugins/gradle/gradle.plugin.zsh +++ /dev/null @@ -1,119 +0,0 @@ -#!zsh -############################################################################## -# A descriptive listing of core Gradle commands -############################################################################ -function _gradle_core_commands() { - local ret=1 state - _arguments ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - "properties:Display all project properties" - "tasks:Calculate and display all tasks" - "dependencies:Calculate and display all dependencies" - "projects:Discover and display all sub-projects" - "build:Build the project" - "help:Display help" - ) - _describe -t subcommands 'gradle subcommands' subcommands && ret=0 - esac - - return ret -} - -function _gradle_arguments() { - _arguments -C \ - '-a[Do not rebuild project dependencies]' \ - '-h[Help]' \ - '-D[System property]' \ - '-d[Log at the debug level]' \ - '--gui[Launches the Gradle GUI app]' \ - '--stop[Stop the Gradle daemon]' \ - '--daemon[Use the Gradle daemon]' \ - '--no-daemon[Do not use the Gradle daemon]' \ - '--no-opt[Do not perform any task optimization]' \ - '-i[Log at the info level]' \ - '-m[Dry run]' \ - '-P[Set a project property]' \ - '--profile[Profile the build time]' \ - '-q[Log at the quiet level (only show errors)]' \ - '-v[Print the Gradle version info]' \ - '-x[Specify a task to be excluded]' \ - '*::command:->command' \ - && return 0 -} - - -############################################################################## -# Are we in a directory containing a build.gradle file? -############################################################################ -function in_gradle() { - if [[ -f build.gradle ]]; then - echo 1 - fi -} - -############################################################################ -# Define the stat_cmd command based on platform behavior -########################################################################## -stat -f%m . > /dev/null 2>&1 -if [ "$?" = 0 ]; then - stat_cmd=(stat -f%m) -else - stat_cmd=(stat -L --format=%Y) -fi - -############################################################################## Examine the build.gradle file to see if its -# timestamp has changed, and if so, regen -# the .gradle_tasks cache file -############################################################################ -_gradle_does_task_list_need_generating () { - if [ ! -f .gradletasknamecache ]; then return 0; - else - accurate=$($stat_cmd .gradletasknamecache) - changed=$($stat_cmd build.gradle) - return $(expr $accurate '>=' $changed) - fi -} - - -############################################################################## -# Discover the gradle tasks by running "gradle tasks --all" -############################################################################ -_gradle_tasks () { - if [ in_gradle ]; then - _gradle_arguments - if _gradle_does_task_list_need_generating; then - gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache - fi - compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache` - fi -} - -_gradlew_tasks () { - if [ in_gradle ]; then - _gradle_arguments - if _gradle_does_task_list_need_generating; then - gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache - fi - compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache` - fi -} - - -############################################################################## -# Register the completions against the gradle and gradlew commands -############################################################################ -compdef _gradle_tasks gradle -compdef _gradlew_tasks gradlew - - -############################################################################## -# Open questions for future improvements: -# 1) Should 'gradle tasks' use --all or just the regular set? -# 2) Should gradlew use the same approach as gradle? -# 3) Should only the " - " be replaced with a colon so it can work -# with the richer descriptive method of _arguments? -# gradle tasks | grep "^[a-zA-Z0-9]*\ -\ " | sed "s/ - /\:/" -############################################################################# diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh deleted file mode 100755 index cc6f9c53b..000000000 --- a/plugins/grails/grails.plugin.zsh +++ /dev/null @@ -1,54 +0,0 @@ -_enumerateGrailsScripts() { - # Default directoryies - directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts) - - # Check all of the plugins directories, if they exist - if [ -d plugins ] - then - directories+=(plugins/*/scripts) - fi - - # Enumerate all of the Groovy files - files=() - for dir in $directories; - do - if [ -d $dir ] - then - files+=($dir/[^_]*.groovy) - fi - done - - # Don't try to basename () - if [ ${#files} -eq 0 ]; - then - return - fi - - # - Strip the path - # - Remove all scripts with a leading '_' - # - PackagePlugin_.groovy -> PackagePlugin - # - PackagePlugin -> Package-Plugin - # - Package-Plugin -> package-plugin - basename $files \ - | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ - -e 's/([a-z])([A-Z])/\1-\2/g' \ - | tr "[:upper:]" "[:lower:]" \ - | sort \ - | uniq -} - -_grails() { - if (( CURRENT == 2 )); then - scripts=( $(_enumerateGrailsScripts) ) - - if [ ${#scripts} -ne 0 ]; - then - _multi_parts / scripts - return - fi - fi - - _files -} - -compdef _grails grails diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku deleted file mode 100644 index dc899e2b2..000000000 --- a/plugins/heroku/_heroku +++ /dev/null @@ -1,158 +0,0 @@ -#compdef heroku - -# Heroku Autocomplete plugin for Oh-My-Zsh -# Requires: The Heroku client gem (https://github.com/heroku/heroku) -# Author: Ali B. (http://awhitebox.com) - -local -a _1st_arguments -_1st_arguments=( - "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" - "addons":"list installed addons" - "addons\:list":"list all available addons" - "addons\:add":"install an addon" - "addons\:upgrade":"upgrade an existing addon" - "addons\:downgrade":"downgrade an existing addon" - "addons\:remove":"uninstall an addon" - "addons\:open":"open an addon's dashboard in your browser" - "apps":"list your apps" - "apps\:info":"show detailed app information" - "apps\:create":"create a new app" - "apps\:rename":"rename the app" - "apps\:open":"open the app in a web browser" - "apps\:destroy":"permanently destroy an app" - "auth\:login":"log in with your heroku credentials" - "auth\:logout":"clear local authentication credentials" - "config":"display the config vars for an app" - "config\:add":"add one or more config vars" - "config\:remove":"remove a config var" - "db\:push":"push local data up to your app" - "db\:pull":"pull heroku data down into your local database" - "domains":"list custom domains for an app" - "domains\:add":"add a custom domain to an app" - "domains\:remove":"remove a custom domain from an app" - "domains\:clear":"remove all custom domains from an app" - "help":"list available commands or display help for a specific command" - "keys":"display keys for the current user" - "keys\:add":"add a key for the current user" - "keys\:remove":"remove a key from the current user" - "keys\:clear":"remove all authentication keys from the current user" - "logs":"display recent log output" - "logs\:cron":"DEPRECATED: display cron logs from legacy logging" - "logs\:drains":"manage syslog drains" - "maintenance\:on":"put the app into maintenance mode" - "maintenance\:off":"take the app out of maintenance mode" - "pg\:info":"display database information" - "pg\:ingress":"allow direct connections to the database from this IP for one minute" - "pg\:promote":"sets DATABASE as your DATABASE_URL" - "pg\:psql":"open a psql shell to the database" - "pg\:reset":"delete all data in DATABASE" - "pg\:unfollow":"stop a replica from following and make it a read/write database" - "pg\:wait":"monitor database creation, exit when complete" - "pgbackups":"list captured backups" - "pgbackups\:url":"get a temporary URL for a backup" - "pgbackups\:capture":"capture a backup from a database id" - "pgbackups\:restore":"restore a backup to a database" - "pgbackups\:destroy":"destroys a backup" - "plugins":"list installed plugins" - "plugins\:install":"install a plugin" - "plugins\:uninstall":"uninstall a plugin" - "ps\:dynos":"scale to QTY web processes" - "ps\:workers":"scale to QTY background processes" - "ps":"list processes for an app" - "ps\:restart":"restart an app process" - "ps\:scale":"scale processes by the given amount" - "releases":"list releases" - "releases\:info":"view detailed information for a release" - "rollback":"roll back to an older release" - "run":"run an attached process" - "run\:rake":"remotely execute a rake command" - "run\:console":"open a remote console session" - "sharing":"list collaborators on an app" - "sharing\:add":"add a collaborator to an app" - "sharing\:remove":"remove a collaborator from an app" - "sharing\:transfer":"transfer an app to a new owner" - "ssl":"list certificates for an app" - "ssl\:add":"add an ssl certificate to an app" - "ssl\:remove":"remove an ssl certificate from an app" - "ssl\:clear":"remove all ssl certificates from an app" - "stack":"show the list of available stacks" - "stack\:migrate":"prepare migration of this app to a new stack" - "version":"show heroku client version" -) - -_arguments '*:: :->command' - -if (( CURRENT == 1 )); then - _describe -t commands "heroku command" _1st_arguments - return -fi - -local -a _command_args -case "$words[1]" in - apps:info) - _command_args=( - '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ - ) - ;; - apps:create) - _command_args=( - '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ - '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ - '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ - ) - ;; - config) - _command_args=( - '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ - ) - ;; - db:push) - _command_args=( - '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ - '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ - '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \ - '(-f|--filter)'{-f,--filter}'[only push certain tables]' \ - '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ - '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \ - ) - ;; - db:pull) - _command_args=( - '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ - '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ - '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \ - '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \ - '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ - '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \ - ) - ;; - keys) - _command_args=( - '(-l|--long)'{-l,--long}'[display extended information for each key]' \ - ) - ;; - logs) - _command_args=( - '(-n|--num)'{-n,--num}'[the number of lines to display]' \ - '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ - '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ - '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ - ) - ;; - pgbackups:capture) - _command_args=( - '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ - ) - ;; - stack) - _command_args=( - '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - '(--app)--app[the app name]' \ - && return 0 - diff --git a/plugins/history-substring-search/README b/plugins/history-substring-search/README deleted file mode 100644 index be11adf76..000000000 --- a/plugins/history-substring-search/README +++ /dev/null @@ -1,7 +0,0 @@ -To activate this script, load it into an interactive ZSH session: - - % source history-substring-search.zsh - -See the "history-substring-search.zsh" file for more information: - - % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh deleted file mode 100644 index 99a5922c5..000000000 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -# This file integrates the history-substring-search script into oh-my-zsh. - -source "$ZSH/plugins/history-substring-search/history-substring-search.zsh" - -if test "$CASE_SENSITIVE" = true; then - unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS -fi - -if test "$DISABLE_COLOR" = true; then - unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND -fi diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh deleted file mode 100644 index 53f707c79..000000000 --- a/plugins/history-substring-search/history-substring-search.zsh +++ /dev/null @@ -1,642 +0,0 @@ -#!/usr/bin/env zsh -# -# This is a clean-room implementation of the Fish[1] shell's history search -# feature, where you can type in any part of any previously entered command -# and press the UP and DOWN arrow keys to cycle through the matching commands. -# -#----------------------------------------------------------------------------- -# Usage -#----------------------------------------------------------------------------- -# -# 1. Load this script into your interactive ZSH session: -# -# % source history-substring-search.zsh -# -# If you want to use the zsh-syntax-highlighting[6] script along with this -# script, then make sure that you load it *before* you load this script: -# -# % source zsh-syntax-highlighting.zsh -# % source history-substring-search.zsh -# -# 2. Type any part of any previous command and then: -# -# * Press the UP arrow key to select the nearest command that (1) contains -# your query and (2) is older than the current command in the command -# history. -# -# * Press the DOWN arrow key to select the nearest command that (1) -# contains your query and (2) is newer than the current command in the -# command history. -# -# * Press ^U (the Control and U keys simultaneously) to abort the search. -# -# 3. If a matching command spans more than one line of text, press the LEFT -# arrow key to move the cursor away from the end of the command, and then: -# -# * Press the UP arrow key to move the cursor to the line above. When the -# cursor reaches the first line of the command, pressing the UP arrow -# key again will cause this script to perform another search. -# -# * Press the DOWN arrow key to move the cursor to the line below. When -# the cursor reaches the last line of the command, pressing the DOWN -# arrow key again will cause this script to perform another search. -# -#----------------------------------------------------------------------------- -# Configuration -#----------------------------------------------------------------------------- -# -# This script defines the following global variables. You may override their -# default values only after having loaded this script into your ZSH session. -# -# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND is a global variable that defines -# how the query should be highlighted inside a matching command. Its default -# value causes this script to highlight using bold, white text on a magenta -# background. See the "Character Highlighting" section in the zshzle(1) man -# page to learn about the kinds of values you may assign to this variable. -# -# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND is a global variable that -# defines how the query should be highlighted when no commands in the -# history match it. Its default value causes this script to highlight using -# bold, white text on a red background. See the "Character Highlighting" -# section in the zshzle(1) man page to learn about the kinds of values you -# may assign to this variable. -# -# * HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS is a global variable that defines -# how the command history will be searched for your query. Its default value -# causes this script to perform a case-insensitive search. See the "Globbing -# Flags" section in the zshexpn(1) man page to learn about the kinds of -# values you may assign to this variable. -# -#----------------------------------------------------------------------------- -# History -#----------------------------------------------------------------------------- -# -# This script was originally written by Peter Stephenson[2], who published it -# to the ZSH users mailing list (thereby making it public domain) in September -# 2009. It was later revised by Guido van Steen and released under the BSD -# license (see below) as part of the fizsh[3] project in January 2011. -# -# It was later extracted from fizsh[3] release 1.0.1, refactored heavily, and -# repackaged as both an oh-my-zsh plugin[4] and as an independently loadable -# ZSH script[5] by Suraj N. Kurapati in 2011. -# -# It was further developed[4] by Guido van Steen, Suraj N. Kurapati, Sorin -# Ionescu, and Vincent Guerci in 2011. -# -# [1]: http://fishshell.com -# [2]: http://www.zsh.org/mla/users/2009/msg00818.html -# [3]: http://sourceforge.net/projects/fizsh/ -# [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 -# [5]: https://github.com/sunaku/zsh-history-substring-search -# [6]: https://github.com/nicoulaj/zsh-syntax-highlighting -# -############################################################################## -# -# Copyright (c) 2009 Peter Stephenson -# Copyright (c) 2011 Guido van Steen -# Copyright (c) 2011 Suraj N. Kurapati -# Copyright (c) 2011 Sorin Ionescu -# Copyright (c) 2011 Vincent Guerci -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# * Neither the name of the FIZSH nor the names of its contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################## - -#----------------------------------------------------------------------------- -# configuration variables -#----------------------------------------------------------------------------- - -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' -HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' - -#----------------------------------------------------------------------------- -# the main ZLE widgets -#----------------------------------------------------------------------------- - -function history-substring-search-up() { - _history-substring-search-begin - - _history-substring-search-up-history || - _history-substring-search-up-buffer || - _history-substring-search-up-search - - _history-substring-search-end -} - -function history-substring-search-down() { - _history-substring-search-begin - - _history-substring-search-down-history || - _history-substring-search-down-buffer || - _history-substring-search-down-search - - _history-substring-search-end -} - -zle -N history-substring-search-up -zle -N history-substring-search-down - -bindkey '\e[A' history-substring-search-up -bindkey '\e[B' history-substring-search-down - -#----------------------------------------------------------------------------- -# implementation details -#----------------------------------------------------------------------------- - -setopt extendedglob -zmodload -F zsh/parameter - -# -# We have to "override" some keys and widgets if the -# zsh-syntax-highlighting plugin has not been loaded: -# -# https://github.com/nicoulaj/zsh-syntax-highlighting -# -if [[ $+functions[_zsh_highlight] -eq 0 ]]; then - # - # Dummy implementation of _zsh_highlight() - # that simply removes existing highlights - # - function _zsh_highlight() { - region_highlight=() - } - - # - # Remove existing highlights when the user - # inserts printable characters into $BUFFER - # - function ordinary-key-press() { - if [[ $KEYS == [[:print:]] ]]; then - region_highlight=() - fi - zle .self-insert - } - zle -N self-insert ordinary-key-press - - # - # Override ZLE widgets to invoke _zsh_highlight() - # - # https://github.com/nicoulaj/zsh-syntax-highlighting/blob/ - # bb7fcb79fad797a40077bebaf6f4e4a93c9d8163/zsh-syntax-highlighting.zsh#L121 - # - #--------------8<-------------------8<-------------------8<----------------- - # - # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are - # met: - # - # * Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # - # * Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # - # * Neither the name of the zsh-syntax-highlighting contributors nor the - # names of its contributors may be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - # Load ZSH module zsh/zleparameter, needed to override user defined widgets. - zmodload zsh/zleparameter 2>/dev/null || { - echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter, exiting.' >&2 - return -1 - } - - # Override ZLE widgets to make them invoke _zsh_highlight. - for event in ${${(f)"$(zle -la)"}:#(_*|orig-*|.run-help|.which-command)}; do - if [[ "$widgets[$event]" == completion:* ]]; then - eval "zle -C orig-$event ${${${widgets[$event]}#*:}/:/ } ; $event() { builtin zle orig-$event && _zsh_highlight } ; zle -N $event" - else - case $event in - accept-and-menu-complete) - eval "$event() { builtin zle .$event && _zsh_highlight } ; zle -N $event" - ;; - - # The following widgets should NOT remove any previously - # applied highlighting. Therefore we do not remap them. - .forward-char|.backward-char|.up-line-or-history|.down-line-or-history) - ;; - - .*) - clean_event=$event[2,${#event}] # Remove the leading dot in the event name - case ${widgets[$clean_event]-} in - (completion|user):*) - ;; - *) - eval "$clean_event() { builtin zle $event && _zsh_highlight } ; zle -N $clean_event" - ;; - esac - ;; - *) - ;; - esac - fi - done - unset event clean_event - #-------------->8------------------->8------------------->8----------------- -fi - -function _history-substring-search-begin() { - _history_substring_search_move_cursor_eol=false - _history_substring_search_query_highlight= - - # - # Continue using the previous $_history_substring_search_result by default, - # unless the current query was cleared or a new/different query was entered. - # - if [[ -z $BUFFER || $BUFFER != $_history_substring_search_result ]]; then - # - # For the purpose of highlighting we will also keep - # a version without doubly-escaped meta characters. - # - _history_substring_search_query=$BUFFER - - # - # $BUFFER contains the text that is in the command-line currently. - # we put an extra "\\" before meta characters such as "\(" and "\)", - # so that they become "\\\(" and "\\\)". - # - _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH} - - # - # Find all occurrences of the search query in the history file. - # - # (k) turns it an array of line numbers. - # - # (on) seems to remove duplicates, which are default - # options. They can be turned off by (ON). - # - _history_substring_search_matches=(${(kon)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)*${_history_substring_search_query_escaped}*]}) - - # - # Define the range of values that $_history_substring_search_match_index - # can take: [0, $_history_substring_search_matches_count_plus]. - # - _history_substring_search_matches_count=$#_history_substring_search_matches - _history_substring_search_matches_count_plus=$(( _history_substring_search_matches_count + 1 )) - _history_substring_search_matches_count_sans=$(( _history_substring_search_matches_count - 1 )) - - # - # If $_history_substring_search_match_index is equal to - # $_history_substring_search_matches_count_plus, this indicates that we - # are beyond the beginning of $_history_substring_search_matches. - # - # If $_history_substring_search_match_index is equal to 0, this indicates - # that we are beyond the end of $_history_substring_search_matches. - # - # If we have initially pressed "up" we have to initialize - # $_history_substring_search_match_index to - # $_history_substring_search_matches_count_plus so that it will be - # decreased to $_history_substring_search_matches_count. - # - # If we have initially pressed "down" we have to initialize - # $_history_substring_search_match_index to - # $_history_substring_search_matches_count so that it will be increased to - # $_history_substring_search_matches_count_plus. - # - if [[ $WIDGET == history-substring-search-down ]]; then - _history_substring_search_match_index=$_history_substring_search_matches_count - else - _history_substring_search_match_index=$_history_substring_search_matches_count_plus - fi - fi -} - -function _history-substring-search-end() { - _history_substring_search_result=$BUFFER - - # move the cursor to the end of the command line - if [[ $_history_substring_search_move_cursor_eol == true ]]; then - CURSOR=${#BUFFER} - fi - - # highlight command line using zsh-syntax-highlighting - _zsh_highlight - - # highlight the search query inside the command line - if [[ -n $_history_substring_search_query_highlight && -n $_history_substring_search_query ]]; then - # - # The following expression yields a variable $MBEGIN, which - # indicates the begin position + 1 of the first occurrence - # of _history_substring_search_query_escaped in $BUFFER. - # - : ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($_history_substring_search_query##)} - local begin=$(( MBEGIN - 1 )) - local end=$(( begin + $#_history_substring_search_query )) - region_highlight+=("$begin $end $_history_substring_search_query_highlight") - fi - - # For debugging purposes: - # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY - - # Exit successfully from the history-substring-search-* widgets. - true -} - -function _history-substring-search-up-buffer() { - # - # Check if the UP arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the first line of the current multi-line buffer. - # If so, pressing UP would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $LBUFFER, which makes - # sure that xlbuflines is always equal to the number of lines - # until $CURSOR (including the line with the cursor on it). - # - local buflines XLBUFFER xlbuflines - buflines=(${(f)BUFFER}) - XLBUFFER=$LBUFFER"x" - xlbuflines=(${(f)XLBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then - zle up-line-or-history - return true - fi - - false -} - -function _history-substring-search-down-buffer() { - # - # Check if the DOWN arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the last line of the current multi-line buffer. - # If so, pressing DOWN would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $RBUFFER, which makes - # sure that xrbuflines is always equal to the number of lines - # from $CURSOR (including the line with the cursor on it). - # - local buflines XRBUFFER xrbuflines - buflines=(${(f)BUFFER}) - XRBUFFER="x"$RBUFFER - xrbuflines=(${(f)XRBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then - zle down-line-or-history - return true - fi - - false -} - -function _history-substring-search-up-history() { - # - # Behave like up in ZSH, except clear the $BUFFER - # when beginning of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # we have reached the absolute top of history - if [[ $HISTNO -eq 1 ]]; then - BUFFER= - - # going up from somewhere below the top of history - else - zle up-history - fi - - return true - fi - - false -} - -function _history-substring-search-down-history() { - # - # Behave like down-history in ZSH, except clear the - # $BUFFER when end of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # going down from the absolute top of history - if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then - BUFFER=${history[1]} - _history_substring_search_move_cursor_eol=true - - # going down from somewhere above the bottom of history - else - zle down-history - fi - - return true - fi - - false -} - -function _history-substring-search-up-search() { - _history_substring_search_move_cursor_eol=true - - # - # Highlight matches during history-substring-up-search: - # - # The following constants have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches - # $_history_substring_search_matches_count is the current number of matches - # $_history_substring_search_matches_count_plus is the current number of matches + 1 - # $_history_substring_search_matches_count_sans is the current number of matches - 1 - # $_history_substring_search_match_index is the index of the current match - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 - # indicates that we are beyond the end of - # $_history_substring_search_matches. A value of - # $_history_substring_search_matches_count_plus indicates that we are beyond - # the beginning of $_history_substring_search_matches. - # - # In _history-substring-search-up-search() the initial value of - # $_history_substring_search_match_index is - # $_history_substring_search_matches_count_plus. This value is set in - # _history-substring-search-begin(). _history-substring-search-up-search() - # will initially decrease it to $_history_substring_search_matches_count. - # - if [[ $_history_substring_search_match_index -ge 2 ]]; then - # - # Highlight the next match: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - - elif [[ $_history_substring_search_match_index -eq 1 ]]; then - # - # We will move beyond the end of $_history_substring_search_matches: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Save the current buffer in $_history_substring_search_old_buffer, - # so that it can be retrieved by - # _history-substring-search-down-search() later. - # - # 3. Make $BUFFER equal to $_history_substring_search_query. - # - # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - _history_substring_search_old_buffer=$BUFFER - BUFFER=$_history_substring_search_query - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - - elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count_plus ]]; then - # - # We were beyond the beginning of $_history_substring_search_matches but - # UP makes us move back to $_history_substring_search_matches: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Restore $BUFFER from $_history_substring_search_old_buffer. - # - # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - BUFFER=$_history_substring_search_old_buffer - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - fi -} - -function _history-substring-search-down-search() { - _history_substring_search_move_cursor_eol=true - - # - # Highlight matches during history-substring-up-search: - # - # The following constants have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches - # $_history_substring_search_matches_count is the current number of matches - # $_history_substring_search_matches_count_plus is the current number of matches + 1 - # $_history_substring_search_matches_count_sans is the current number of matches - 1 - # $_history_substring_search_match_index is the index of the current match - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 - # indicates that we are beyond the end of - # $_history_substring_search_matches. A value of - # $_history_substring_search_matches_count_plus indicates that we are beyond - # the beginning of $_history_substring_search_matches. - # - # In _history-substring-search-down-search() the initial value of - # $_history_substring_search_match_index is - # $_history_substring_search_matches_count. This value is set in - # _history-substring-search-begin(). - # _history-substring-search-down-search() will initially increase it to - # $_history_substring_search_matches_count_plus. - # - if [[ $_history_substring_search_match_index -le $_history_substring_search_matches_count_sans ]]; then - # - # Highlight the next match: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - - elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count ]]; then - # - # We will move beyond the beginning of $_history_substring_search_matches: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Save the current buffer in $_history_substring_search_old_buffer, so - # that it can be retrieved by _history-substring-search-up-search() - # later. - # - # 3. Make $BUFFER equal to $_history_substring_search_query. - # - # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - _history_substring_search_old_buffer=$BUFFER - BUFFER=$_history_substring_search_query - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - - elif [[ $_history_substring_search_match_index -eq 0 ]]; then - # - # We were beyond the end of $_history_substring_search_matches but DOWN - # makes us move back to the $_history_substring_search_matches: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Restore $BUFFER from $_history_substring_search_old_buffer. - # - # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - BUFFER=$_history_substring_search_old_buffer - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - fi -} - -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et diff --git a/plugins/kate/kate.plugin.zsh b/plugins/kate/kate.plugin.zsh deleted file mode 100644 index eb16522ac..000000000 --- a/plugins/kate/kate.plugin.zsh +++ /dev/null @@ -1,9 +0,0 @@ - -# Kate -# Start kate always silent -alias kate='kate >/dev/null 2>&1' - -function kt () { - cd $1 - kate $1 -} \ No newline at end of file diff --git a/plugins/knife/_knife b/plugins/knife/_knife deleted file mode 100644 index 7f8c95ee5..000000000 --- a/plugins/knife/_knife +++ /dev/null @@ -1,174 +0,0 @@ -#compdef knife - -# 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 ) - -# knife has a very special syntax, some example calls are: -# knife status -# knife cookbook list -# knife role show ROLENAME -# knife data bag show DATABAGNAME -# knife role show ROLENAME --attribute ATTRIBUTENAME -# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes - -# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces -_knife() { - local curcontext="$curcontext" state line - typeset -A opt_args - cloudproviders=(bluebox ec2 rackspace slicehost terremark) - _arguments \ - '1: :->knifecmd'\ - '2: :->knifesubcmd'\ - '3: :->knifesubcmd2' \ - '4: :->knifesubcmd3' \ - '5: :->knifesubcmd4' \ - '6: :->knifesubcmd5' - - case $state in - knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders - ;; - knifesubcmd) - case $words[2] in - (bluebox|ec2|rackspace|slicehost|terremark) - compadd "$@" server images - ;; - client) - compadd -Q "$@" "bulk delete" list create show delete edit reregister - ;; - configure) - compadd "$@" client - ;; - cookbook) - compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload - ;; - node) - compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" - ;; - recipe) - compadd "$@" list - ;; - role) - compadd -Q "$@" "bulk delete" create delete edit "from file" list show - ;; - windows) - compadd "$@" bootstrap - ;; - *) - _arguments '2:Subsubcommands:($(_knife_options1))' - esac - ;; - knifesubcmd2) - case $words[3] in - server) - compadd "$@" list create delete - ;; - images) - compadd "$@" list - ;; - site) - compadd "$@" vendor show share search download list unshare - ;; - (show|delete|edit) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))' - ;; - (upload|test) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - bag) - compadd -Q "$@" show edit list "from file" create delete - ;; - *) - _arguments '3:Subsubcommands:($(_knife_options2))' - esac - ;; - knifesubcmd3) - case $words[3] in - show) - case $words[2] in - cookbook) - versioncomp=1 - _arguments '4:Cookbookversions:($(_cookbook_versions) latest)' - ;; - (node|client|role) - compadd "$@" --attribute - esac - esac - case $words[4] in - (show|edit) - _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))' - ;; - file) - _arguments '*:file or directory:_files -g "*.(rb|json)"' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - *) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac - ;; - knifesubcmd4) - if (( versioncomp > 0 )); then - compadd "$@" attributes definitions files libraries providers recipes resources templates - else - _arguments '*:Subsubcommands:($(_knife_options2))' - fi - ;; - knifesubcmd5) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac -} - -# Helper functions to provide the argument completion for several depths of commands -_knife_options1() { - ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options2() { - ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options3() { - ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -# The chef_x_remote functions use knife to get a list of objects of type x on the server -_chef_roles_remote() { - (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_clients_remote() { - (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_nodes_remote() { - (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_cookbooks_remote() { - (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_sitecookbooks_remote() { - (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_data_bags_remote() { - (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server -_chef_cookbooks_local() { - (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done) -} - -# This function extracts the available cookbook versions on the chef server -_cookbook_versions() { - (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g') -} - -_knife "$@" diff --git a/plugins/lein/lein.plugin.zsh b/plugins/lein/lein.plugin.zsh deleted file mode 100644 index 19af3556a..000000000 --- a/plugins/lein/lein.plugin.zsh +++ /dev/null @@ -1,27 +0,0 @@ -function _lein_commands() { - local ret=1 state - _arguments ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - "clean:remove compiled files and dependencies from project" - "compile:ahead-of-time compile the project" - "deps:download and install all dependencies" - "help:display a list of tasks or help for a given task" - "install:install the project and its dependencies in your local repository" - "jar:create a jar file containing the compiled .class files" - "new:create a new project skeleton" - "pom:write a pom.xml file to disk for maven interop" - "test:run the project's tests" - "uberjar:Create a jar including the contents of each of deps" - "upgrade:upgrade leiningen to the latest stable release" - "version:print leiningen's version" - ) - _describe -t subcommands 'leiningen subcommands' subcommands && ret=0 - esac - - return ret -} - -compdef _lein_commands lein diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh deleted file mode 100644 index 7661c6add..000000000 --- a/plugins/lighthouse/lighthouse.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: http://screencast.com/t/ZDgwNDUwNT -open_lighthouse_ticket () { - if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse-url file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - `open $lighthouse_url/tickets/$1`; - fi -} - -alias lho='open_lighthouse_ticket' diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh deleted file mode 100644 index e455527e7..000000000 --- a/plugins/lol/lol.plugin.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# LOL!!1 -# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh - -alias wtf='dmesg' -alias onoz='cat /var/log/errors.log' -alias rtfm='man' - -alias visible='echo' -alias invisible='cat' -alias moar='more' -alias tldr='less' -alias alwayz='tail -f' - -alias icanhas='mkdir' -alias gimmeh='touch' -alias donotwant='rm' -alias dowant='cp' -alias gtfo='mv' -alias nowai='chmod' - -alias hai='cd' -alias iz='ls' -alias plz='pwd' -alias ihasbucket='df -h' - -alias inur='locate' -alias iminurbase='finger' - -alias btw='nice' -alias obtw='nohup' - -alias nomz='ps -aux' -alias nomnom='killall' - -alias byes='exit' -alias cya='reboot' -alias kthxbai='halt' diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh deleted file mode 100644 index 2988f0a46..000000000 --- a/plugins/mercurial/mercurial.plugin.zsh +++ /dev/null @@ -1,14 +0,0 @@ - -# Mercurial -alias hgc='hg commit -v' -alias hgb='hg branch -v' -alias hgba='hg branches' -alias hgco='hg checkout' -alias hgd='hg diff' -alias hged='hg diffmerge' -# pull and update -alias hgl='hg pull -u -v' -alias hgp='hg push -v' -alias hgs='hg status -v' -# this is the 'git commit --amend' equivalent -alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh deleted file mode 100644 index 519bc18da..000000000 --- a/plugins/node/node.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Open the node api for your current version to the optional section. -# TODO: Make the section part easier to use. -function node-docs { - open "http://nodejs.org/docs/$(node --version)/api/all.html#$1" -} diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh deleted file mode 100644 index c3eb91d31..000000000 --- a/plugins/npm/npm.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -eval "$(npm completion 2>/dev/null)" diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh deleted file mode 100644 index f94c4195d..000000000 --- a/plugins/perl/perl.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# https://github.com/dbbolton -# -# Below are some useful Perl-related aliases/functions that I use with zsh. - - -# Aliases ################################################################### - -# perlbrew ######## -alias pbi='perlbrew install' -alias pbl='perlbrew list' -alias pbo='perlbrew off' -alias pbs='perlbrew switch' -alias pbu='perlbrew use' - -# Perl ############ - -# perldoc` -alias pd='perldoc' - -# use perl like awk/sed -alias ple='perl -wlne' - -# show the latest stable release of Perl -alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' - - - -# Functions ################################################################# - -# newpl - creates a basic Perl script file and opens it with $EDITOR -newpl () { - # set $EDITOR to 'vim' if it is undefined - [[ -z $EDITOR ]] && EDITOR=vim - - # if the file exists, just open it - [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 - - # if it doesn't, make it, and open it - [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ - "\n\n" > $1 && $EDITOR $1 -} - - -# pgs - Perl Global Substitution -# find pattern = 1st arg -# replace pattern = 2nd arg -# filename = 3rd arg -pgs() { # [find] [replace] [filename] - perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3" -} - - -# Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. -prep() { # [pattern] [filename unless STDOUT] - perl -nle 'print if /'"$1"'/;' $2 -} - -# say - append a newline to 'print' -say() { - print "$1\n" -} - diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh deleted file mode 100644 index 8f4adca08..000000000 --- a/plugins/phing/phing.plugin.zsh +++ /dev/null @@ -1,19 +0,0 @@ -_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 -} - -_phing () { - if [ -f build.xml ]; then - if _phing_does_target_list_need_generating; then - phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets - fi - compadd `cat .phing_targets` - fi -} - -compdef _phing phing diff --git a/plugins/pip/_pip b/plugins/pip/_pip deleted file mode 100644 index b58010173..000000000 --- a/plugins/pip/_pip +++ /dev/null @@ -1,46 +0,0 @@ -#compdef pip -#autoload - -# pip zsh completion, based on homebrew completion - -_pip_installed() { - installed_pkgs=(`pip freeze`) -} - -local -a _1st_arguments -_1st_arguments=( - 'bundle:Create pybundles (archives containing multiple packages)' - 'freeze:Output all currently installed packages (exact versions) to stdout' - 'help:Show available commands' - 'install:Install packages' - 'search:Search PyPI' - 'uninstall:Uninstall packages' - 'unzip:Unzip individual packages' - 'zip:Zip individual packages' -) - -local expl -local -a pkgs installed_pkgs - -_arguments \ - '(--version)--version[Show version number of program and exit]' \ - '(-v --verbose)'{-v,--verbose}'[Give more output]' \ - '(-q --quiet)'{-q,--quiet}'[Give less output]' \ - '(-h --help)'{-h,--help}'[Show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "pip subcommand" _1st_arguments - return -fi - -case "$words[1]" in - list) - if [[ "$state" == forms ]]; then - _pip_installed - _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs - fi ;; - uninstall) - _pip_installed - _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;; -esac diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh deleted file mode 100644 index 6b2a6f2be..000000000 --- a/plugins/pow/pow.plugin.zsh +++ /dev/null @@ -1,10 +0,0 @@ -# Thanks to Christopher Sexton -# https://gist.github.com/965032 -function kapow { - touch ~/.pow/$1/tmp/restart.txt - if [ $? -eq 0 ]; then - echo "$fg[yellow]Pow restarting $1...$reset_color" - fi -} - -compctl -W ~/.pow -/ kapow diff --git a/plugins/powder/_powder b/plugins/powder/_powder deleted file mode 100644 index 84e260a15..000000000 --- a/plugins/powder/_powder +++ /dev/null @@ -1,4 +0,0 @@ -#compdef powder -#autoload - -compadd `powder help | grep powder | cut -d " " -f 4` diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh deleted file mode 100644 index 3ea34d718..000000000 --- a/plugins/python/python.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Find python file -alias pyfind='find . -name "*.py"' - -# Remove python compiled byte-code -alias pyclean='find . -type f -name "*.py[co]" -exec rm -f \{\} \;' diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh deleted file mode 100644 index ac8119e83..000000000 --- a/plugins/rails/rails.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -alias ss='thin --stats "/thin/stats" start' -alias sg='ruby script/generate' -alias sd='ruby script/destroy' -alias sp='ruby script/plugin' -alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias sc='ruby script/console' -alias sd='ruby script/server --debugger' -alias devlog='tail -f log/development.log' - -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh deleted file mode 100644 index f4ee637e6..000000000 --- a/plugins/rails3/rails3.plugin.zsh +++ /dev/null @@ -1,19 +0,0 @@ -# Rails 3 aliases, backwards-compatible with Rails 2. - -function _rails_command () { - if [ -e "script/server" ]; then - ruby script/$@ - else - ruby script/rails $@ - fi -} - -alias rc='_rails_command console' -alias rd='_rails_command destroy' -alias rdb='_rails_command dbconsole' -alias rdbm='rake db:migrate db:test:clone' -alias rg='_rails_command generate' -alias rp='_rails_command plugin' -alias rs='_rails_command server' -alias rsd='_rails_command server --debugger' -alias devlog='tail -f log/development.log' diff --git a/plugins/redis-cli/_redis-cli b/plugins/redis-cli/_redis-cli deleted file mode 100644 index 1569f2916..000000000 --- a/plugins/redis-cli/_redis-cli +++ /dev/null @@ -1,142 +0,0 @@ -#compdef redis-cli rec -#autoload - -#redis cli completion, based off homebrew completion (ref. 2011-04-14) - -local -a _1st_arguments -_1st_arguments=( - 'append:append a value to a key' - 'auth:authenticate to the server' - 'bgrewriteeaof:asynchronously rewrite the append-only file' - 'bgsave:asynchornously save the dataset to disk' - 'blpop:remove and get the first element in a list, or block until one is available' - 'brpop:remove and get the last element in a list, or block until one is available' - 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available' - # 'config get:get the value of a configuration parameter' - # 'config set:set a configuration parameter to the given value' - # 'config resetstat: reset the stats returned by INFO' - 'dbsize:return the number of keys in the selected database' - # 'debug object:get debugging information about a key' - # 'debug setgfault:make the server crash' - 'decr:decrement the integer value of a key by one' - 'decrby:decrement the integet value of a key by the given number' - 'del:delete a key' - 'discard:discard all commands issued after MULTI' - 'echo:echo the given string' - 'exec:execute all commands issued after a MULTI' - 'exists:determine if a key exists' - 'expire:set the time to live for a key, in seconds' - 'expireat:set the expiration for a key as a UNIX timestamp' - 'flushall:remove all keys from all databases' - 'flushdb:remove all keys from the current database' - 'get:get the value of a key' - 'getbit:returns the bit value at offset in the string value stored at key' - 'getrange:get a substring of the string stored at a key' - 'getset:set the string value of a key and return its old value' - 'hdel:delete a hash field' - 'hexists:determine if a hash field exists' - 'hget:get the value of a hash field' - 'hgetall:get all the fields and values in a hash' - 'hincrby:increment the integer value of a hash field by the given number' - 'hkeys:get all the fields in a hash' - 'hlen:get the number of fields in a hash' - 'hmget:get the values of all the given hash fields' - 'hmset:set multiple hash fields to multiple values' - 'hset:set the string value of a hash field' - 'hsetnx:set the value of a hash field, only if the field does not exist' - 'hvals:get all the values in a hash' - 'incr:increment the integer value of a key by one' - 'incrby:increment the integer value of a key by the given number' - 'info:get information and statistics about the server' - 'keys:find all keys matching the given pattern' - 'lastsave:get the UNIX timestamp of the last successful save to disk' - 'lindex:get an element from a list by its index' - 'linsert:insert an element before or after another element in a list' - 'llen:get the length of a list' - 'lpop:remove and get the first element in a list' - 'lpush:prepend a value to a list' - 'lpushx:prepend a value to a list, only if the list exists' - 'lrange:get a range of elements from a list' - 'lrem:remove elements from a list' - 'lset:set the value of an element in a list by its index' - 'ltrim:trim a list to the specified range' - 'mget:get the values of all the given keys' - 'monitor:listen for all requests received by the server in real time' - 'move:move a key to another database' - 'mset:set multiple keys to muliple values' - 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist' - 'multi:mark the start of a transaction block' - 'object:inspect the internals of Redis objects' - 'persist:remove the expiration from a key' - 'ping:ping the server' - 'psubscribe:listen for messages published to channels matching the given patterns' - 'publish:post a message to a channel' - 'punsubscribe:stop listening for messages posted to channels matching the given patterns' - 'quit:close the connection' - 'randomkey:return a random key from the keyspace' - 'rename:rename a key' - 'renamenx:rename a key, only if the new key does not exist' - 'rpop:remove and get the last element in a list' - 'rpoplpush:remove the last element in a list, append it to another list and return it' - 'rpush:append a value to a list' - 'rpushx:append a value to a list, only if the list exists' - 'sadd:add a member to a set' - 'save:synchronously save the dataset to disk' - 'scard:get the number of members in a set' - 'sdiff:subtract multiple sets' - 'sdiffstore:subtract multiple sets and store the resulting set in a key' - 'select:change the selected database for the current connection' - 'set:set the string value of a key' - 'setbit:sets or clears the bit at offset in the string value stored at key' - 'setex:set the value and expiration of a key' - 'setnx:set the value of a key, only if the key does not exist' - 'setrange:overwrite part of a string at key starting at the specified offset' - 'shutdown:synchronously save the dataset to disk and then shut down the server' - 'sinter:intersect multiple sets' - 'sinterstore:intersect multiple sets and store the resulting set in a key' - 'sismember:determine if a given value is a member of a set' - 'slaveof:make the server a slave of another instance, or promote it as master' - 'smembers:get all the members in a set' - 'smove:move a member from one set to another' - 'sort:sort the elements in a list, set or sorted set' - 'spop:remove and return a random member from a set' - 'srandmember:get a random member from a set' - 'srem:remove a member from a set' - 'strlen:get the length of the value stored in a key' - 'subscribe:listen for messages published to the given channels' - 'sunion:add multiple sets' - 'sunionstore:add multiple sets and store the resulting set in a key' - 'ttl:get the time to live for a key' - 'type:determine the type stored at key' - 'unsubscribe:stop listening for messages posted to the given channels' - 'unwatch:forget about all watched keys' - 'watch:watch the given keys to determine execution of the MULTI/EXEC block' - 'zadd:add a member to a sorted set, or update its score if it already exists' - 'zcard:get the number of members in a sorted set' - 'zcount:count the members in a sorted set with scores within the given values' - 'zincrby:increment the score of a member in a sorted set' - 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key' - 'zrange:return a range of members in a sorted set, by index' - 'zrangebyscore:return a range of members in a sorted set, by score' - 'zrank:determine the index of a member in a sorted set' - 'zrem:remove a member from a sorted set' - 'zremrangebyrank:remove all members in a sorted set within the given indexes' - 'zremrangebyscore:remove all members in a sorted set within the given scores' - 'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low' - 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low' - 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low' - 'zscore:get the score associated with the given member in a sorted set' - 'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key' -) - -local expl - -_arguments \ - '(-v --version)'{-v,--version}'[show version]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "redis-cli subcommand" _1st_arguments - return -fi \ No newline at end of file diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh deleted file mode 100644 index 08ca9c601..000000000 --- a/plugins/ruby/ruby.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# TODO: Make this compatible with rvm. -# Run sudo gem on the system ruby, not the active ruby. -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' diff --git a/plugins/rvm/_rvm b/plugins/rvm/_rvm deleted file mode 100644 index bba5304a0..000000000 --- a/plugins/rvm/_rvm +++ /dev/null @@ -1,147 +0,0 @@ -#compdef rvm - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \ - '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \ - '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \ - '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \ - '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \ - '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \ - '-e[Execute code from the command line]:code' \ - '(-G)-G[root gem path to use]:path:_files' \ - '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \ - '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \ - '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \ - '(-C|--configure)'{-C,--configure}'=[custom configure options]' \ - '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \ - '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \ - '(--head)--head[with update, updates rvm to git head version]' \ - '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \ - '(--default)--default[with ruby select, sets a default ruby for new shells]' \ - '(--debug)--debug[Toggle debug mode on for very verbose output]' \ - '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \ - '(--force)--force[Force install, removes old install & source before install]' \ - '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \ - '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \ - '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \ - '(--docs)--docs[with install, attempt to generate ri after installation]' \ - '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case $state in - cmds) - cmds=( - "version:show the rvm version installed in rvm_path" - "use:setup current shell to use a specific ruby version" - "reload:reload rvm source itself (useful after changing rvm source)" - "implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)." - "update:upgrades rvm to the latest version." - "reset:remove current and stored default & system settings." - "info :show the *current* environment information for current ruby" - "current:print the *current* ruby version and the name of any gemset being used." - "debug:show info plus additional information for common issues" - "install:install one or many ruby versions" - "uninstall:uninstall one or many ruby versions, leaves their sources" - "remove:uninstall one or many ruby versions and remove their sources" - "migrate:Lets you migrate all gemsets from one ruby to another." - "upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically." - "wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like." - "cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm." - "repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)." - "snapshot:Lets your backup / restore an rvm installation in a lightweight manner." - "disk-usage:Tells you how much disk space rvm install is using." - "tools:Provides general information about the ruby environment, primarily useful when scripting rvm." - "docs:Tools to make installing ri and rdoc documentation easier." - "rvmrc:Tools related to managing rvmrc trust and loading." - "exec:runs an arbitrary command as a set operation." - "ruby:runs a named ruby file against specified and/or all rubies" - "gem:runs a gem command using selected ruby's 'gem'" - "rake:runs a rake task against specified and/or all rubies" - "tests:runs 'rake test' across selected ruby versions" - "specs:runs 'rake spec' across selected ruby versions" - "monitor:Monitor cwd for testing, run rake {spec,test} on changes." - "gemset:gemsets: http://rvm.beginrescueend.com/gemsets/" - "rubygems:Switches the installed version of rubygems for the current ruby." - "gemdir:display the path to the current gem directory (GEM_HOME)." - "srcdir:display the path to rvm source directory (may be yanked)" - "fetch:Performs an archive / src fetch only of the selected ruby." - "list:show currently installed rubies, interactive output." - "package:Install a dependency package {readline,iconv,zlib,openssl}" - "notes:Display notes, with operating system specifics." - "export:Temporarily set an environment variable in the current shell." - "unexport:Undo changes made to the environment by 'rvm export'." - ) - _describe -t commands 'rvm command' cmds && ret=0 - ;; - args) - case $line[1] in - (use|uninstall|remove|list) - _values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0 - ;; - (install|fetch) - _values -S , 'rubies' $(rvm list known_strings) && ret=0 - ;; - gemset) - if (( CURRENT == 3 )); then - _values 'gemset_commands' \ - 'import' \ - 'export' \ - 'create' \ - 'copy' \ - 'rename' \ - 'empty' \ - 'delete' \ - 'name' \ - 'dir' \ - 'list' \ - 'list_all' \ - 'gemdir' \ - 'install' \ - 'pristine' \ - 'clear' \ - 'use' \ - 'update' \ - 'unpack' \ - 'globalcache' - else - _values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null) - fi - ret=0 - ;; - package) - if (( CURRENT == 3 )); then - _values 'package_commands' \ - 'install' \ - 'uninstall' - else - _values 'packages' \ - 'readline' \ - 'iconv' \ - 'curl' \ - 'openssl' \ - 'zlib' \ - 'autoconf' \ - 'ncurses' \ - 'pkgconfig' \ - 'gettext' \ - 'glib' \ - 'mono' \ - 'llvm' \ - 'libxml2' \ - 'libxslt' \ - 'libyaml' - fi - ret=0 - ;; - *) - (( ret )) && _message 'no more arguments' - ;; - esac - ;; -esac - -return ret diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh deleted file mode 100644 index 24621fe0b..000000000 --- a/plugins/rvm/rvm.plugin.zsh +++ /dev/null @@ -1,44 +0,0 @@ -alias rubies='rvm list rubies' -alias gemsets='rvm gemset list' - -local ruby18='ruby-1.8.7-p334' -local ruby19='ruby-1.9.2-p180' - -function rb18 { - if [ -z "$1" ]; then - rvm use "$ruby18" - else - rvm use "$ruby18@$1" - fi -} - -_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} -compdef _rb18 rb18 - -function rb19 { - if [ -z "$1" ]; then - rvm use "$ruby19" - else - rvm use "$ruby19@$1" - fi -} - -_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} -compdef _rb19 rb19 - -function rvm-update { - rvm get head - rvm reload # TODO: Reload rvm completion? -} - -# TODO: Make this usable w/o rvm. -function gems { - local current_ruby=`rvm-prompt i v p` - local current_gemset=`rvm-prompt g` - - gem list $@ | sed \ - -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ - -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ - -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ - -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" -} diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh deleted file mode 100644 index c4e92a1fe..000000000 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# -# INSTRUCTIONS -# -# To enabled agent forwarding support add the following to -# your .zshrc file: -# -# zstyle :omz:plugins:ssh-agent agent-forwarding on -# -# To load multiple identies use the identities style, For -# example: -# -# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github -# -# -# CREDITS -# -# Based on code from Joseph M. Reagle -# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html -# -# Agent forwarding support based on ideas from -# Florent Thoumie and Jonas Pfenniger -# - -local _plugin__ssh_env=$HOME/.ssh/environment-$HOST -local _plugin__forwarding - -function _plugin__start_agent() -{ - local -a identities - - # start ssh-agent and setup environment - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} - chmod 600 ${_plugin__ssh_env} - . ${_plugin__ssh_env} > /dev/null - - # load identies - zstyle -a :omz:plugins:ssh-agent identities identities - echo starting... - /usr/bin/ssh-add $HOME/.ssh/${^identities} -} - -# test if agent-forwarding is enabled -zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding -if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then - # Add a nifty symlink for screen/tmux if agent forwarding - [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen - -elif [ -f "${_plugin__ssh_env}" ]; then - # Source SSH settings, if applicable - . ${_plugin__ssh_env} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - _plugin__start_agent; - } -else - _plugin__start_agent; -fi - -# tidy up after ourselves -unfunction _plugin__start_agent -unset _plugin__forwarding -unset _plugin__ssh_env - diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh deleted file mode 100644 index e2cf96ca3..000000000 --- a/plugins/svn/svn.plugin.zsh +++ /dev/null @@ -1,42 +0,0 @@ -function svn_prompt_info { - if [ $(in_svn) ]; then - echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ -$ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" - fi -} - - -function in_svn() { - if [[ -d .svn ]]; then - echo 1 - fi -} - -function svn_get_repo_name { - if [ $(in_svn) ]; then - svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT - - svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" - fi -} - -function svn_get_rev_nr { - if [ $(in_svn) ]; then - svn info 2> /dev/null | sed -n s/Revision:\ //p - fi -} - -function svn_dirty_choose { - if [ $(in_svn) ]; then - s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) - if [ $s ]; then - echo $1 - else - echo $2 - fi - fi -} - -function svn_dirty { - svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN -} diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task deleted file mode 100644 index 5bffa9119..000000000 --- a/plugins/taskwarrior/_task +++ /dev/null @@ -1,280 +0,0 @@ -#compdef task -# -# zsh completion for taskwarrior -# -# Copyright 2010 - 2011 Johannes Schlatow -# Copyright 2009 P.C. Shyamshankar -# All rights reserved. -# -# This script is part of the taskwarrior project. -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the -# -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, -# Boston, MA -# 02110-1301 -# USA -# -typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers -_task_projects=($(task _projects)) -_task_tags=($(task _tags)) -_task_ids=($(task _ids)) -_task_config=($(task _config)) -_task_modifiers=( - 'before' \ - 'after' \ - 'none' \ - 'any' \ - 'is' \ - 'isnt' \ - 'has' \ - 'hasnt' \ - 'startswith' \ - 'endswith' \ - 'word' \ - 'noword' -) -_task_cmds=($(task _commands)) -_task_zshcmds=( ${(f)"$(task _zshcommands)"} ) - - -_task_idCmds=( - 'append' \ - 'prepend' \ - 'annotate' \ - 'denotate' \ - 'edit' \ - 'duplicate' \ - 'info' \ - 'start' \ - 'stop' \ - 'done' -) - -_task_idCmdsDesc=( - 'append:Appends more description to an existing task.' \ - 'prepend:Prepends more description to an existing task.' \ - 'annotate:Adds an annotation to an existing task.' \ - 'denotate:Deletes an annotation of an existing task.' \ - 'edit:Launches an editor to let you modify a task directly.' \ - 'duplicate:Duplicates the specified task, and allows modifications.' \ - 'info:Shows all data, metadata for specified task.' \ - 'start:Marks specified task as started.' \ - 'stop:Removes the start time from a task.' \ - 'done:Marks the specified task as completed.' -) - -_task() { - _arguments -s -S \ - "*::task command:_task_commands" - return 0 -} - -local -a reply args word -word=$'[^\0]#\0' - -# priorities -local -a task_priorities -_regex_words values 'task priorities' \ - 'H:High' \ - 'M:Middle' \ - 'L:Low' -task_priorities=("$reply[@]") - -# projects -local -a task_projects -task_projects=( - /"$word"/ - ":values:task projects:compadd -a _task_projects" -) - -local -a _task_dates -_regex_words values 'task dates' \ - 'tod*ay:Today' \ - 'yes*terday:Yesterday' \ - 'tom*orrow:Tomorrow' \ - 'sow:Start of week' \ - 'soww:Start of work week' \ - 'socw:Start of calendar week' \ - 'som:Start of month' \ - 'soy:Start of year' \ - 'eow:End of week' \ - 'eoww:End of work week' \ - 'eocw:End of calendar week' \ - 'eom:End of month' \ - 'eoy:End of year' \ - 'mon:Monday' \ - 'tue:Tuesday'\ - 'wed:Wednesday' \ - 'thu:Thursday' \ - 'fri:Friday' \ - 'sat:Saturday' \ - 'sun:Sunday' -_task_dates=("$reply[@]") - -local -a _task_reldates -_regex_words values 'task reldates' \ - 'hrs:n hours' \ - 'day:n days' \ - '1st:first' \ - '2nd:second' \ - '3rd:third' \ - 'th:4th, 5th, etc.' \ - 'wks:weeks' -_task_reldates=("$reply[@]") - -task_dates=( - \( "$_task_dates[@]" \| - \( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \) - \) -) - -_regex_words values 'task frequencies' \ - 'daily:Every day' \ - 'day:Every day' \ - 'weekdays:Every day skipping weekend days' \ - 'weekly:Every week' \ - 'biweekly:Every two weeks' \ - 'fortnight:Every two weeks' \ - 'quarterly:Every three months' \ - 'semiannual:Every six months' \ - 'annual:Every year' \ - 'yearly:Every year' \ - 'biannual:Every two years' \ - 'biyearly:Every two years' -_task_freqs=("$reply[@]") - -local -a _task_frequencies -_regex_words values 'task frequencies' \ - 'd:days' \ - 'w:weeks' \ - 'q:quarters' \ - 'y:years' -_task_frequencies=("$reply[@]") - -task_freqs=( - \( "$_task_freqs[@]" \| - \( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \) - \) -) - -# attributes -local -a task_attributes -_regex_words -t ':' default 'task attributes' \ - 'pro*ject:Project name:$task_projects' \ - 'du*e:Due date:$task_dates' \ - 'wa*it:Date until task becomes pending:$task_dates' \ - 're*cur:Recurrence frequency:$task_freqs' \ - 'pri*ority:priority:$task_priorities' \ - 'un*til:Recurrence end date:$task_dates' \ - 'fg:Foreground color' \ - 'bg:Background color' \ - 'li*mit:Desired number of rows in report' -task_attributes=("$reply[@]") - -args=( - \( "$task_attributes[@]" \| - \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \| - \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \| - \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \| - \( /"$word"/ \) - \) \# -) -_regex_arguments _task_attributes "${args[@]}" - -## task commands - -# default completion -(( $+functions[_task_default] )) || -_task_default() { - _task_attributes "$@" -} - -# commands expecting an ID -(( $+functions[_task_id] )) || -_task_id() { - if (( CURRENT < 3 )); then - # update IDs - _task_zshids=( ${(f)"$(task _zshids)"} ) - _describe -t values 'task IDs' _task_zshids - else - _task_attributes "$@" - fi -} - -# merge completion -(( $+functions[_task_merge] )) || -_task_merge() { - # TODO match URIs in .taskrc - _files -} - -# push completion -(( $+functions[_task_push] )) || -_task_push() { - # TODO match URIs in .taskrc - _files -} - -# pull completion -(( $+functions[_task_pull] )) || -_task_pull() { - # TODO match URIs in .taskrc - _files -} - - -# modify (task [0-9]* ...) completion -(( $+functions[_task_modify] )) || -_task_modify() { - _describe -t commands 'task command' _task_idCmdsDesc - _task_attributes "$@" -} - -## first level completion => task sub-command completion -(( $+functions[_task_commands] )) || -_task_commands() { - local cmd ret=1 - if (( CURRENT == 1 )); then - # update IDs - _task_zshids=( ${(f)"$(task _zshids)"} ) - - _describe -t commands 'task command' _task_zshcmds - _describe -t values 'task IDs' _task_zshids - # TODO match more than one ID - elif [[ $words[1] =~ ^[0-9]*$ ]] then - _call_function ret _task_modify - return ret - else -# local curcontext="${curcontext}" -# cmd="${_task_cmds[(r)$words[1]:*]%%:*}" - cmd="${_task_cmds[(r)$words[1]]}" - idCmd="${(M)_task_idCmds[@]:#$words[1]}" - if (( $#cmd )); then -# curcontext="${curcontext%:*:*}:task-${cmd}" - - if (( $#idCmd )); then - _call_function ret _task_id - else - _call_function ret _task_${cmd} || - _call_function ret _task_default || - _message "No command remaining." - fi - else - _message "Unknown subcommand ${cmd}" - fi - return ret - fi -} diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh deleted file mode 100644 index c1830042e..000000000 --- a/plugins/taskwarrior/taskwarrior.plugin.zsh +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# Author: Pete Clark -# Email: pete[dot]clark[at]gmail[dot]com -# Version: 0.1 (05/24/2011) -# License: WTFPL -# -# This oh-my-zsh plugin adds smart tab completion for -# TaskWarrior. It uses the zsh tab completion -# script (_task) distributed with TaskWarrior for the completion definitions. -# -# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] -# gives a list of available modifications for that task, etc. -################################################################################ - -zstyle ':completion:*:*:task:*' verbose yes -zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u' - -zstyle ':completion:*:*:task:*' group-name '' - -alias t=task -compdef _task t=task diff --git a/plugins/terminitor/_terminitor b/plugins/terminitor/_terminitor deleted file mode 100644 index 1ce87c3ad..000000000 --- a/plugins/terminitor/_terminitor +++ /dev/null @@ -1,38 +0,0 @@ -#compdef terminitor -#autoload - -# terminitor zsh completion - -_terminitor_available_scripts() { - scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) -} - -local -a _1st_arguments -_1st_arguments=( - 'create:create a Termfile in directory' - 'delete:delete terminitor script' - 'edit:open termitor script' - 'fetch:clone the designated repo and run setup' - 'help:Describe available tasks or one specific task' - 'init:create initial root terminitor folder' - 'list:lists all terminitor scripts' - 'setup:execute setup in the terminitor script' - 'start:runs the terminitor script' - 'update:update Terminitor to new global path(.config/.terminitor)' -) - -local expl - -_arguments \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "terminitor task" _1st_arguments - return -fi - -case "$words[1]" in - start|edit|delete|setup) - _terminitor_available_scripts - _wanted scripts expl 'installed scripts' compadd -a scripts ;; -esac diff --git a/plugins/thor/_thor b/plugins/thor/_thor deleted file mode 100644 index 9f7ed5aef..000000000 --- a/plugins/thor/_thor +++ /dev/null @@ -1,4 +0,0 @@ -#compdef thor -#autoload - -compadd `thor list | grep thor | cut -d " " -f 2` diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant deleted file mode 100644 index 483b29c53..000000000 --- a/plugins/vagrant/_vagrant +++ /dev/null @@ -1,104 +0,0 @@ -#compdef vagrant -#autoload - -# vagrant zsh completion - -local -a _1st_arguments -_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' - '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.' - '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' -) - -local -a _box_arguments -_box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' - 'list:Lists all installed boxes' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' -) - -__task_list () -{ - local expl - declare -a tasks - - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) - - _wanted tasks expl 'help' compadd $tasks -} - -__box_list () -{ - _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') -} - -__vagrant-box () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "gem subcommand" _box_arguments - return - ;; - - (options) - case $line[1] in - (repackage|remove) - _arguments ':feature:__box_list' - ;; - esac - ;; - esac -} - - - - -local expl -local -a boxes installed_boxes - -local curcontext="$curcontext" state line -typeset -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "gem subcommand" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _arguments ':feature:__task_list' - ;; - - (box) - __vagrant-box - ;; - esac - ;; -esac diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh deleted file mode 100644 index c47ab7211..000000000 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ /dev/null @@ -1,22 +0,0 @@ -function zle-line-init zle-keymap-select { - zle reset-prompt -} - -zle -N zle-line-init -zle -N zle-keymap-select - -bindkey -v - -# if mode indicator wasn't setup by theme, define default -if [[ "$MODE_INDICATOR" == "" ]]; then - MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" -fi - -function vi_mode_prompt_info() { - echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" -} - -# define right prompt, if it wasn't defined by a theme -if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then - RPS1='$(vi_mode_prompt_info)' -fi diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh deleted file mode 100644 index 005a58476..000000000 --- a/plugins/vundle/vundle.plugin.zsh +++ /dev/null @@ -1,23 +0,0 @@ -function vundle-init () { - if [ ! -d ~/.vim/bundle/vundle/ ] - then - mkdir -p ~/.vim/bundle/vundle/ - fi - - if [ ! -d ~/.vim/bundle/vundle/.git/ ] - then - git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle - echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" - fi -} - -function vundle () { - vundle-init - vim -c "execute \"BundleInstall\" | q | q" -} - - -function vundle-update () { - vundle-init - vim -c "execute \"BundleInstall!\" | q | q" -} From a9fbe5505c8c994144365c3896312d7b84942972 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 10:20:38 -0500 Subject: [PATCH 100/203] Better version of the sprunge command. Its better organized, has better error messages, and the while loop to read from stdin is completely unnecessary, redirecting stdin is more efficient. --- plugins/sprunge/sprunge.plugin.zsh | 76 +++++++++++------------------- 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index f59647990..078f3db71 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,41 +1,11 @@ # Smart sprunge alias/script. # -# To add the sprunge script to your path, add this to your .zshrc file: -# -# zstyle :omz:plugins:sprunge add-path on -# -# Otherwise, a simple alias for sprunge, but only if there isn't a smarter, -# better one out there in $PATH, will be added. - -# zstyle -b :omz:plugins:sprunge add-path _plugin__path -# if [[ ${_plugin__path} == "on" ]]; then - # Plugin setting: Add this plugin directory to the path - # export PATH=$PATH:$ZSH/plugins/sprunge -# elif [[ -z "${commands[sprunge]}" ]]; then - # Nope. No `sprunge` command, period. So, dumb/simple alias, here we go! - # alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" -# fi -# # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf # Created by the blogger at the URL below...I don't know where to find his/her name # Original found at http://www.shellperson.net/sprunge-pastebin-script/ -sprunge () { - local url syntax - - if [[ -t 0 ]]; then - if [[ -n "$*" ]]; then - if [[ -f "$*" ]]; then - # Use python to attempt to detect the syntax - syntax=$(echo "try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$*').aliases[0]) -except: - print('text')" | python) - url=$(curl -s -F 'sprunge=<-' http://sprunge.us < "$*") - fi - else - cat << HERE +sprunge_usage() { + cat << HERE DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us @@ -79,27 +49,37 @@ description, it will NOT generate an error, but will instead treat it as a text string and upload it. HERE - return 1 - fi - else - syntax="text" # We're dumb in this mode. So, dumb syntax highlighting! - url=$(while read -r line ; do - echo $line - done | curl -s -F 'sprunge=<-' http://sprunge.us) - fi +} - local flags +sprunge () { + local url syntax + + if [[ ! -t 0 ]]; then + # We're dumb in this mode. So, dumb syntax highlighting! + syntax="text" + url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) + elif [[ $#argv -eq 0 ]]; then + sprunge_usage + return 1 + elif [[ -f $1 ]]; then + # Use python to attempt to detect the syntax + syntax=$(echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$*').aliases[0]) +except: + print('text')" | python) + url=$(curl -s -F 'sprunge=<-' http://sprunge.us < $1) + else + echo "$1 isn't a file" + return 1 + fi # trim whitespaces and add syntax info url=${url//[[:space:]]} [[ $syntax != text ]] && url=${url}?${syntax} - # if stdout is not a tty, suppress trailing newline - # XXX: i don't think this is the right thing to do - # [[ ! -t 1 ]] && flags='-n' - # output - echo $flags $url + echo $url # don't copy to clipboad if piped [[ ! -t 1 ]] && return 0 @@ -109,7 +89,7 @@ HERE echo -n $url | xclip -sel primary echo -n $url | xclip -sel clipboard elif (( $+commands[xsel] )); then - echo -n $url | xsel -ip #primary - echo -n $url | xsel -ib #clipboard + echo -n $url | xsel -ip # primary + echo -n $url | xsel -ib # clipboard fi } From 926ea03109eb7b9075d0520736624a27e868f73e Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 10:28:45 -0500 Subject: [PATCH 101/203] Better formatted usage message. --- plugins/sprunge/sprunge.plugin.zsh | 37 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 078f3db71..8d0246581 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -21,32 +21,29 @@ USAGE piped_data | $0 INPUT METHODS - -$0 can accept piped data, STDIN redirection [ Date: Tue, 29 Nov 2011 10:49:14 -0500 Subject: [PATCH 102/203] The sprunge command will now handle multiple with ease. --- plugins/sprunge/sprunge.plugin.zsh | 54 ++++++++++++++++++------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 8d0246581..aa854ede2 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -48,45 +48,55 @@ FILENAMES HERE } +sprunge_syntax() { + echo "try: + from pygments.lexers import get_lexer_for_filename + print(get_lexer_for_filename('$1').aliases[0]) +except: + print('text')" | python +} + sprunge () { - local url syntax + local urls url file syntax + + urls=() if [[ ! -t 0 ]]; then - # We're dumb in this mode. So, dumb syntax highlighting! - syntax="text" url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) + urls=(${url//[[:space:]]}) elif [[ $#argv -eq 0 ]]; then sprunge_usage return 1 - elif [[ -f $1 ]]; then - # Use python to attempt to detect the syntax - syntax=$(echo "try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$*').aliases[0]) -except: - print('text')" | python) - url=$(curl -s -F 'sprunge=<-' http://sprunge.us < $1) else - echo "$1 isn't a file" - return 1 + # Use python to attempt to detect the syntax + for file in $@; do + if [[ ! -f $file ]]; then + echo "$file isn't a file" + continue + fi + + syntax=$(sprunge_syntax $file) + url=$(curl -s -F 'sprunge=<-' http://sprunge.us < $file) + url=${url//[[:space:]]} + [[ $syntax != text ]] && url=${url}?${syntax} + + urls+=(${url}) + done fi - # trim whitespaces and add syntax info - url=${url//[[:space:]]} - [[ $syntax != text ]] && url=${url}?${syntax} - # output - echo $url + for url in $urls + echo $url # don't copy to clipboad if piped [[ ! -t 1 ]] && return 0 #copy url to primary and clipboard (middle-mouse & shift+ins/Ctrl+v) if (( $+commands[xclip] )); then - echo -n $url | xclip -sel primary - echo -n $url | xclip -sel clipboard + echo -n $urls | xclip -sel primary + echo -n $urls | xclip -sel clipboard elif (( $+commands[xsel] )); then - echo -n $url | xsel -ip # primary - echo -n $url | xsel -ib # clipboard + echo -n $urls | xsel -ip # primary + echo -n $urls | xsel -ib # clipboard fi } From 21caf6ea770ac8bd497102439262681e34a25c07 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 11:10:56 -0500 Subject: [PATCH 103/203] Truly make python an optional dependency of the sprunge plugin --- plugins/sprunge/sprunge.plugin.zsh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index aa854ede2..fed20d16f 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -48,15 +48,19 @@ FILENAMES HERE } -sprunge_syntax() { - echo "try: +if (( $+commands[python] )); then + sprunge_syntax() { + echo "try: from pygments.lexers import get_lexer_for_filename print(get_lexer_for_filename('$1').aliases[0]) except: print('text')" | python -} + } +else + sprunge_syntax() { echo 'text' } +fi -sprunge () { +sprunge() { local urls url file syntax urls=() From f3b939f45bd2192ada8ca4af993391e5428d3f53 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 11:35:17 -0500 Subject: [PATCH 104/203] Custom isn't needed anymore, ~/.omz/ is the new custom --- custom/example.zsh | 5 ----- custom/example/example.plugin.zsh | 2 -- 2 files changed, 7 deletions(-) delete mode 100644 custom/example.zsh delete mode 100644 custom/example/example.plugin.zsh diff --git a/custom/example.zsh b/custom/example.zsh deleted file mode 100644 index 28ffcae25..000000000 --- a/custom/example.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Add yourself some shortcuts to projects you often work on -# Example: -# -# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr -# \ No newline at end of file diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh deleted file mode 100644 index 406f27445..000000000 --- a/custom/example/example.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. From 5215330886330216f84bed6241fa5069fd74635f Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 12:11:58 -0500 Subject: [PATCH 105/203] New README in markdown. --- README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.textile | 68 ----------------------------------------------- 2 files changed, 71 insertions(+), 68 deletions(-) create mode 100644 README.md delete mode 100644 README.textile diff --git a/README.md b/README.md new file mode 100644 index 000000000..86ee48fa4 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +"OH MY ZSHELL!" +=============== + +**NOTE**: This documentation isn't finished and this project is +currently under rapid development. Be cautious, information here may +not be up to date. + +**NOTE**: This fork is specifically for Archlinux and has been patched +for a system-wide install; Don't attempt to install to ~/.oh-my-zsh! +This project had radically diverged away from its source. While +plugins should remain compatible, there is much which has changed. + +Setup +----- + +`oh-my-zsh` should work with any recent release of [zsh][], the +minimum recommended version is 4.3.9. + +A package can be found in Archlinux's [AUR][oh-my-zsh-git]. We +recommend using [cower] to install it: + +``` +cower -dd oh-my-zsh-git +``` + + [zsh]: http://www.zsh.org/ + [oh-my-zsh-git]: https://aur.archlinux.org/packages.php?ID=54375 + [cower]: https://github.com/falconindy/cower + +The user must have zsh set as their shell. + +``` +# chsh -s /bin/zsh +``` + +The following needs to be added to the start of the user's `~/.zshrc` +file to activate oh-my-zshell goodness. + +``` +ZSH_THEME="arch-blue" +plugins=(archlinux sprunge git) +load_oh_my_zshell +``` + +A skeleton template can be found in +`/usr/share/oh-my-zsh/templates/user.zsh-template` + +Customization +============= + +- To enable more the plugins, customize the plugins array in your + `~/.zshrc` +- To change themes, change the @ZSH_THEME@ environment variable in + `~/.zshrc`. + +If you want to override any of the default behaviour, just add a new +file (ending in `.zsh`) into the `~/.omz/` directory. If you have many +functions which go good together you can put them as a *.plugin.zsh +file in the `~/.omz/plugins/` directory. + +If you would like to override the functionality of a plugin +distributed with oh-my-zsh, create a plugin of the same name in the +`~/.omz/plugins/` directory and it will be loaded instead of the one +provided one. + +Resources +--------- + +The [refcard][] is pretty tasty for tips. + + [refcard]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf diff --git a/README.textile b/README.textile deleted file mode 100644 index 290dc990b..000000000 --- a/README.textile +++ /dev/null @@ -1,68 +0,0 @@ -**NOTE: This fork is specifically for Archlinux and has been patched for a system-wide install; Don't attempt to install to ~/.oh-my-zsh!! There will be a user specifc wrapper later on, but for now. system wide or use robby's official master ( not optimized for arch nor as patched; He is too lazy to merge some pull requests. )** -**This documentation/wiki isn't finished nor official!** - -A handful of functions, auto-complete helpers, and stuff that makes you shout... - -bq. "OH MY ZSHELL!" - -h2. Setup - -@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. - -h3. Installing using cower - -@cower -dd oh-my-zsh-git@ - -h4. Enableing for a user. - -The user must first have zsh set as their shell. -@[[ $SHELL != '/bin/zsh' ]] && su -c'chsh -s $(which zsh) '@ - -For each user who wishes to use oh-my-zsh they must append/copy the user.zsh-template to their .zshrc. -@>$HOME/.zshrc@ -If the above command doesn't run please try.. -@cat /usr/share/oh-my-zsh/templates/user.zsh-template>>$HOME/.zshrc@ -If that doesn't work and you don't have anything in your .zshrc file. simply copy the file accross. - -h3. Problems? - -You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_. - -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_. -* much much more... take a look at @lib/@ what _Oh My Zsh_ offers... - -h2. Useful - -the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips. - -h3. Customization - -If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. -If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. -If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. - - -h3. Uninstalling - -If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). - -h2. Help out! - -I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! - -h3. Send us your theme! - -I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. - -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 - -Thank you so much! From f8bace703ac72a8e6784f0ae59d1dc66f516f622 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 12:13:55 -0500 Subject: [PATCH 106/203] Tweaked README --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 86ee48fa4..01c786242 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ Setup ----- `oh-my-zsh` should work with any recent release of [zsh][], the -minimum recommended version is 4.3.9. - -A package can be found in Archlinux's [AUR][oh-my-zsh-git]. We -recommend using [cower] to install it: +minimum recommended version is 4.3.9. A package can be found in +Archlinux's [AUR][oh-my-zsh-git]. We recommend using [cower] to +install it: ``` -cower -dd oh-my-zsh-git +$ cower -dd oh-my-zsh-git ``` [zsh]: http://www.zsh.org/ @@ -36,11 +35,9 @@ The user must have zsh set as their shell. The following needs to be added to the start of the user's `~/.zshrc` file to activate oh-my-zshell goodness. -``` -ZSH_THEME="arch-blue" -plugins=(archlinux sprunge git) -load_oh_my_zshell -``` + ZSH_THEME="arch-blue" + plugins=(archlinux sprunge git) + load_oh_my_zshell A skeleton template can be found in `/usr/share/oh-my-zsh/templates/user.zsh-template` From 69c6c04f647f0552859172ac4842bb5ffcdaee0c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 12:25:39 -0500 Subject: [PATCH 107/203] Updated documentation. --- README.md | 7 ++-- plugins/sprunge/README.md | 52 +++++++++++------------------- plugins/sprunge/sprunge.plugin.zsh | 38 ++++------------------ 3 files changed, 28 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 01c786242..c8ac184ef 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,6 @@ install it: $ cower -dd oh-my-zsh-git ``` - [zsh]: http://www.zsh.org/ - [oh-my-zsh-git]: https://aur.archlinux.org/packages.php?ID=54375 - [cower]: https://github.com/falconindy/cower - The user must have zsh set as their shell. ``` @@ -65,4 +61,7 @@ Resources The [refcard][] is pretty tasty for tips. + [zsh]: http://www.zsh.org/ + [oh-my-zsh-git]: https://aur.archlinux.org/packages.php?ID=54375 + [cower]: https://github.com/falconindy/cower [refcard]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf diff --git a/plugins/sprunge/README.md b/plugins/sprunge/README.md index 480707e84..d2326f7a3 100644 --- a/plugins/sprunge/README.md +++ b/plugins/sprunge/README.md @@ -1,39 +1,25 @@ -# sprunge alias +Sprunge +======= -This plugin adds at least an alias to zsh. However, you can use the smarter -script, provided as part of the plugin, instead. To enable it, add the following -to your `.zshrc`: +This plugin adds powerful sprunge functionality to zsh. The script +optionally requires pygments with python >= 2.7 and either xclip or +xsel. Pygments is used to detect what language you have uploaded. If +it is detected, the url will automatically append the url with an +appropriate with `?lang`. Xclip or xsel are used to copy the urls to +the primary and secondary clipboards. - zstyle :omz:plugins:sprunge add-path on +Usage +----- -The plugin will modify your path, adding `$ZSH/plugins/sprunge` to the end of -it. This plugin presumes you set `$ZSH` to the directory where oh-my-zsh is -installed to. This is the default if you used the template zshrc. +You can call `sprunge` in any of the following ways: -# Note + sprunge [files] + sprunge < file + piped_data | sprunge -The plugin does not overwrite anything. If you had an alias, or there is another -binary in your system that is called 'sprunge', this plugin will do **nothing**. +Copyright & License +------------------- -The script also depends on pygments, and python >= 2.7. Pygments is used to -detect what language you have uploaded. If it is detected, the url will -automatically be appended with `?lang`, where 'lang' is language. - -## Usage - -If you let the plugin add the sprunge script to your $PATH, you can call -`sprunge` in any of the following ways: - - sprunge filename.txt - sprunge < filename.txt - piped_data | sprunge - -Otherwise, the alias defined by the script can only be called the following way: - - piped_data | sprunge - -# Copyright & License - -This plugin is released under the MIT license. The script is presumed to be -released into the public domain, as the original announcement had no explicit -announcement. +This plugin is released under the MIT license. The script is presumed +to be released into the public domain, as the original announcement +had no explicit announcement. diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index fed20d16f..71b784bd9 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -11,39 +11,13 @@ DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us In addition to printing the returned URL, if the xset or xsel - programs are available (on $PATH), the URL will also be copied to the - PRIMARY selection and the CLIPBOARD selection (allowing to quickly - paste the url into IRC client for example). + programs are available, the URL will also be copied to the + PRIMARY selection and the CLIPBOARD selection. USAGE - $0 filename.txt - $0 < filename.txt - piped_data | $0 - -INPUT METHODS - $0 can accept piped data, STDIN redirection [ Date: Tue, 29 Nov 2011 12:33:29 -0500 Subject: [PATCH 108/203] Updated sprunge so if its called without any arguments it will read from stdin. To get help, use -h or --help. Also, we really don't need the massive wall of text for usage help. --- plugins/sprunge/sprunge.plugin.zsh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 71b784bd9..6a9530ec0 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -6,19 +6,12 @@ sprunge_usage() { cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - - In addition to printing the returned URL, if the xset or xsel - programs are available, the URL will also be copied to the - PRIMARY selection and the CLIPBOARD selection. - -USAGE +Usage: sprunge [files] sprunge < file piped_data | sprunge +Upload data and fetch URL from the pastebin http://sprunge.us. HERE } @@ -39,12 +32,12 @@ sprunge() { urls=() - if [[ ! -t 0 ]]; then + if [[ ! -t 0 || $#argv -eq 0 ]]; then url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) urls=(${url//[[:space:]]}) - elif [[ $#argv -eq 0 ]]; then + elif [[ $1 == '-h' || $1 == '--help' ]]; then sprunge_usage - return 1 + return 0 else # Use python to attempt to detect the syntax for file in $@; do From 6919bbe1dd947ef0430a512c0840d6923532cb01 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 12:41:49 -0500 Subject: [PATCH 109/203] Touched up README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8ac184ef..df253a705 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Customization - To enable more the plugins, customize the plugins array in your `~/.zshrc` -- To change themes, change the @ZSH_THEME@ environment variable in +- To change themes, change the `ZSH_THEME` environment variable in `~/.zshrc`. If you want to override any of the default behaviour, just add a new From 378ef22fb7d7ebbe50c78ce6035fde50aa25366c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 12:45:07 -0500 Subject: [PATCH 110/203] We don't need the log folder. --- log/.easter-egg | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 log/.easter-egg diff --git a/log/.easter-egg b/log/.easter-egg deleted file mode 100644 index 2533149e2..000000000 --- a/log/.easter-egg +++ /dev/null @@ -1,4 +0,0 @@ -This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it. - -feel free to add love notes for people here. - From 6b8046d0af1b48464f3b8d5ea169d0eb5fb576bc Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 13:37:34 -0500 Subject: [PATCH 111/203] Source .zsh files ~/.omz instead of ~/.omz/lib for user customizations. Use NULL_GLOB when sourcing files in directory to properly deal with no matches. --- oh-my-zsh.zsh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 09ea98919..9e7e87452 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -2,6 +2,7 @@ ZSH=${ZSH:-/usr/share/oh-my-zsh/} local config_file plugin +plugin=${plugin:=()} # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) @@ -11,18 +12,21 @@ if [[ -d ~/.omz ]]; then [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) fi -for config_file ($ZSH/lib/*.zsh) source $config_file +for config_file ($ZSH/lib/*.zsh(N)) + source $config_file + if [[ -d ~/.omz ]]; then - if [[ -d ~/.omz/lib ]]; then - for config_file (~/.omz/lib/*.zsh) source $config_file - fi + for config_file (~/.omz/*.zsh(N)) + source $config_file fi -plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +for plugin ($plugins) + fpath=($ZSH/plugins/$plugin $fpath) + if [[ -d ~/.omz ]]; then if [[ -d ~/.omz/plugins ]]; then - for plugin ($plugins) fpath=(~/.omz/plugins/$plugin $fpath) + for plugin ($plugins) + fpath=(~/.omz/plugins/$plugin $fpath) fi fi From 331fd0b9ff0be25b183e0f510c7edbe49d9db3ae Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 14:51:46 -0500 Subject: [PATCH 112/203] Updated templates. --- templates/user.zsh-template | 8 ++++---- templates/zshrc.arch-zsh-template | 28 ---------------------------- templates/zshrc.zsh-template | 31 ------------------------------- 3 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 templates/zshrc.zsh-template diff --git a/templates/user.zsh-template b/templates/user.zsh-template index b6b0a6fd0..ff9442106 100644 --- a/templates/user.zsh-template +++ b/templates/user.zsh-template @@ -1,7 +1,7 @@ -# Check /etc/zsh/zshrc for system defaults. Eg. plugins=(git) +# Check /etc/zsh/zshrc for system defaults. -# Enable for awesome sprunge! -zstyle :omz:plugins:sprunge add-path on -plugins+=(archlinux sprunge github) +ZSH_THEME="arch-blue" + +plugins=(archlinux sprunge git github) load_oh_my_zshell diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index c944596db..41ad0a525 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,33 +1,5 @@ -# Path to your oh-my-zsh configuration. -ZSH=/usr/share/oh-my-zsh - -# Set name of the theme to load. -# Look in /usr/local/share/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="arch-blue" -# 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 /usr/local/share/oh-my-zsh/plugins/*) -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) - load_oh_my_zshell(){ source $ZSH/oh-my-zsh.zsh } - -# Customize to your needs... diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template deleted file mode 100644 index f422f89b2..000000000 --- a/templates/zshrc.zsh-template +++ /dev/null @@ -1,31 +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="robbyrussell" - -# 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/*) -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) - -source $ZSH/oh-my-zsh.zsh - -# Customize to your needs... From c83ecd5d1a0bc93c8daa7317bd4d90f4d4a04418 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 15:46:53 -0500 Subject: [PATCH 113/203] Output error messages in sprunge to stderr. --- plugins/sprunge/sprunge.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 6a9530ec0..de9290256 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -42,7 +42,7 @@ sprunge() { # Use python to attempt to detect the syntax for file in $@; do if [[ ! -f $file ]]; then - echo "$file isn't a file" + echo "$file isn't a file" >&2 continue fi From 5905845abdb9e4f04c81a2a321827414aec24d6d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 17:03:13 -0500 Subject: [PATCH 114/203] Cosmetic changes and comments for sprunge. --- plugins/sprunge/sprunge.plugin.zsh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index de9290256..d080ff4c7 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -16,6 +16,7 @@ HERE } if (( $+commands[python] )); then + # use python to attempt to detect the syntax sprunge_syntax() { echo "try: from pygments.lexers import get_lexer_for_filename @@ -24,6 +25,7 @@ except: print('text')" | python } else + # if we happen to lack python, just report everything as text sprunge_syntax() { echo 'text' } fi @@ -32,14 +34,16 @@ sprunge() { urls=() - if [[ ! -t 0 || $#argv -eq 0 ]]; then - url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) - urls=(${url//[[:space:]]}) - elif [[ $1 == '-h' || $1 == '--help' ]]; then + if [[ $1 == '-h' || $1 == '--help' ]]; then + # print usage information sprunge_usage return 0 + elif [[ ! -t 0 || $#argv -eq 0 ]]; then + # read from stdin + url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) + urls=(${url//[[:space:]]}) else - # Use python to attempt to detect the syntax + # treat arguments as a list of files to upload for file in $@; do if [[ ! -f $file ]]; then echo "$file isn't a file" >&2 @@ -55,14 +59,14 @@ sprunge() { done fi - # output + # output each url on its own line for url in $urls echo $url # don't copy to clipboad if piped [[ ! -t 1 ]] && return 0 - # copy urls to primary and clipboard (middle-mouse & shift+ins/Ctrl+v) + # copy urls to primary and secondary clipboards if (( $+commands[xclip] )); then echo -n $urls | xclip -sel primary echo -n $urls | xclip -sel clipboard From c92361be549d9589736f38f59821f62cfd32a6ea Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 16:03:52 +1100 Subject: [PATCH 115/203] fixed some issues --- templates/zshrc.arch-zsh-template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 41ad0a525..f97f5b088 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,3 +1,5 @@ +ZSH=/usr/share/oh-my-zsh + ZSH_THEME="arch-blue" load_oh_my_zshell(){ From 55487c4d273a07529328616bd8eb5ebf59432d71 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 16:26:29 +1100 Subject: [PATCH 116/203] Removed most themes, starting from scratch! --- themes/Soliah.zsh-theme | 86 ----------------- themes/afowler.zsh-theme | 10 -- themes/alanpeabody.zsh-theme | 22 ----- themes/apple.zsh-theme | 26 ----- themes/arrow.zsh-theme | 14 --- themes/aussiegeek.zsh-theme | 8 -- themes/awesomepanda.zsh-theme | 18 ---- themes/bira.zsh-theme | 14 --- themes/blinks.zsh-theme | 20 ---- themes/candy.zsh-theme | 7 -- themes/clean.zsh-theme | 14 --- themes/cloud.zsh-theme | 6 -- themes/crunch.zsh-theme | 37 -------- themes/cypher.zsh-theme | 4 - themes/dallas.zsh-theme | 26 ----- themes/darkblood.zsh-theme | 9 -- themes/daveverwer.zsh-theme | 7 -- themes/dieter.zsh-theme | 56 ----------- themes/dogenpunk.zsh-theme | 85 ----------------- themes/dpoggi.zsh-theme | 14 --- themes/dst.zsh-theme | 16 ---- themes/dstufft.zsh-theme | 19 ---- themes/duellj.zsh-theme | 8 -- themes/eastwood.zsh-theme | 19 ---- themes/edvardm.zsh-theme | 6 -- themes/evan.zsh-theme | 2 - themes/example.zsh-theme | 5 - themes/fino.zsh-theme | 39 -------- themes/fishy.zsh-theme | 20 ---- themes/flazz.zsh-theme | 19 ---- themes/fletcherm.zsh-theme | 12 --- themes/fox.zsh-theme | 8 -- themes/frisk.zsh-theme | 10 -- themes/funky.zsh-theme | 14 --- themes/fwalch.zsh-theme | 6 -- themes/gallifrey.zsh-theme | 8 -- themes/gallois.zsh-theme | 19 ---- themes/garyblessington.zsh-theme | 6 -- themes/gentoo.zsh-theme | 4 - themes/geoffgarside.zsh-theme | 5 - themes/gnzh.zsh-theme | 54 ----------- themes/gozilla.zsh-theme | 15 --- themes/humza.zsh-theme | 26 ----- themes/imajes.zsh-theme | 5 - themes/jbergantine.zsh-theme | 6 -- themes/jispwoso.zsh-theme | 4 - themes/jnrowe.zsh-theme | 31 ------ themes/jonathan.zsh-theme | 137 --------------------------- themes/josh.zsh-theme | 43 --------- themes/jreese.zsh-theme | 16 ---- themes/jtriley.zsh-theme | 8 -- themes/juanghurtado.zsh-theme | 46 --------- themes/kardan.zsh-theme | 12 --- themes/kennethreitz.zsh-theme | 13 --- themes/kolo.zsh-theme | 21 ---- themes/kphoen.zsh-theme | 50 ---------- themes/lambda.zsh-theme | 6 -- themes/linuxonly | 80 ---------------- themes/lukerandall.zsh-theme | 24 ----- themes/macovsky-ruby.zsh-theme | 8 -- themes/macovsky.zsh-theme | 8 -- themes/maran.zsh-theme | 6 -- themes/mgutz.zsh-theme | 6 -- themes/mikeh.zsh-theme | 23 ----- themes/miloshadzic.zsh-theme | 8 -- themes/minimal.zsh-theme | 15 --- themes/mrtazz.zsh-theme | 7 -- themes/murilasso.zsh-theme | 14 --- themes/muse.zsh-theme | 30 ------ themes/nanotech.zsh-theme | 7 -- themes/nebirhos.zsh-theme | 17 ---- themes/nicoulaj.zsh-theme | 43 --------- themes/norm.zsh-theme | 4 - themes/obraun.zsh-theme | 11 --- themes/philips.zsh-theme | 14 --- themes/pmcgee.zsh-theme | 16 ---- themes/re5et.zsh-theme | 15 --- themes/rgm.zsh-theme | 8 -- themes/risto.zsh-theme | 6 -- themes/rixius.zsh-theme | 24 ----- themes/rkj-repos.zsh-theme | 29 ------ themes/rkj.zsh-theme | 8 -- themes/robbyrussell.zsh-theme | 6 -- themes/simple.zsh-theme | 6 -- themes/skaro.zsh-theme | 7 -- themes/smt.zsh-theme | 91 ------------------ themes/sorin.zsh-theme | 48 ---------- themes/sporty_256.zsh-theme | 13 --- themes/steeef.zsh-theme | 100 ------------------- themes/sunaku.zsh-theme | 26 ----- themes/sunrise.zsh-theme | 96 ------------------- themes/superjarin.zsh-theme | 18 ---- themes/takashiyoshida.zsh-theme | 27 ------ themes/terminalparty.zsh-theme | 9 -- themes/theme_chooser.sh | 99 ------------------- themes/theunraveler.zsh-theme | 16 ---- themes/tjkirch.zsh-theme | 15 --- themes/tonotdo.zsh-theme | 12 --- themes/trapd00r.zsh-theme | 95 ------------------- themes/wedisagree.zsh-theme | 107 --------------------- themes/wezm+.zsh-theme | 7 -- themes/wezm.zsh-theme | 7 -- themes/wuffers.zsh-theme | 5 - themes/xiong-chiamiov-plus.zsh-theme | 6 -- themes/xiong-chiamiov.zsh-theme | 6 -- 105 files changed, 2474 deletions(-) delete mode 100644 themes/Soliah.zsh-theme delete mode 100644 themes/afowler.zsh-theme delete mode 100644 themes/alanpeabody.zsh-theme delete mode 100644 themes/apple.zsh-theme delete mode 100644 themes/arrow.zsh-theme delete mode 100644 themes/aussiegeek.zsh-theme delete mode 100644 themes/awesomepanda.zsh-theme delete mode 100644 themes/bira.zsh-theme delete mode 100644 themes/blinks.zsh-theme delete mode 100644 themes/candy.zsh-theme delete mode 100644 themes/clean.zsh-theme delete mode 100644 themes/cloud.zsh-theme delete mode 100644 themes/crunch.zsh-theme delete mode 100644 themes/cypher.zsh-theme delete mode 100644 themes/dallas.zsh-theme delete mode 100644 themes/darkblood.zsh-theme delete mode 100644 themes/daveverwer.zsh-theme delete mode 100644 themes/dieter.zsh-theme delete mode 100644 themes/dogenpunk.zsh-theme delete mode 100644 themes/dpoggi.zsh-theme delete mode 100644 themes/dst.zsh-theme delete mode 100644 themes/dstufft.zsh-theme delete mode 100644 themes/duellj.zsh-theme delete mode 100644 themes/eastwood.zsh-theme delete mode 100644 themes/edvardm.zsh-theme delete mode 100644 themes/evan.zsh-theme delete mode 100644 themes/example.zsh-theme delete mode 100644 themes/fino.zsh-theme delete mode 100644 themes/fishy.zsh-theme delete mode 100644 themes/flazz.zsh-theme delete mode 100644 themes/fletcherm.zsh-theme delete mode 100644 themes/fox.zsh-theme delete mode 100644 themes/frisk.zsh-theme delete mode 100644 themes/funky.zsh-theme delete mode 100644 themes/fwalch.zsh-theme delete mode 100644 themes/gallifrey.zsh-theme delete mode 100644 themes/gallois.zsh-theme delete mode 100644 themes/garyblessington.zsh-theme delete mode 100644 themes/gentoo.zsh-theme delete mode 100644 themes/geoffgarside.zsh-theme delete mode 100644 themes/gnzh.zsh-theme delete mode 100644 themes/gozilla.zsh-theme delete mode 100644 themes/humza.zsh-theme delete mode 100644 themes/imajes.zsh-theme delete mode 100644 themes/jbergantine.zsh-theme delete mode 100644 themes/jispwoso.zsh-theme delete mode 100644 themes/jnrowe.zsh-theme delete mode 100644 themes/jonathan.zsh-theme delete mode 100644 themes/josh.zsh-theme delete mode 100644 themes/jreese.zsh-theme delete mode 100644 themes/jtriley.zsh-theme delete mode 100644 themes/juanghurtado.zsh-theme delete mode 100644 themes/kardan.zsh-theme delete mode 100644 themes/kennethreitz.zsh-theme delete mode 100644 themes/kolo.zsh-theme delete mode 100644 themes/kphoen.zsh-theme delete mode 100644 themes/lambda.zsh-theme delete mode 100644 themes/linuxonly delete mode 100644 themes/lukerandall.zsh-theme delete mode 100644 themes/macovsky-ruby.zsh-theme delete mode 100644 themes/macovsky.zsh-theme delete mode 100644 themes/maran.zsh-theme delete mode 100644 themes/mgutz.zsh-theme delete mode 100644 themes/mikeh.zsh-theme delete mode 100644 themes/miloshadzic.zsh-theme delete mode 100644 themes/minimal.zsh-theme delete mode 100644 themes/mrtazz.zsh-theme delete mode 100644 themes/murilasso.zsh-theme delete mode 100644 themes/muse.zsh-theme delete mode 100644 themes/nanotech.zsh-theme delete mode 100644 themes/nebirhos.zsh-theme delete mode 100644 themes/nicoulaj.zsh-theme delete mode 100644 themes/norm.zsh-theme delete mode 100644 themes/obraun.zsh-theme delete mode 100644 themes/philips.zsh-theme delete mode 100644 themes/pmcgee.zsh-theme delete mode 100644 themes/re5et.zsh-theme delete mode 100644 themes/rgm.zsh-theme delete mode 100644 themes/risto.zsh-theme delete mode 100644 themes/rixius.zsh-theme delete mode 100644 themes/rkj-repos.zsh-theme delete mode 100644 themes/rkj.zsh-theme delete mode 100644 themes/robbyrussell.zsh-theme delete mode 100644 themes/simple.zsh-theme delete mode 100644 themes/skaro.zsh-theme delete mode 100644 themes/smt.zsh-theme delete mode 100644 themes/sorin.zsh-theme delete mode 100644 themes/sporty_256.zsh-theme delete mode 100644 themes/steeef.zsh-theme delete mode 100644 themes/sunaku.zsh-theme delete mode 100644 themes/sunrise.zsh-theme delete mode 100644 themes/superjarin.zsh-theme delete mode 100644 themes/takashiyoshida.zsh-theme delete mode 100644 themes/terminalparty.zsh-theme delete mode 100755 themes/theme_chooser.sh delete mode 100644 themes/theunraveler.zsh-theme delete mode 100644 themes/tjkirch.zsh-theme delete mode 100644 themes/tonotdo.zsh-theme delete mode 100644 themes/trapd00r.zsh-theme delete mode 100644 themes/wedisagree.zsh-theme delete mode 100644 themes/wezm+.zsh-theme delete mode 100644 themes/wezm.zsh-theme delete mode 100644 themes/wuffers.zsh-theme delete mode 100644 themes/xiong-chiamiov-plus.zsh-theme delete mode 100644 themes/xiong-chiamiov.zsh-theme diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme deleted file mode 100644 index 237e70fda..000000000 --- a/themes/Soliah.zsh-theme +++ /dev/null @@ -1,86 +0,0 @@ -PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info) -$ ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" - -# Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" - -# Text to display if the branch is clean -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - - -# Git sometimes goes into a detached head state. git_prompt_info doesn't -# return anything in this case. So wrap it in another function and check -# for an empty string. -function check_git_prompt_info() { - if git rev-parse --git-dir > /dev/null 2>&1; then - if [[ -z $(git_prompt_info) ]]; then - echo "%{$fg[magenta]%}detached-head%{$reset_color%})" - else - echo "$(git_prompt_info)" - fi - fi -} - -# Determine if we are using a gemset. -function rvm_gemset() { - GEMSET=`rvm gemset list | grep '=>' | cut -b4-` - if [[ -n $GEMSET ]]; then - echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi - -} - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($(rvm_gemset)$COLOR~|" - fi - fi -} diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme deleted file mode 100644 index 3a4753fc1..000000000 --- a/themes/afowler.zsh-theme +++ /dev/null @@ -1,10 +0,0 @@ -if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme deleted file mode 100644 index 1f66f1ec3..000000000 --- a/themes/alanpeabody.zsh-theme +++ /dev/null @@ -1,22 +0,0 @@ - -local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' -local pwd='%{$fg[blue]%}%~%{$reset_color%}' -local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' -local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -PROMPT="${user} ${pwd}$ " -RPROMPT="${return_code} ${git_branch} ${rvm}" - diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme deleted file mode 100644 index 92f1df941..000000000 --- a/themes/apple.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -function toon { - echo -n "" -} - -get_git_dirty() { - git diff --quiet || echo '*' -} - -autoload -Uz vcs_info -autoload -U colors && colors -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes -zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes -zstyle ':vcs_info:*' actionformats \ - '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f ' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git cvs svn - -precmd () { - vcs_info -} - -setopt prompt_subst -PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}' diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme deleted file mode 100644 index d62dcdcb9..000000000 --- a/themes/arrow.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi - -PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}' -RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="*" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# See http://geoff.greer.fm/lscolors/ -export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" -export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" - diff --git a/themes/aussiegeek.zsh-theme b/themes/aussiegeek.zsh-theme deleted file mode 100644 index c2c7f65b9..000000000 --- a/themes/aussiegeek.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ - -PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color - $ ' -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green](" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_CLEAN="✔" -ZSH_THEME_GIT_PROMPT_DIRTY="✗" diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme deleted file mode 100644 index 411b89837..000000000 --- a/themes/awesomepanda.zsh-theme +++ /dev/null @@ -1,18 +0,0 @@ -# the svn plugin has to be activated for this to work. - -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%}) " - - - -ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" -ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" - -ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" -ZSH_THEME_SVN_PROMPT_SUFFIX=")" -ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" -ZSH_THEME_SVN_PROMPT_CLEAN=" " \ No newline at end of file diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme deleted file mode 100644 index 5642eaeb8..000000000 --- a/themes/bira.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' -local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' -local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -local git_branch='$(git_prompt_info)%{$reset_color%}' - -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} -╰─%B$%b " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/blinks.zsh-theme b/themes/blinks.zsh-theme deleted file mode 100644 index 3db7012f4..000000000 --- a/themes/blinks.zsh-theme +++ /dev/null @@ -1,20 +0,0 @@ -# https://github.com/blinks zsh theme - -function _prompt_char() { - if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - echo "%{%F{blue}%}±%{%f%k%b%}" - else - echo ' ' - fi -} - -ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -PROMPT='%{%f%k%b%} -%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%} -%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} ' - -RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}' diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme deleted file mode 100644 index bc125c5ce..000000000 --- a/themes/candy.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ -%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/clean.zsh-theme b/themes/clean.zsh-theme deleted file mode 100644 index 7ee29cb8c..000000000 --- a/themes/clean.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi - -PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[yellow]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme deleted file mode 100644 index ad5e2834b..000000000 --- a/themes/cloud.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" -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]%}]" \ No newline at end of file diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme deleted file mode 100644 index 2473cd230..000000000 --- a/themes/crunch.zsh-theme +++ /dev/null @@ -1,37 +0,0 @@ -# CRUNCH - created from Steve Eley's cat waxing. -# Initially hacked from the Dallas theme. Thanks, Dallas Reedy. -# -# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, -# and eschews the standard space-consuming user and hostname info. Instead, only the -# things that vary in my own workflow are shown: -# -# * The time (not the date) -# * The RVM version and gemset (omitting the 'ruby' name if it's MRI) -# * The current directory -# * The Git branch and its 'dirty' state -# -# Colors are at the top so you can mess with those separately if you like. -# For the most part I stuck with Dallas's. - -CRUNCH_BRACKET_COLOR="%{$fg[white]%}" -CRUNCH_TIME_COLOR="%{$fg[yellow]%}" -CRUNCH_RVM_COLOR="%{$fg[magenta]%}" -CRUNCH_DIR_COLOR="%{$fg[cyan]%}" -CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" -CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" -CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" - -# These Git variables are used by the oh-my-zsh git_prompt_info helper: -ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓" -ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" - -# Our elements: -CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" -CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " -CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " - -# Put it all together! -PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" diff --git a/themes/cypher.zsh-theme b/themes/cypher.zsh-theme deleted file mode 100644 index 45df53d22..000000000 --- a/themes/cypher.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -# Based on evan's prompt -# Shows the exit status of the last command if non-zero -# Uses "#" instead of "»" when running with elevated privileges -PROMPT="%m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . ${fg[red]}%? )%{${fg[blue]}%}»%{${reset_color}%} " diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme deleted file mode 100644 index eef32e998..000000000 --- a/themes/dallas.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -# Personalized! - -# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} -DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" -# Grab the current machine name: muscato -DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" -# Grab the current filepath, use shortcuts: ~/Desktop -# Append the current git branch, if in a git repository: ~aw@master -DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" -# Grab the current username: dallas -DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" -# Use a % for normal users and a # for privelaged (root) users. -DALLAS_PROMPT_CHAR_="%{$fg[white]%}%(!.#.%%)%{$reset_color%}" -# For the git prompt, use a white @ and blue text for the branch name -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg[blue]%}" -# Close it all off by resetting the color and styles. -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -# Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="" -# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗" - -# Put it all together! -PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " diff --git a/themes/darkblood.zsh-theme b/themes/darkblood.zsh-theme deleted file mode 100644 index 33508fbd2..000000000 --- a/themes/darkblood.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -# meh. Dark Blood Rewind, a new beginning. - -PROMPT=$'%{$fg[red]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[red]%}@%{$fg_bold[white]%}%m%{$reset_color%}%{$fg[red]%}] [%{$fg_bold[white]%}/dev/%y%{$reset_color%}%{$fg[red]%}] %{$(git_prompt_info)%}%(?,,%{$fg[red]%}[%{$fg_bold[white]%}%?%{$reset_color%}%{$fg[red]%}]) -%{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} ' -PS2=$' %{$fg[red]%}|>%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}[%{$fg_bold[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[red]%}] " -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡%{$reset_color%}" diff --git a/themes/daveverwer.zsh-theme b/themes/daveverwer.zsh-theme deleted file mode 100644 index 89aef926e..000000000 --- a/themes/daveverwer.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -# Copied and modified from the oh-my-zsh theme from geoffgarside -# Red server name, green cwd, blue git status - -PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/themes/dieter.zsh-theme b/themes/dieter.zsh-theme deleted file mode 100644 index 0a5e9265b..000000000 --- a/themes/dieter.zsh-theme +++ /dev/null @@ -1,56 +0,0 @@ -# the idea of this theme is to contain a lot of info in a small string, by -# compressing some parts and colorcoding, which bring useful visual cues, -# while limiting the amount of colors and such to keep it easy on the eyes. -# When a command exited >0, the timestamp will be in red and the exit code -# will be on the right edge. -# The exit code visual cues will only display once. -# (i.e. they will be reset, even if you hit enter a few times on empty command prompts) - -typeset -A host_repr - -# translate hostnames into shortened, colorcoded strings -host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4") - -# local time, color coded by last return code -time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" -time_disabled="%{$fg[green]%}%*%{$reset_color%}" -time=$time_enabled - -# user part, color coded by privileges -local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}" - -# Hostname part. compressed and colorcoded per host_repr array -# if not found, regular hostname in default color -local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}" - -# Compacted $PWD -local pwd="%{$fg[blue]%}%c%{$reset_color%}" - -PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)' - -# i would prefer 1 icon that shows the "most drastic" deviation from HEAD, -# but lets see how this works out -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" - -# elaborate exitcode on the right when >0 -return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -return_code_disabled= -return_code=$return_code_enabled - -RPS1='${return_code}' - -function accept-line-or-clear-warning () { - if [[ -z $BUFFER ]]; then - time=$time_disabled - return_code=$return_code_disabled - else - time=$time_enabled - return_code=$return_code_enabled - fi - zle accept-line -} -zle -N accept-line-or-clear-warning -bindkey '^M' accept-line-or-clear-warning diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme deleted file mode 100644 index f4d65ab74..000000000 --- a/themes/dogenpunk.zsh-theme +++ /dev/null @@ -1,85 +0,0 @@ -# ----------------------------------------------------------------------------- -# FILE: dogenpunk.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Matthew Nelson (dogenpunk@gmail.com) -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- - -MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - -PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) -%{$fg[red]%}%!%{$reset_color%} $(prompt_char) ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -function prompt_char() { - git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return - hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return - echo "%{$fg[cyan]%}◯ %{$reset_color%}" -} - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($COLOR~|" - fi - fi -} diff --git a/themes/dpoggi.zsh-theme b/themes/dpoggi.zsh-theme deleted file mode 100644 index 6469a2009..000000000 --- a/themes/dpoggi.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\ -%{$reset_color%}:%{$fg[magenta]%}%~\ -$(git_prompt_info) \ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme deleted file mode 100644 index 3e2539d57..000000000 --- a/themes/dst.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -function prompt_char { - if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi -} - -PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} -) -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_ $(prompt_char) ' - -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/themes/dstufft.zsh-theme b/themes/dstufft.zsh-theme deleted file mode 100644 index 5a23fcea5..000000000 --- a/themes/dstufft.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - hg root >/dev/null 2>/dev/null && echo 'Hg' && return - echo '○' -} - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) -$(virtualenv_info)$(prompt_char) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme deleted file mode 100644 index 7350b4335..000000000 --- a/themes/duellj.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ - -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}%!%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' -RPROMPT='[%*]' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme deleted file mode 100644 index 83664515a..000000000 --- a/themes/eastwood.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -#RVM settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then - RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" -fi - -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 -} - -PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b ' diff --git a/themes/edvardm.zsh-theme b/themes/edvardm.zsh-theme deleted file mode 100644 index f9ca1a9e2..000000000 --- a/themes/edvardm.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})" diff --git a/themes/evan.zsh-theme b/themes/evan.zsh-theme deleted file mode 100644 index 5ef1f40dd..000000000 --- a/themes/evan.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -# Evan describes this sexy prompt as: "a skinny, topless prompt" -PROMPT='%m :: %2~ %B»%b ' \ No newline at end of file diff --git a/themes/example.zsh-theme b/themes/example.zsh-theme deleted file mode 100644 index dbd9dc9c9..000000000 --- a/themes/example.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt -# - -PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " \ No newline at end of file diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme deleted file mode 100644 index 17cf59708..000000000 --- a/themes/fino.zsh-theme +++ /dev/null @@ -1,39 +0,0 @@ -# Fino theme by Max Masnick (http://max.masnick.me) - -# Use with a dark background and 256-color terminal! -# Meant for people with RVM and git. Tested only on OS X 10.7. - -# You can set your computer name in the ~/.box-name file if you want. - -# Borrowing shamelessly from these oh-my-zsh themes: -# bira -# robbyrussell -# -# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - echo '○' -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - - -local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' -local current_dir='${PWD/#$HOME/~}' -local git_info='$(git_prompt_info)' - - -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} -╰─$(virtualenv_info)$(prompt_char) " - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" \ No newline at end of file diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme deleted file mode 100644 index f9e506cae..000000000 --- a/themes/fishy.zsh-theme +++ /dev/null @@ -1,20 +0,0 @@ -# ZSH Theme emulating the Fish shell's default prompt. - -local user_color='green'; [ $UID -eq 0 ] && user_color='red' -PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' - -local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" -RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" " -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" diff --git a/themes/flazz.zsh-theme b/themes/flazz.zsh-theme deleted file mode 100644 index 280794f2b..000000000 --- a/themes/flazz.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -if [ "$(whoami)" = "root" ] -then CARETCOLOR="red" -else CARETCOLOR="blue" -fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} ' - -RPS1='$(vi_mode_prompt_info) ${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" - -MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}" - -# TODO use 265 colors -#MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}" -# TODO use two lines if git diff --git a/themes/fletcherm.zsh-theme b/themes/fletcherm.zsh-theme deleted file mode 100644 index e96188544..000000000 --- a/themes/fletcherm.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -# Copied from old version of tonotdo's theme. LSCOLORS modified. -PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}⚡%{$fg_bold[blue]%})" - -export LSCOLORS="exfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/fox.zsh-theme b/themes/fox.zsh-theme deleted file mode 100644 index 1959853cf..000000000 --- a/themes/fox.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -#fox theme -PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) -└> % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="-[%{$reset_color%}%{$fg[white]%}git://%{$fg_bold[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[cyan]%}]-" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme deleted file mode 100644 index f181aec90..000000000 --- a/themes/frisk.zsh-theme +++ /dev/null @@ -1,10 +0,0 @@ -PROMPT=$' -%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} -%{$fg_bold[black]%}>%{$reset_color%} ' - -PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/funky.zsh-theme b/themes/funky.zsh-theme deleted file mode 100644 index 2451296d9..000000000 --- a/themes/funky.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -# Taken from Tassilo's Blog -# http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/ - -local blue_op="%{$fg[blue]%}[%{$reset_color%}" -local blue_cp="%{$fg[blue]%}]%{$reset_color%}" -local path_p="${blue_op}%~${blue_cp}" -local user_host="${blue_op}%n@%m${blue_cp}" -local ret_status="${blue_op}%?${blue_cp}" -local hist_no="${blue_op}%h${blue_cp}" -local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})" -PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no} -╰─${blue_op}${smiley}${blue_cp} %# " -local cur_cmd="${blue_op}%_${blue_cp}" -PROMPT2="${cur_cmd}> " \ No newline at end of file diff --git a/themes/fwalch.zsh-theme b/themes/fwalch.zsh-theme deleted file mode 100644 index 24edf55c0..000000000 --- a/themes/fwalch.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$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]%})" diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme deleted file mode 100644 index fce7cb923..000000000 --- a/themes/gallifrey.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme deleted file mode 100644 index 259640ba4..000000000 --- a/themes/gallois.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -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' -fi - -PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' diff --git a/themes/garyblessington.zsh-theme b/themes/garyblessington.zsh-theme deleted file mode 100644 index b4f84a71c..000000000 --- a/themes/garyblessington.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme deleted file mode 100644 index cba143d42..000000000 --- a/themes/gentoo.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=") " diff --git a/themes/geoffgarside.zsh-theme b/themes/geoffgarside.zsh-theme deleted file mode 100644 index 675ec7206..000000000 --- a/themes/geoffgarside.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# PROMPT="[%*] %n:%c $(git_prompt_info)%(!.#.$) " -PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme deleted file mode 100644 index 3c6b8a409..000000000 --- a/themes/gnzh.zsh-theme +++ /dev/null @@ -1,54 +0,0 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png -# Based on bira theme - -# load some modules -autoload -U colors zsh/terminfo # Used in the colour alias below -colors -setopt prompt_subst - -# make some aliases for the colours: (coud use normal escap.seq's too) -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do - eval PR_$color='%{$fg[${(L)color}]%}' -done -eval PR_NO_COLOR="%{$terminfo[sgr0]%}" -eval PR_BOLD="%{$terminfo[bold]%}" - -# Check the UID -if [[ $UID -ge 1000 ]]; then # normal user - eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' - local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' -elif [[ $UID -eq 0 ]]; then # root - eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' - local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' -fi - -# Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then - eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH -else - eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH -fi - -local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" - -local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' -local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi -fi -local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' - -#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} -╰─$PR_PROMPT " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" diff --git a/themes/gozilla.zsh-theme b/themes/gozilla.zsh-theme deleted file mode 100644 index c6b752e9b..000000000 --- a/themes/gozilla.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -RPROMPT='$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" diff --git a/themes/humza.zsh-theme b/themes/humza.zsh-theme deleted file mode 100644 index 107886295..000000000 --- a/themes/humza.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -# ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme - -let TotalBytes=0 -for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }') -do - let TotalBytes=$TotalBytes+$Bytes -done - # should it say b, kb, Mb, or Gb -if [ $TotalBytes -lt 1024 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) - suffix="b" -elif [ $TotalBytes -lt 1048576 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) - suffix="kb" -elif [ $TotalBytes -lt 1073741824 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) - suffix="Mb" -else - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) - suffix="Gb" -fi - -PROMPT='%{$reset_color%}%n %{$fg[green]%}{%{$reset_color%}%~%{$fg[green]%}}%{$reset_color%}$(git_prompt_info) greetings, earthling %{$fg[green]%}[%{$reset_color%}%{$TotalSize%}%{$suffix%}%{$fg[green]%}]%{$fg[red]%}$%{$reset_color%} ☞ ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±(" -ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}" diff --git a/themes/imajes.zsh-theme b/themes/imajes.zsh-theme deleted file mode 100644 index 88c35b6d9..000000000 --- a/themes/imajes.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt -# - -PROMPT="%{$fg[red]%}%%%{$reset_color%} " \ No newline at end of file diff --git a/themes/jbergantine.zsh-theme b/themes/jbergantine.zsh-theme deleted file mode 100644 index d84247cff..000000000 --- a/themes/jbergantine.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%})" diff --git a/themes/jispwoso.zsh-theme b/themes/jispwoso.zsh-theme deleted file mode 100644 index cdfef3871..000000000 --- a/themes/jispwoso.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} -%{$fg_bold[red]%}➜ %{$reset_color%} ' - -PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme deleted file mode 100644 index 7c8a7082e..000000000 --- a/themes/jnrowe.zsh-theme +++ /dev/null @@ -1,31 +0,0 @@ -autoload -U add-zsh-hook -autoload -Uz vcs_info - -zstyle ':vcs_info:*' actionformats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_jnrowe_precmd - -prompt_jnrowe_precmd () { - vcs_info - - if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%F{2}→%f" - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%F{1}▶%f" - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%F{3}▶%f" - else - dir_status="%F{2}▶%f" - fi -} - -local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" - -PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' - -# vim: set ft=zsh ts=4 sw=4 et: diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme deleted file mode 100644 index add485279..000000000 --- a/themes/jonathan.zsh-theme +++ /dev/null @@ -1,137 +0,0 @@ -function precmd { - local TERMWIDTH - (( TERMWIDTH = ${COLUMNS} - 1 )) - - - ### - # Truncate the path if it's too long. - - PR_FILLBAR="" - PR_PWDLEN="" - - local promptsize=${#${(%):---(%n@%m:%l)---()--}} - local rubyprompt=`rvm_prompt_info` - local rubypromptsize=${#${rubyprompt}} - local pwdsize=${#${(%):-%~}} - - if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then - ((PR_PWDLEN=$TERMWIDTH - $promptsize)) - else - PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $rubypromptsize + $pwdsize)))..${PR_HBAR}.)}" - fi - -} - - -setopt extended_glob -preexec () { - if [[ "$TERM" == "screen" ]]; then - local CMD=${1[(wr)^(*=*|sudo|-*)]} - echo -n "\ek$CMD\e\\" - fi -} - - -setprompt () { - ### - # Need this so the prompt will work. - - setopt prompt_subst - - - ### - # See if we can use colors. - - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi - for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do - eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' - eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' - (( count = $count + 1 )) - done - PR_NO_COLOUR="%{$terminfo[sgr0]%}" - - ### - # Modify Git prompt - ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - - ### - # See if we can use extended characters to look nicer. - - typeset -A altchar - set -A altchar ${(s..)terminfo[acsc]} - PR_SET_CHARSET="%{$terminfo[enacs]%}" - PR_SHIFT_IN="%{$terminfo[smacs]%}" - PR_SHIFT_OUT="%{$terminfo[rmacs]%}" - PR_HBAR=${altchar[q]:--} - PR_ULCORNER=${altchar[l]:--} - PR_LLCORNER=${altchar[m]:--} - PR_LRCORNER=${altchar[j]:--} - PR_URCORNER=${altchar[k]:--} - - - ### - # Decide if we need to set titlebar text. - - case $TERM in - xterm*) - PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' - ;; - screen) - PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' - ;; - *) - PR_TITLEBAR='' - ;; - esac - - - ### - # Decide whether to set a screen title - if [[ "$TERM" == "screen" ]]; then - PR_STITLE=$'%{\ekzsh\e\\%}' - else - PR_STITLE='' - fi - - - ### - # Finally, the prompt. - - PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ -$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ -$PR_GREEN%$PR_PWDLEN<...<%~%<<\ -$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ -$PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\ -$PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\ - -$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\ -$PR_YELLOW%D{%H:%M:%S}\ -$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\ -$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ ->$PR_NO_COLOUR ' - - # display exitcode on the right when >0 - return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})" - RPROMPT=' $return_code$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\ -($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR' - - PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\ -$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR ' -} - -setprompt diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme deleted file mode 100644 index 6bed1a70e..000000000 --- a/themes/josh.zsh-theme +++ /dev/null @@ -1,43 +0,0 @@ -grey='\e[0;90m' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" - -function josh_prompt { - (( spare_width = ${COLUMNS} )) - prompt=" " - - branch=$(current_branch) - ruby_version=$(rvm_prompt_info) - path_size=${#PWD} - branch_size=${#branch} - ruby_size=${#ruby_version} - user_machine_size=${#${(%):-%n@%m-}} - - if [[ ${#branch} -eq 0 ]] - then (( ruby_size = ruby_size + 1 )) - else - (( branch_size = branch_size + 4 )) - if [[ -n $(git status -s 2> /dev/null) ]]; then - (( branch_size = branch_size + 2 )) - fi - fi - - (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) - - while [ ${#prompt} -lt $spare_width ]; do - prompt=" $prompt" - done - - prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)" - - echo $prompt -} - -setopt prompt_subst - -PROMPT=' -%n@%m $(josh_prompt) -%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} ' diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme deleted file mode 100644 index 0fa6b4ecd..000000000 --- a/themes/jreese.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png - -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \ -$(git_prompt_info)\ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="⚡" - diff --git a/themes/jtriley.zsh-theme b/themes/jtriley.zsh-theme deleted file mode 100644 index 15d77ed23..000000000 --- a/themes/jtriley.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d -%{$fg_bold[yellow]%}%% %{$reset_color%}" - -#ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})" diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme deleted file mode 100644 index 2f715cc9e..000000000 --- a/themes/juanghurtado.zsh-theme +++ /dev/null @@ -1,46 +0,0 @@ -# ------------------------------------------------------------------------ -# Juan G. Hurtado oh-my-zsh theme -# (Needs Git plugin for current_branch method) -# ------------------------------------------------------------------------ - -# Color shortcuts -RED=$fg[red] -YELLOW=$fg[yellow] -GREEN=$fg[green] -WHITE=$fg[white] -BLUE=$fg[blue] -RED_BOLD=$fg_bold[red] -YELLOW_BOLD=$fg_bold[yellow] -GREEN_BOLD=$fg_bold[green] -WHITE_BOLD=$fg_bold[white] -BLUE_BOLD=$fg_bold[blue] -RESET_COLOR=$reset_color - -# Format for git_prompt_info() -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX="" - -# Format for parse_git_dirty() -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# Format for git_prompt_status() -ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" -ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" -ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" -ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" -ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" -ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" - -# Format for git_prompt_ahead() -ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)" - -# Format for git_prompt_long_sha() and git_prompt_short_sha() -ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}" -ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" - -# Prompt format -PROMPT=' -%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} -%{$BLUE%}>%{$RESET_COLOR%} ' -RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' \ No newline at end of file diff --git a/themes/kardan.zsh-theme b/themes/kardan.zsh-theme deleted file mode 100644 index fd6586a9d..000000000 --- a/themes/kardan.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -# Simple theme based on my old zsh settings. - -function get_host { - echo '@'`hostname`'' -} - -PROMPT='> ' -RPROMPT='%~$(git_prompt_info)$(get_host)' - -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" \ No newline at end of file diff --git a/themes/kennethreitz.zsh-theme b/themes/kennethreitz.zsh-theme deleted file mode 100644 index 109be0c22..000000000 --- a/themes/kennethreitz.zsh-theme +++ /dev/null @@ -1,13 +0,0 @@ -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%c \ -$(git_prompt_info)\ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}" - diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme deleted file mode 100644 index 6e04e1595..000000000 --- a/themes/kolo.zsh-theme +++ /dev/null @@ -1,21 +0,0 @@ -autoload -U colors && colors - -autoload -Uz vcs_info - -zstyle ':vcs_info:*' stagedstr '%F{green}●' -zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' -zstyle ':vcs_info:*' enable git svn -precmd () { - if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { - zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' - } else { - zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' - } - - vcs_info -} - -setopt prompt_subst -PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme deleted file mode 100644 index 0e9b5e73c..000000000 --- a/themes/kphoen.zsh-theme +++ /dev/null @@ -1,50 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: kphoen.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Kévin Gomez (geek63@gmail.com) -# VERSION: 1.0.0 -# SCREENSHOT: -# ------------------------------------------------------------------------------ - - -if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] -%# ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - # display exitcode on the right when >0 - return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - - RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}' - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else - PROMPT='[%n@%m:%~$(git_prompt_info)] -%# ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" on" - ZSH_THEME_GIT_PROMPT_SUFFIX="" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - # display exitcode on the right when >0 - return_code="%(?..%? ↵)" - - RPROMPT='${return_code}$(git_prompt_status)' - - ZSH_THEME_GIT_PROMPT_ADDED=" ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" - ZSH_THEME_GIT_PROMPT_DELETED=" ✖" - ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" -fi diff --git a/themes/lambda.zsh-theme b/themes/lambda.zsh-theme deleted file mode 100644 index 63292d331..000000000 --- a/themes/lambda.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S - -PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " diff --git a/themes/linuxonly b/themes/linuxonly deleted file mode 100644 index a11b80d7f..000000000 --- a/themes/linuxonly +++ /dev/null @@ -1,80 +0,0 @@ -# vim: set ts=2 textwidth=0 - -autoload -U add-zsh-hook -autoload -Uz vcs_info -local c0=$(printf "\033[0m") -local c1=$(printf "\033[38;5;215m") -local c2=$(printf "\033[38;5;209m") -local c3=$(printf "\033[38;5;203m") -local c4=$(printf "\033[33;4m") -local c5=$(printf "\033[38;5;137m") -local c6=$(printf "\033[38;5;240m") -local c7=$(printf "\033[38;5;149m") -local c8=$(printf "\033[38;5;126m") -local c9=$(printf "\033[38;5;162m") - -local foopath=$(perl /home/scp1/bin/foopath) - -if [ "$TERM" = "linux" ]; then - c1=$(printf "\033[34;1m") - c2=$(printf "\033[35m") - c3=$(printf "\033[31m") - c4=$(printf "\033[31;1m") - c5=$(printf "\033[32m") - c6=$(printf "\033[32;1m") - c7=$(printf "\033[33m") - c8=$(printf "\033[33;1m") - c9=$(printf "\033[34m") -fi - -#local newtv=$(perl $HOME/devel/newtv.pl) -local newtv='' - -zstyle ':vcs_info:*' actionformats \ - '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - "%{$c8%}%s%{$c7%}:%{$c7%}(%{$c9%}%b%{$c7%})%f " -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_jnrowe_precmd - -prompt_jnrowe_precmd () { - vcs_info - - if [ "${vcs_info_msg_0_}" = "" ]; then - #dir_status="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f" - #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/" - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})" - - PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} -> ' - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' - - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -%{$c9%}·>%{$c0%} ' - else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' - - fi -} - - -#PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%} -#> ' - -# vim: set ft=zsh ts=4 sw=4 et: - - diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme deleted file mode 100644 index f4045bd8e..000000000 --- a/themes/lukerandall.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc -# Thanks to gallifrey, upon whose theme this is based - -local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" - -function my_git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - GIT_STATUS=$(git_prompt_status) - [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" -ZSH_THEME_GIT_PROMPT_ADDED="+" -ZSH_THEME_GIT_PROMPT_MODIFIED="*" -ZSH_THEME_GIT_PROMPT_RENAMED="~" -ZSH_THEME_GIT_PROMPT_DELETED="!" -ZSH_THEME_GIT_PROMPT_UNMERGED="?" - diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme deleted file mode 100644 index 4eb410233..000000000 --- a/themes/macovsky-ruby.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme deleted file mode 100644 index 4eb410233..000000000 --- a/themes/macovsky.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/maran.zsh-theme b/themes/maran.zsh-theme deleted file mode 100644 index 6fba04688..000000000 --- a/themes/maran.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# Theme with full path names and hostname -# Handy if you work on different servers all the time; -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/themes/mgutz.zsh-theme b/themes/mgutz.zsh-theme deleted file mode 100644 index dcf327041..000000000 --- a/themes/mgutz.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[magenta]%}%1~$(git_prompt_info) %{$fg_bold[magenta]%}%# %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="*]" -ZSH_THEME_GIT_PROMPT_CLEAN="]" diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme deleted file mode 100644 index 943f04d38..000000000 --- a/themes/mikeh.zsh-theme +++ /dev/null @@ -1,23 +0,0 @@ -setopt prompt_subst -autoload colors -colors - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -# check-for-changes can be really slow. -# you should disable it, if you work with large repositories -zstyle ':vcs_info:*:prompt:*' check-for-changes true - -add-zsh-hook precmd mikeh_precmd - -mikeh_precmd() { - vcs_info -} - -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B..[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' \ No newline at end of file diff --git a/themes/miloshadzic.zsh-theme b/themes/miloshadzic.zsh-theme deleted file mode 100644 index ad5394423..000000000 --- a/themes/miloshadzic.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# Yay! High voltage and arrows! - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme deleted file mode 100644 index ee3ab6b22..000000000 --- a/themes/minimal.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" -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 "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} - - -PROMPT='%2~ $(git_custom_status) »%b ' \ No newline at end of file diff --git a/themes/mrtazz.zsh-theme b/themes/mrtazz.zsh-theme deleted file mode 100644 index 214ba5a47..000000000 --- a/themes/mrtazz.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# ' -RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% ' - -ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$fg[green]%}>%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}>" diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme deleted file mode 100644 index 310357b45..000000000 --- a/themes/murilasso.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' -local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}' -local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}' -local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}' - -PROMPT="${user_host}:${current_dir} ${rvm_ruby} -${git_branch} %B$%b " -RPS1="${return_code}" - -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%}" diff --git a/themes/muse.zsh-theme b/themes/muse.zsh-theme deleted file mode 100644 index 4bd8fb825..000000000 --- a/themes/muse.zsh-theme +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env zsh -#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -setopt promptsubst - -autoload -U add-zsh-hook - -PROMPT_SUCCESS_COLOR=$FG[117] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] -PROMPT_PROMPT=$FG[077] -GIT_DIRTY_COLOR=$FG[133] -GIT_CLEAN_COLOR=$FG[118] -GIT_PROMPT_INFO=$FG[012] - -PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} ' - -#RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" diff --git a/themes/nanotech.zsh-theme b/themes/nanotech.zsh-theme deleted file mode 100644 index 5d3331639..000000000 --- a/themes/nanotech.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%F{green}%2c%F{blue} [%f ' -RPROMPT='$(git_prompt_info) %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f' - -ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%f" -ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}*%f" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme deleted file mode 100644 index c49df972e..000000000 --- a/themes/nebirhos.zsh-theme +++ /dev/null @@ -1,17 +0,0 @@ -# Based on robbyrussell's theme, with host and rvm indicators. Example: -# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) - -# Get the current ruby version in use with RVM: -if [ -e ~/.rvm/bin/rvm-prompt ]; then - RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " -fi - -# Get the host name (first 4 chars) -HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c " -GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}" -PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT" - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})" diff --git a/themes/nicoulaj.zsh-theme b/themes/nicoulaj.zsh-theme deleted file mode 100644 index 333aa5e70..000000000 --- a/themes/nicoulaj.zsh-theme +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------ -# Prompt for the Zsh shell: -# * One line. -# * VCS info on the right prompt. -# * Only shows the path on the left prompt by default. -# * Crops the path to a defined length and only shows the path relative to -# the current VCS repository root. -# * Wears a different color wether the last command succeeded/failed. -# * Shows user@hostname if connected through SSH. -# * Shows if logged in as root or not. -# ------------------------------------------------------------------------------ - -# Customizable parameters. -PROMPT_PATH_MAX_LENGTH=30 -PROMPT_DEFAULT_END=❯ -PROMPT_ROOT_END=❯❯❯ -PROMPT_SUCCESS_COLOR=$FG[071] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] - -# Set required options. -setopt promptsubst - -# Load required modules. -autoload -U add-zsh-hook -autoload -Uz vcs_info - -# Add hook for calling vcs_info before each command. -add-zsh-hook precmd vcs_info - -# Set vcs_info parameters. -zstyle ':vcs_info:*' enable hg bzr git -zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos. -zstyle ':vcs_info:*:*' unstagedstr '!' -zstyle ':vcs_info:*:*' stagedstr '+' -zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)" -zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %u%c" -zstyle ':vcs_info:*:*' nvcsformats "%~" "" - -# Define prompts. -PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} " -RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}" diff --git a/themes/norm.zsh-theme b/themes/norm.zsh-theme deleted file mode 100644 index 5f0ad03ee..000000000 --- a/themes/norm.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" diff --git a/themes/obraun.zsh-theme b/themes/obraun.zsh-theme deleted file mode 100644 index 08d137665..000000000 --- a/themes/obraun.zsh-theme +++ /dev/null @@ -1,11 +0,0 @@ -if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" - diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme deleted file mode 100644 index f6e5b324e..000000000 --- a/themes/philips.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi - -PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="*" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' diff --git a/themes/pmcgee.zsh-theme b/themes/pmcgee.zsh-theme deleted file mode 100644 index e4e45c71a..000000000 --- a/themes/pmcgee.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi - -PROMPT=' -%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%} -$(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_no_bold[yellow]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/re5et.zsh-theme b/themes/re5et.zsh-theme deleted file mode 100644 index 5bded76a3..000000000 --- a/themes/re5et.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi - -local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})" - -PROMPT=' -%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info) -%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}' - -RPS1='${return_code} %D - %*' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" diff --git a/themes/rgm.zsh-theme b/themes/rgm.zsh-theme deleted file mode 100644 index 9452a8b0d..000000000 --- a/themes/rgm.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -PROMPT=' -%n@%m %{$fg[cyan]%}%~ -%? $(git_prompt_info)%{$fg_bold[blue]%}%% %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" diff --git a/themes/risto.zsh-theme b/themes/risto.zsh-theme deleted file mode 100644 index cb773a64e..000000000 --- a/themes/risto.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4: -# It might be bash like, but I can't have my co-workers knowing I use zsh -PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme deleted file mode 100644 index c0c5c9c71..000000000 --- a/themes/rixius.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# /|/ Code by Stephen -# /|/ "Rixius" Middleton -# -# name in folder (github) -# ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right. -function collapse_pwd { - echo $(pwd | sed -e "s,^$HOME,~,") -} -function prompt_char { - echo -n "%{$bg[white]%}%{$fg[red]%}" - git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return - echo "≥%{$reset_color%}" -} -RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}" - -PROMPT=' -%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) -$(prompt_char) ' -RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}" diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme deleted file mode 100644 index 318c315bb..000000000 --- a/themes/rkj-repos.zsh-theme +++ /dev/null @@ -1,29 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 - -function hg_prompt_info { - hg prompt --angle-brackets "\ -%{$reset_color%}>\ -%{$reset_color%}>\ -%{$fg[red]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" - -function mygit() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -# alternate prompt with git & hg -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' - diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme deleted file mode 100644 index 81b701e07..000000000 --- a/themes/rkj.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 - -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' - - diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme deleted file mode 100644 index 7b524e82d..000000000 --- a/themes/robbyrussell.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})" diff --git a/themes/simple.zsh-theme b/themes/simple.zsh-theme deleted file mode 100644 index a88d9d72a..000000000 --- a/themes/simple.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_DIRTY=" ✗" -ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" diff --git a/themes/skaro.zsh-theme b/themes/skaro.zsh-theme deleted file mode 100644 index 84b7b11b0..000000000 --- a/themes/skaro.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{$fg_bold[green]%}%h %{$fg[cyan]%}%2~ %{$fg_bold[blue]%}$(git_prompt_info) %{$reset_color%}» ' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})" - diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme deleted file mode 100644 index 7a287523e..000000000 --- a/themes/smt.zsh-theme +++ /dev/null @@ -1,91 +0,0 @@ -# ----------------------------------------------------------------------------- -# FILE: smt.zsh-theme -# DESCRIPTION: oh-my-zsh theme file, based on dogenpunk by Matthew Nelson. -# AUTHOR: Stephen Tudor (stephen@tudorstudio.com -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- - -MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} " - -ZSH_THEME_GIT_PROMPT_PREFIX="|" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -# Format for git_prompt_long_sha() and git_prompt_short_sha() -ZSH_THEME_GIT_PROMPT_SHA_BEFORE="➤ %{$fg_bold[yellow]%}" -ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" - -function prompt_char() { - git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return - hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return - echo "%{$fg[cyan]%}◯%{$reset_color%}" -} - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "[$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}]" - elif [ "$MINUTES" -gt 60 ]; then - echo "[$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}]" - else - echo "[$COLOR${MINUTES}m%{$reset_color%}]" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "[$COLOR~]" - fi - fi -} - -PROMPT=' -%{$fg[blue]%}%m%{$reset_color%} 福 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info) -%{$fg[red]%}%!%{$reset_color%} $(prompt_char) : ' - -RPROMPT='${return_status}$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}' diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme deleted file mode 100644 index 601dbe5d7..000000000 --- a/themes/sorin.zsh-theme +++ /dev/null @@ -1,48 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: sorin.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.2 -# SCREENSHOT: http://i.imgur.com/aipDQ.png -# ------------------------------------------------------------------------------ - - -if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" - local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - - PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else - MODE_INDICATOR="❮❮❮" - local return_status="%(?::⏎)" - - PROMPT='%c$(git_prompt_info) %(!.#.❯) ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" git:" - ZSH_THEME_GIT_PROMPT_SUFFIX="" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - RPROMPT='${return_status}$(git_prompt_status)' - - ZSH_THEME_GIT_PROMPT_ADDED=" ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" - ZSH_THEME_GIT_PROMPT_DELETED=" ✖" - ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" -fi diff --git a/themes/sporty_256.zsh-theme b/themes/sporty_256.zsh-theme deleted file mode 100644 index db0fc4277..000000000 --- a/themes/sporty_256.zsh-theme +++ /dev/null @@ -1,13 +0,0 @@ -# zsh theme requires 256 color enabled terminal -# i.e TERM=xterm-256color -# Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ -# based on robbyrussell's shell but louder! - -PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f -%{$fg_bold[white]%}%# %{$reset_color%}' -RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}|" diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme deleted file mode 100644 index a2583b028..000000000 --- a/themes/steeef.zsh-theme +++ /dev/null @@ -1,100 +0,0 @@ -# prompt style and colors based on Steve Losh's Prose theme: -# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme -# -# vcs_info modifications from Bart Trojanowski's zsh prompt: -# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt -# -# git untracked files modification from Brian Carper: -# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} -PR_GIT_UPDATE=1 - -setopt prompt_subst -autoload colors -colors - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -#use extended color pallete if available -if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then - turquoise="%F{81}" - orange="%F{166}" - purple="%F{135}" - hotpink="%F{161}" - limegreen="%F{118}" -else - turquoise="$fg[cyan]" - orange="$fg[yellow]" - purple="$fg[magenta]" - hotpink="$fg[red]" - limegreen="$fg[green]" -fi - -# enable VCS systems you use -zstyle ':vcs_info:*' enable git svn - -# check-for-changes can be really slow. -# you should disable it, if you work with large repositories -zstyle ':vcs_info:*:prompt:*' check-for-changes true - -# set formats -# %b - branchname -# %u - unstagedstr (see below) -# %c - stagedstr (see below) -# %a - action (e.g. rebase-i) -# %R - repository path -# %S - path in the repository -PR_RST="%{${reset_color}%}" -FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" -FMT_ACTION="(%{$limegreen%}%a${PR_RST})" -FMT_UNSTAGED="%{$orange%}●" -FMT_STAGED="%{$limegreen%}●" - -zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" -zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" -zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" -zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" -zstyle ':vcs_info:*:prompt:*' nvcsformats "" - - -function steeef_preexec { - case "$(history $HISTCMD)" in - *git*) - PR_GIT_UPDATE=1 - ;; - *svn*) - PR_GIT_UPDATE=1 - ;; - esac -} -add-zsh-hook preexec steeef_preexec - -function steeef_chpwd { - PR_GIT_UPDATE=1 -} -add-zsh-hook chpwd steeef_chpwd - -function steeef_precmd { - if [[ -n "$PR_GIT_UPDATE" ]] ; then - # check for untracked files or updated submodules, since vcs_info doesn't - if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - PR_GIT_UPDATE=1 - FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" - else - FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" - fi - zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" - - vcs_info 'prompt' - PR_GIT_UPDATE= - fi -} -add-zsh-hook precmd steeef_precmd - -PROMPT=$' -%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_ -$(virtualenv_info)$ ' diff --git a/themes/sunaku.zsh-theme b/themes/sunaku.zsh-theme deleted file mode 100644 index 440fa90b4..000000000 --- a/themes/sunaku.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -# Git-centric variation of the "fishy" theme. -# See screenshot at http://ompldr.org/vOHcwZg - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?" - -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX=" " -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -local user_color='green' -test $UID -eq 0 && user_color='red' - -PROMPT='%(?..%{$fg_bold[red]%}exit %? -%{$reset_color%})'\ -'%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\ -'$(git_prompt_info)'\ -'%{$fg[$user_color]%}%~%{$reset_color%}'\ -'%(!.#.>) ' - -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme deleted file mode 100644 index 88b371d79..000000000 --- a/themes/sunrise.zsh-theme +++ /dev/null @@ -1,96 +0,0 @@ -#------------------------------------------------------------------------------- -# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) -# Intended to be used with Solarized: http://ethanschoonover.com/solarized -# (Needs Git plugin for current_branch method) -#------------------------------------------------------------------------------- - -# Color shortcuts -R=$fg[red] -G=$fg[green] -M=$fg[magenta] -RB=$fg_bold[red] -YB=$fg_bold[yellow] -BB=$fg_bold[blue] -RESET=$reset_color - -if [ "$(whoami)" = "root" ]; then - PROMPTCOLOR="%{$RB%}" PREFIX="-!-"; -else - PROMPTCOLOR="" PREFIX="---"; -fi - -local return_code="%(?..%{$R%}%? ↵%{$RESET%})" - -# Get the status of the working tree (copied and modified from git.zsh) -custom_git_prompt_status() { - INDEX=$(git status --porcelain 2> /dev/null) - STATUS="" - # Non-staged - if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" - fi - if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" - fi - if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - fi - if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - fi - # Staged - if $(echo "$INDEX" | grep '^D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS" - fi - if $(echo "$INDEX" | grep '^R' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS" - fi - if $(echo "$INDEX" | grep '^M' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS" - fi - if $(echo "$INDEX" | grep '^A' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS" - fi - - if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS" - fi - - echo $STATUS -} - -# get the name of the branch we are on (copied and modified from git.zsh) -function custom_git_prompt() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -# %B sets bold text -PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} " - -ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔" - -ZSH_THEME_GIT_STATUS_PREFIX=" " - -# Staged -ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A" -ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M" -ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R" -ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D" - -# Not-staged -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M" -ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU" diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme deleted file mode 100644 index 16eeb5316..000000000 --- a/themes/superjarin.zsh-theme +++ /dev/null @@ -1,18 +0,0 @@ -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" - -# Grab the current filepath, use shortcuts: ~/Desktop -# Append the current git branch, if in a git repository -JARIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - -# Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}>" - -# Add a yellow ✗ if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}> %{$fg[yellow]%}✗" - -# Put it all together! -PROMPT="$JARIN_CURRENT_RUBY_ $JARIN_CURRENT_LOCA_ " - diff --git a/themes/takashiyoshida.zsh-theme b/themes/takashiyoshida.zsh-theme deleted file mode 100644 index 419a8cf3f..000000000 --- a/themes/takashiyoshida.zsh-theme +++ /dev/null @@ -1,27 +0,0 @@ -# -# PROMPT -# -PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}[' -PROMPT_HOST='%{$fg_bold[cyan]%}%m' -PROMPT_SEPARATOR='%{$reset_color%}:' -PROMPT_DIR='%{$fg_bold[yellow]%}%c' -PROMPT_BRACKET_END='%{$fg_bold[white]%}]' - -PROMPT_USER='%{$fg_bold[white]%}%n' -PROMPT_SIGN='%{$reset_color%}%#' - -GIT_PROMPT_INFO='$(git_prompt_info)' - -# My current prompt looks like: -# [host:current_dir] (git_prompt_info) -# [username]% -PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO} -${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} " - -# -# Git repository -# -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_CLEAN='' diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme deleted file mode 100644 index 73653aca8..000000000 --- a/themes/terminalparty.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -PROMPT='%{$fg[green]%} %% ' -# RPS1='%{$fg[blue]%}%~%{$reset_color%} ' -RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}" - diff --git a/themes/theme_chooser.sh b/themes/theme_chooser.sh deleted file mode 100755 index 2f0760a2b..000000000 --- a/themes/theme_chooser.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/zsh - -# Zsh Theme Chooser by fox (fox91 at anche dot no) -# This program is free software. It comes without any warranty, to -# the extent permitted by applicable law. You can redistribute it -# and/or modify it under the terms of the Do What The Fuck You Want -# To Public License, Version 2, as published by Sam Hocevar. See -# http://sam.zoy.org/wtfpl/COPYING for more details. - -# the zsh script won't take the current enviroment variables :( -ZSH="/usr/share/oh-my-zsh" - -THEMES_DIR="$ZSH/themes" -FAVLIST="${HOME}/.zsh_favlist" -source $ZSH/oh-my-zsh.zsh - -function noyes() { - read "a?$1 [y/N] " - if [[ $a == "N" || $a == "n" || $a = "" ]]; then - return 0 - fi - return 1 -} - -function theme_preview() { - THEME=$1 - THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` - print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color" - source "$THEMES_DIR/$THEME" - print -P $PROMPT -} - -function banner() { - echo - echo "╺━┓┏━┓╻ ╻ ╺┳╸╻ ╻┏━╸┏┳┓┏━╸ ┏━╸╻ ╻┏━┓┏━┓┏━┓┏━╸┏━┓" - echo "┏━┛┗━┓┣━┫ ┃ ┣━┫┣╸ ┃┃┃┣╸ ┃ ┣━┫┃ ┃┃ ┃┗━┓┣╸ ┣┳┛" - echo "┗━╸┗━┛╹ ╹ ╹ ╹ ╹┗━╸╹ ╹┗━╸ ┗━╸╹ ╹┗━┛┗━┛┗━┛┗━╸╹┗╸" - echo -} - -function usage() { - echo "Usage: $0 [options] [theme]" - echo - echo "Options" - echo " -l List available themes" - echo " -s Show all themes" - echo " -h Get this help message" - exit 1 -} - -function list_themes() { - for THEME in $(ls $THEMES_DIR); do - THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//` - echo $THEME_NAME - done -} - -function insert_favlist() { - if grep -q "$THEME_NAME" $FAVLIST 2> /dev/null ; then - echo "Already in favlist" - else - echo $THEME_NAME >> $FAVLIST - echo "Saved to favlist" - fi - -} - -function theme_chooser() { - for THEME in $(ls $THEMES_DIR); do - echo - theme_preview $THEME - echo - if [[ -z $1 ]]; then - noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - insert_favlist $THEME_NAME - echo - fi - done -} - -while getopts ":lhs" Option -do - case $Option in - l ) list_themes ;; - s ) theme_chooser 0 ;; - h ) usage ;; - * ) usage ;; # Default. - esac -done - -if [[ -z $Option ]]; then - if [[ -z $1 ]]; then - banner - echo - theme_chooser - else - theme_preview $1".zsh-theme" - fi -fi diff --git a/themes/theunraveler.zsh-theme b/themes/theunraveler.zsh-theme deleted file mode 100644 index e4bfb79c5..000000000 --- a/themes/theunraveler.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -# Comment - -PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' - -RPROMPT='%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%} $(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" \ No newline at end of file diff --git a/themes/tjkirch.zsh-theme b/themes/tjkirch.zsh-theme deleted file mode 100644 index 446cde724..000000000 --- a/themes/tjkirch.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -function prompt_char { - if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi -} - -PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} -) -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_$(prompt_char) ' - -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/themes/tonotdo.zsh-theme b/themes/tonotdo.zsh-theme deleted file mode 100644 index a6407034c..000000000 --- a/themes/tonotdo.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}➜%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}✗%{$fg_bold[blue]%})" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme deleted file mode 100644 index cba14c42c..000000000 --- a/themes/trapd00r.zsh-theme +++ /dev/null @@ -1,95 +0,0 @@ -# Name: trapd00r zsh theme -# Author: Magnus Woldrich -# -# This theme needs a terminal supporting 256 colors as well as unicode. It also -# needs the script that splits up the current path and makes it fancy as located -# here: https://github.com/trapd00r/utils/blob/master/zsh_path -# -# By default it spans over two lines like so: -# -# scp1@shiva:pts/9-> /home » scp1 (0) -# > -# -# that's user@host:pts/-> splitted path (return status) -# -# If the current directory is a git repository, we span 3 lines; -# -# git❨ master ❩ DIRTY -# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) -# > - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -local c0=$( printf "\e[m") -local c1=$( printf "\e[38;5;245m") -local c2=$( printf "\e[38;5;250m") -local c3=$( printf "\e[38;5;242m") -local c4=$( printf "\e[38;5;197m") -local c5=$( printf "\e[38;5;225m") -local c6=$( printf "\e[38;5;240m") -local c7=$( printf "\e[38;5;242m") -local c8=$( printf "\e[38;5;244m") -local c9=$( printf "\e[38;5;162m") -local c10=$(printf "\e[1m") -local c11=$(printf "\e[38;5;208m\e[1m") -local c12=$(printf "\e[38;5;142m\e[1m") -local c13=$(printf "\e[38;5;196m\e[1m") - - -# We dont want to use the extended colorset in the TTY / VC. -if [ "$TERM" = "linux" ]; then - c1=$( printf "\e[34;1m") - c2=$( printf "\e[35m") - c3=$( printf "\e[31m") - c4=$( printf "\e[31;1m") - c5=$( printf "\e[32m") - c6=$( printf "\e[32;1m") - c7=$( printf "\e[33m") - c8=$( printf "\e[33;1m") - c9=$( printf "\e[34m") - - c11=$(printf "\e[35;1m") - c12=$(printf "\e[36m") - c13=$(printf "\e[31;1m") -fi - -zstyle ':vcs_info:*' actionformats \ - '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' - -zstyle ':vcs_info:*' formats \ - "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " - -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_jnrowe_precmd - -prompt_jnrowe_precmd () { - vcs_info - if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} -> ' - -# modified, to be commited - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -> ' - - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -%{$c13%}>%{$c0%} ' - else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' -fi -} - -# vim: set ft=zsh sw=2 et tw=0: diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme deleted file mode 100644 index 7cb27934d..000000000 --- a/themes/wedisagree.zsh-theme +++ /dev/null @@ -1,107 +0,0 @@ -# On a mac with snow leopard, for nicer terminal colours: - -# - Install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php -# - Download'Terminal-Colours': http://bwaht.net/code/TerminalColours.bundle.zip -# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist) -# - Open Terminal preferences. Go to Settings -> Text -> More -# - Change default colours to your liking. -# -# Here are the colours from Textmate's Monokai theme: -# -# Black: 0, 0, 0 -# Red: 229, 34, 34 -# Green: 166, 227, 45 -# Yellow: 252, 149, 30 -# Blue: 196, 141, 255 -# Magenta: 250, 37, 115 -# Cyan: 103, 217, 240 -# White: 242, 242, 242 - -# Thanks to Steve Losh: http://stevelosh.com/blog/2009/03/candy-colored-terminal/ - -# The prompt - -PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' - -# The right-hand prompt - -RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}' - -# Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name -# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} - -# local time, color coded by last return code -time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" -time_disabled="%{$fg[green]%}%*%{$reset_color%}" -time=$time_enabled - -ZSH_THEME_GIT_PROMPT_PREFIX=" ☁ %{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃ -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁ -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂ -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄ -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊ - -# More symbols to choose from: -# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ -# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ -# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ - -# Determine if we are using a gemset. -function rvm_gemset() { - GEMSET=`rvm gemset list | grep '=>' | cut -b4-` - if [[ -n $GEMSET ]]; then - echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi -} - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($(rvm_gemset)$COLOR~|" - fi - fi -} \ No newline at end of file diff --git a/themes/wezm+.zsh-theme b/themes/wezm+.zsh-theme deleted file mode 100644 index fee3eb08e..000000000 --- a/themes/wezm+.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{${fg_bold[yellow]}%}%n%{$reset_color%}%{${fg[yellow]}%}@%m%{$reset_color%} $(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' -RPROMPT='%{$fg[green]%}%~%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/wezm.zsh-theme b/themes/wezm.zsh-theme deleted file mode 100644 index 1881343b0..000000000 --- a/themes/wezm.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='$(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' -RPROMPT='%{$fg[green]%}%~%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme deleted file mode 100644 index 182d8a34f..000000000 --- a/themes/wuffers.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" - -PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' diff --git a/themes/xiong-chiamiov-plus.zsh-theme b/themes/xiong-chiamiov-plus.zsh-theme deleted file mode 100644 index 095dae290..000000000 --- a/themes/xiong-chiamiov-plus.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/xiong-chiamiov.zsh-theme b/themes/xiong-chiamiov.zsh-theme deleted file mode 100644 index 7c4c2e4f8..000000000 --- a/themes/xiong-chiamiov.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' From 2b2bc3c7789ac8db1a9d6c2c6edf53b87940820a Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 16:34:05 +1100 Subject: [PATCH 117/203] updated for renamed function --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index f97f5b088..bfddb922e 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -2,6 +2,6 @@ ZSH=/usr/share/oh-my-zsh ZSH_THEME="arch-blue" -load_oh_my_zshell(){ +omz_init(){ source $ZSH/oh-my-zsh.zsh } From 50a2b965db8fbb1fa6acd6026aca7c8a05ac1a14 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 16:55:13 +1100 Subject: [PATCH 118/203] tiny updates --- oh-my-zsh.zsh | 19 ++++++++++--------- templates/zshrc.arch-zsh-template | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 9e7e87452..d4f3fe3a0 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,5 +1,6 @@ # Initializes Oh My Zsh -ZSH=${ZSH:-/usr/share/oh-my-zsh/} +ZSH=${ZSH:-/usr/share/oh-my-zsh} +ZSH2=$HOME/.zsh local config_file plugin plugin=${plugin:=()} @@ -7,16 +8,16 @@ plugin=${plugin:=()} # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) -if [[ -d ~/.omz ]]; then - [[ -d ~/.omz/functions ]] && fpath=(~/.omz/functions $fpath) - [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) +if [[ -d $OMZ2 ]]; then + [[ -d $OMZ2/functions ]] && fpath=($OMZ2/functions $fpath) + [[ -d $OMZ2/completion ]] && fpath=($OMZ2/completions $fpath) fi for config_file ($ZSH/lib/*.zsh(N)) source $config_file if [[ -d ~/.omz ]]; then - for config_file (~/.omz/*.zsh(N)) + for config_file ($OMG2/*.zsh(N)) source $config_file fi @@ -24,9 +25,9 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) if [[ -d ~/.omz ]]; then - if [[ -d ~/.omz/plugins ]]; then + if [[ -d $OMZ2/plugins ]]; then for plugin ($plugins) - fpath=(~/.omz/plugins/$plugin $fpath) + fpath=($OMZ2/plugins/$plugin $fpath) fi fi @@ -36,8 +37,8 @@ compinit -i # load plugins for plugin ($plugins); do - if [[ -f ~/.omz/plugins/$plugin/$plugin.plugin.zsh ]]; then - source ~/.omz/plugins/$plugin/$plugin.plugin.zsh + if [[ -f $OMZ2/plugins/$plugin/$plugin.plugin.zsh ]]; then + source $OMZ2/plugins/$plugin/$plugin.plugin.zsh elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index bfddb922e..7f7781c65 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,6 +1,8 @@ ZSH=/usr/share/oh-my-zsh +zstyle :omz:plugins:sprunge add-path on ZSH_THEME="arch-blue" +plugins=(archlinux sprunge) omz_init(){ source $ZSH/oh-my-zsh.zsh From 11362f50dcbd533f150bf56e5935a3cce988b341 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 18:02:12 +1100 Subject: [PATCH 119/203] Improved the git prompt. --- themes/arch-blue.zsh-theme | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/arch-blue.zsh-theme b/themes/arch-blue.zsh-theme index aec2263a4..45a1c49e3 100644 --- a/themes/arch-blue.zsh-theme +++ b/themes/arch-blue.zsh-theme @@ -1,2 +1,7 @@ PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[blue]%}%m:%{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' RPROMPT='$(git_prompt_info)' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 9de9bd7d61eb51aef357c19602445020c31aaf0b Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 20:24:18 +1100 Subject: [PATCH 120/203] fixed a tiny issue --- oh-my-zsh.zsh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index d4f3fe3a0..eb5681f32 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,6 +1,6 @@ # Initializes Oh My Zsh ZSH=${ZSH:-/usr/share/oh-my-zsh} -ZSH2=$HOME/.zsh +OMZ=$HOME/.zsh local config_file plugin plugin=${plugin:=()} @@ -8,16 +8,16 @@ plugin=${plugin:=()} # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) -if [[ -d $OMZ2 ]]; then - [[ -d $OMZ2/functions ]] && fpath=($OMZ2/functions $fpath) - [[ -d $OMZ2/completion ]] && fpath=($OMZ2/completions $fpath) +if [[ -d $OMZ ]]; then + [[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath) + [[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath) fi for config_file ($ZSH/lib/*.zsh(N)) source $config_file if [[ -d ~/.omz ]]; then - for config_file ($OMG2/*.zsh(N)) + for config_file ($OMG/*.zsh(N)) source $config_file fi @@ -25,9 +25,9 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) if [[ -d ~/.omz ]]; then - if [[ -d $OMZ2/plugins ]]; then + if [[ -d $OMZ/plugins ]]; then for plugin ($plugins) - fpath=($OMZ2/plugins/$plugin $fpath) + fpath=($OMZ/plugins/$plugin $fpath) fi fi @@ -37,8 +37,8 @@ compinit -i # load plugins for plugin ($plugins); do - if [[ -f $OMZ2/plugins/$plugin/$plugin.plugin.zsh ]]; then - source $OMZ2/plugins/$plugin/$plugin.plugin.zsh + if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then + source $OMZ/plugins/$plugin/$plugin.plugin.zsh elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi From 0006781932d36fe34cb365acd1cbcb0815741d42 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Wed, 30 Nov 2011 21:55:24 +1100 Subject: [PATCH 121/203] uncommented the awesome $pacman_bin variable --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 5aa54878b..244528049 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -50,7 +50,7 @@ asroot() { } # pacman() { -# pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} + pacman_bin=${commands[pacman-color]:-/usr/bin/pacman} # case $1 in # -S | -S[^sihgl]* | -R* | -U*) asroot $pacman_bin $@ ;; # *) $pacman_bin "$@" ;; From 2c9e83a6dd80f3f414de3a2d98ccfed170d8c44f Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 08:45:22 -0500 Subject: [PATCH 122/203] Fix up .oh-my-zsh.zsh a bit here. OMZ should have be overrideable. --- oh-my-zsh.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index eb5681f32..7382c88ef 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -1,6 +1,6 @@ # Initializes Oh My Zsh ZSH=${ZSH:-/usr/share/oh-my-zsh} -OMZ=$HOME/.zsh +OMZ=${OMZ:-$HOME/.omz} local config_file plugin plugin=${plugin:=()} @@ -16,7 +16,7 @@ fi for config_file ($ZSH/lib/*.zsh(N)) source $config_file -if [[ -d ~/.omz ]]; then +if [[ -d $OMZ ]]; then for config_file ($OMG/*.zsh(N)) source $config_file fi @@ -24,7 +24,7 @@ fi for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) -if [[ -d ~/.omz ]]; then +if [[ -d $OMZ ]]; then if [[ -d $OMZ/plugins ]]; then for plugin ($plugins) fpath=($OMZ/plugins/$plugin $fpath) From 02c31f15152c4a4d3128b189d2bb9f40bc56b0ff Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 08:46:25 -0500 Subject: [PATCH 123/203] ZSH does not need to be explicitly set because oh-my-zsh.zsh sets a default value which is correct. Exposing it is only going to lead to problems when someone modifies it. Also :omz:plugins:sprunge is useless to use, sprunge plugin has long stopped rely on it. --- templates/zshrc.arch-zsh-template | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 7f7781c65..6b2c4c37a 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,6 +1,3 @@ -ZSH=/usr/share/oh-my-zsh - -zstyle :omz:plugins:sprunge add-path on ZSH_THEME="arch-blue" plugins=(archlinux sprunge) From e733352ff1002bd9febd3ff688d73982f87338b1 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 09:24:40 -0500 Subject: [PATCH 124/203] Split out the copy to clipboard functionality into its own function. It is universally useful. --- lib/clipboard.zsh | 10 ++++++++++ plugins/sprunge/sprunge.plugin.zsh | 8 +------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 lib/clipboard.zsh diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh new file mode 100644 index 000000000..7e86814ea --- /dev/null +++ b/lib/clipboard.zsh @@ -0,0 +1,10 @@ +# function to send text to primary and secondary clipboards +sendtoclip() { + if (( $+commands[xclip] )); then + echo -n $@ | xclip -sel primary + echo -n $@ | xclip -sel clipboard + elif (( $+commands[xsel] )); then + echo -n $@ | xsel -ip # primary + echo -n $@ | xsel -ib # clipboard + fi +} diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index d080ff4c7..f1bf38785 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -67,11 +67,5 @@ sprunge() { [[ ! -t 1 ]] && return 0 # copy urls to primary and secondary clipboards - if (( $+commands[xclip] )); then - echo -n $urls | xclip -sel primary - echo -n $urls | xclip -sel clipboard - elif (( $+commands[xsel] )); then - echo -n $urls | xsel -ip # primary - echo -n $urls | xsel -ib # clipboard - fi + sendtoclip $urls } From 70613789093b5bb12ae4264da668a91de2ede73a Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 09:32:49 -0500 Subject: [PATCH 125/203] Slightly condensed sprunge now that sendtoclip is its own function. --- plugins/sprunge/sprunge.plugin.zsh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index f1bf38785..7ccb806bb 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -64,8 +64,5 @@ sprunge() { echo $url # don't copy to clipboad if piped - [[ ! -t 1 ]] && return 0 - - # copy urls to primary and secondary clipboards - sendtoclip $urls + [[ -t 1 ]] && sendtoclip $urls } From 18947ba54e7eabc78b378ea187de971e7cbbfcff Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 10:08:17 -0500 Subject: [PATCH 126/203] Typo in oh-my-zsh.. $OMG should be $OMZ. This breaks loading personalizations. --- oh-my-zsh.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 7382c88ef..c1538cd07 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -17,7 +17,7 @@ for config_file ($ZSH/lib/*.zsh(N)) source $config_file if [[ -d $OMZ ]]; then - for config_file ($OMG/*.zsh(N)) + for config_file ($OMZ/*.zsh(N)) source $config_file fi From 81136dc642ca9064ac22f9e2cc4d1b4d98a4f05e Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 11:42:08 -0500 Subject: [PATCH 127/203] My bad, it was a mistake to remove this line. Sorry for breaking everything. --- templates/zshrc.arch-zsh-template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 6b2c4c37a..a2c63913c 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,3 +1,5 @@ +ZSH=/usr/share/oh-my-zsh + ZSH_THEME="arch-blue" plugins=(archlinux sprunge) From 014ffee924dc82f2c28d9cabcd3c508a8dabc39c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 16:57:47 -0500 Subject: [PATCH 128/203] Add a tmux plugin for some cool interoperability. --- plugins/tmux/tmux.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 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..0ee652f97 --- /dev/null +++ b/plugins/tmux/tmux.plugin.zsh @@ -0,0 +1,17 @@ +# TODO: move elsewhere +IRC=($commands[weechat-curses] $commands[irssi]) + +if (( $+commands[tmux] )); then + [[ -z $TMUX ]] && exec tmux + + if [[ -n $IRC ]]; then + irc() { + if tmux has -t irc >/dev/null; then + tmux switch -t irc + else + TMUX="" tmux new -ds irc $IRC[1] + tmux switch -t irc + fi + } + fi +fi From b52285dca8fcfa616747bf592278ab87560169a3 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 17:00:12 -0500 Subject: [PATCH 129/203] cp should also not correct (man is it annoying) --- lib/correction.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/correction.zsh b/lib/correction.zsh index cab442d08..7a4e3c629 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -2,4 +2,5 @@ setopt correct_all alias man='nocorrect man' alias mv='nocorrect mv' +alias cp='nocorrect cp' alias mkdir='nocorrect mkdir' From 47998e74c4cf7475ece25c37dfcac9ba575534a5 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Wed, 30 Nov 2011 17:20:51 -0500 Subject: [PATCH 130/203] Make "root" in prompt show up in red rather than cyan --- themes/arch-blue.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/arch-blue.zsh-theme b/themes/arch-blue.zsh-theme index 45a1c49e3..747198dae 100644 --- a/themes/arch-blue.zsh-theme +++ b/themes/arch-blue.zsh-theme @@ -1,4 +1,6 @@ -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[blue]%}%m:%{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' +(( EUID == 0 )) && ucolor=red || ucolor=cyan + +PROMPT='%{$fg[$ucolor]%}%n%{$reset_color%}@%{$fg[blue]%}%m:%{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' RPROMPT='$(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" From 41e06d663059c2cfa7d082566864c036bf3bac85 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:01:08 -0500 Subject: [PATCH 131/203] Basic logging implementation --- lib/logging.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/logging.zsh diff --git a/lib/logging.zsh b/lib/logging.zsh new file mode 100644 index 000000000..46f240cf9 --- /dev/null +++ b/lib/logging.zsh @@ -0,0 +1,8 @@ +omz_log_msg() { + [[ ! -d $OMZ ]] && mkdir $OMZ + echo $@ >> $OMZ/omz.log +} + +omzlog() { + less $OMZ/omz.log +} From 2836d2c365fd0549b2d615104e2f3d21dbdbcfee Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:09:48 -0500 Subject: [PATCH 132/203] Log some errors in plugins --- plugins/notfound/notfound.plugin.zsh | 2 ++ plugins/sprunge/sprunge.plugin.zsh | 1 + plugins/tmux/tmux.plugin.zsh | 2 ++ 3 files changed, 5 insertions(+) diff --git a/plugins/notfound/notfound.plugin.zsh b/plugins/notfound/notfound.plugin.zsh index 6ec65c881..eac6bb0b4 100644 --- a/plugins/notfound/notfound.plugin.zsh +++ b/plugins/notfound/notfound.plugin.zsh @@ -20,4 +20,6 @@ if (( $+commands[pkgfile] )); then echo "The command \"$1\" can be found in the following packages:" for p in $pkg; echo " $p" } +else + omz_log_msg "notfound: plugin requires pkgtools" fi diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 7ccb806bb..bb38d23b5 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -26,6 +26,7 @@ except: } else # if we happen to lack python, just report everything as text + omz_log_msg "sprunge: syntax highlighting disabled since python isn't available" sprunge_syntax() { echo 'text' } fi diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 0ee652f97..76f688cf2 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -14,4 +14,6 @@ if (( $+commands[tmux] )); then fi } fi +else + omz_log_mgs "notfound: plugin requires tmux" fi From aa5c0bcf1446075f6c8ec83f77beda9d69d653e8 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:45:19 -0500 Subject: [PATCH 133/203] Rework tmux plugin a bit --- lib/defaults.vim | 3 +++ plugins/tmux/tmux.plugin.zsh | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 lib/defaults.vim diff --git a/lib/defaults.vim b/lib/defaults.vim new file mode 100644 index 000000000..e118085cc --- /dev/null +++ b/lib/defaults.vim @@ -0,0 +1,3 @@ +# Default applications + +IRC=($commands[weechat-curses] $commands[irssi]) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 76f688cf2..eb13a7603 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,8 +1,13 @@ -# TODO: move elsewhere -IRC=($commands[weechat-curses] $commands[irssi]) +# Enable autostarting of tmux with: +# +# zstyle :omz:plugins:tmux autostart on +# if (( $+commands[tmux] )); then - [[ -z $TMUX ]] && exec tmux + local state + + zstyle -a :omz:plugins:autostart state + [[ state == "on" && -z $TMUX ]] && exec tmux if [[ -n $IRC ]]; then irc() { From 9452c2641e4f9c6f1bef43b8acad4c39bf52c67d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:48:35 -0500 Subject: [PATCH 134/203] I think I need to go to sleep... --- lib/{defaults.vim => defaults.zsh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{defaults.vim => defaults.zsh} (100%) diff --git a/lib/defaults.vim b/lib/defaults.zsh similarity index 100% rename from lib/defaults.vim rename to lib/defaults.zsh From 3ee16ddbbc874b54f97af04cc59d8e1b46ae38e1 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:59:26 -0500 Subject: [PATCH 135/203] Rounded some stuff out, add rtorrent support. --- plugins/tmux/tmux.plugin.zsh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index eb13a7603..c15c6d797 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -9,13 +9,26 @@ if (( $+commands[tmux] )); then zstyle -a :omz:plugins:autostart state [[ state == "on" && -z $TMUX ]] && exec tmux + # start an irc client in a tmux session if [[ -n $IRC ]]; then irc() { if tmux has -t irc >/dev/null; then - tmux switch -t irc + [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc else TMUX="" tmux new -ds irc $IRC[1] - tmux switch -t irc + [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc + fi + } + fi + + # start rtorrent in a tmux session + if [[ -n $RTORRENT ]]; then + torrents() { + if tmux has -t torrents >/dev/null; then + [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents + else + TMUX="" tmux new -ds torrents $RTORRENT[1] + [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents fi } fi From 71d41e48e28d2396ab74e21744ef55e7e4249931 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 02:02:14 -0500 Subject: [PATCH 136/203] I swear I already commit this. Well this fixes the plugin. --- plugins/tmux/tmux.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index c15c6d797..734d990d2 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -6,8 +6,8 @@ if (( $+commands[tmux] )); then local state - zstyle -a :omz:plugins:autostart state - [[ state == "on" && -z $TMUX ]] && exec tmux + zstyle -a :omz:plugins:tmux autostart state + [[ $state == "on" && -z $TMUX ]] && exec tmux # start an irc client in a tmux session if [[ -n $IRC ]]; then From 1d573fc920fefad734d1628aa07493b51496c511 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 02:16:48 -0500 Subject: [PATCH 137/203] Restoring ssh-agent, its useful --- plugins/ssh-agent/ssh-agent.plugin.zsh | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 plugins/ssh-agent/ssh-agent.plugin.zsh diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh new file mode 100644 index 000000000..3c911dfe3 --- /dev/null +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -0,0 +1,58 @@ +# INSTRUCTIONS +# +# To enabled agent forwarding support add the following to +# your .zshrc file: +# +# zstyle :omz:plugins:ssh-agent agent-forwarding on +# +# To load multiple identies use the identities style, For +# example: +# +# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github +# +# CREDITS +# +# Based on code from Joseph M. Reagle +# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html +# +# Agent forwarding support based on ideas from +# Florent Thoumie and Jonas Pfenniger + +local _plugin__ssh_env=$HOME/.ssh/environment-$HOST +local _plugin__forwarding + +function _plugin__start_agent() +{ + local -a identities + + # start ssh-agent and setup environment + /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} + chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null + + # load identies + zstyle -a :omz:plugins:ssh-agent identities identities + echo starting... + /usr/bin/ssh-add $HOME/.ssh/${^identities} +} + +# test if agent-forwarding is enabled +zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding +if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then + # Add a nifty symlink for screen/tmux if agent forwarding + [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen + +elif [ -f "${_plugin__ssh_env}" ]; then + # Source SSH settings, if applicable + . ${_plugin__ssh_env} > /dev/null + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + _plugin__start_agent; + } +else + _plugin__start_agent; +fi + +# tidy up after ourselves +unfunction _plugin__start_agent +unset _plugin__forwarding +unset _plugin__ssh_env + From 110465a3204367c3205c5602162101a773a46a2d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 03:14:34 -0500 Subject: [PATCH 138/203] New tmux plugin. Cleaner and general. Read the header to see how to configure it to launch applications. If you want the old irc behaviour, add an alias: alias irc="t irc". --- plugins/tmux/tmux.plugin.zsh | 43 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 734d990d2..ce7e0d5b7 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,37 +1,32 @@ # Enable autostarting of tmux with: -# # zstyle :omz:plugins:tmux autostart on # +# Configure t command to autostart a command like +# this (example for "t irc"): +# zstyle :omz:plugins:cmd irc weechat-curses +# if (( $+commands[tmux] )); then local state + # autoload tmux on start zstyle -a :omz:plugins:tmux autostart state [[ $state == "on" && -z $TMUX ]] && exec tmux - # start an irc client in a tmux session - if [[ -n $IRC ]]; then - irc() { - if tmux has -t irc >/dev/null; then - [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc - else - TMUX="" tmux new -ds irc $IRC[1] - [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc - fi - } - fi + t() { + #load the command from config + zstyle -a :omz:plugins:tmux:cmd $1 cmd + (( $+commands[$cmd] )) || return 127 - # start rtorrent in a tmux session - if [[ -n $RTORRENT ]]; then - torrents() { - if tmux has -t torrents >/dev/null; then - [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents - else - TMUX="" tmux new -ds torrents $RTORRENT[1] - [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents - fi - } - fi + # start the command + if ! tmux has -t $1 2>/dev/null; then + TMUX= tmux new -ds $1 ${cmd-$2} + fi + + # switch or attach depending on if we're inside tmux + [[ -n $TMUX ]] && tmux switch -t $1 \ + || tmux attach -t $1 + } else - omz_log_mgs "notfound: plugin requires tmux" + omz_log_mgs "tmux: plugin requires tmux" fi From eace590260ed6f0aab3f1052c23d8724e6e9a5df Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Thu, 1 Dec 2011 20:57:27 +1100 Subject: [PATCH 139/203] made things safer, VERY bad outcome if it runs with an error, chmod $HOME 600 --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 3c911dfe3..0db85a888 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -27,6 +27,7 @@ function _plugin__start_agent() # start ssh-agent and setup environment /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} + [[ ! -f ${_plugin__ssh_env} ]] && return 1 chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null # load identies @@ -55,4 +56,3 @@ fi unfunction _plugin__start_agent unset _plugin__forwarding unset _plugin__ssh_env - From 1dd3339c824cdd2aefa7344b6e101acdb324251d Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Thu, 1 Dec 2011 23:28:05 +1100 Subject: [PATCH 140/203] --- plugins/ssh-agent/ssh-agent.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 0db85a888..df7efd6a3 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -28,7 +28,8 @@ function _plugin__start_agent() # start ssh-agent and setup environment /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} [[ ! -f ${_plugin__ssh_env} ]] && return 1 - chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null + chmod 600 ${_plugin__ssh_env}; + . ${_plugin__ssh_env} > /dev/null # load identies zstyle -a :omz:plugins:ssh-agent identities identities From bceecbccffe7c8740f4a928e69990a0c20d5c8da Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 09:07:26 -0500 Subject: [PATCH 141/203] Cleaned up ssh-agent. --- plugins/ssh-agent/ssh-agent.plugin.zsh | 60 ++++++++------------------ 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index df7efd6a3..40d78ca26 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -1,59 +1,33 @@ -# INSTRUCTIONS -# -# To enabled agent forwarding support add the following to -# your .zshrc file: -# -# zstyle :omz:plugins:ssh-agent agent-forwarding on -# -# To load multiple identies use the identities style, For -# example: -# -# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github -# -# CREDITS -# -# Based on code from Joseph M. Reagle -# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html -# -# Agent forwarding support based on ideas from -# Florent Thoumie and Jonas Pfenniger +local ssh_env=$HOME/.ssh/environment-$HOST +# local state -local _plugin__ssh_env=$HOME/.ssh/environment-$HOST -local _plugin__forwarding - -function _plugin__start_agent() +function start_agent() { local -a identities # start ssh-agent and setup environment - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} - [[ ! -f ${_plugin__ssh_env} ]] && return 1 - chmod 600 ${_plugin__ssh_env}; - . ${_plugin__ssh_env} > /dev/null + ssh-agent | sed 's/^echo/#echo/' >${ssh_env} + chmod 600 $ssh_env + source $ssh_env >/dev/null # load identies zstyle -a :omz:plugins:ssh-agent identities identities - echo starting... - /usr/bin/ssh-add $HOME/.ssh/${^identities} + ssh-add $HOME/.ssh/${^identities} } # test if agent-forwarding is enabled -zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding -if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then - # Add a nifty symlink for screen/tmux if agent forwarding - [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen +# zstyle -b :omz:plugins:ssh-agent agent-forwarding state -elif [ -f "${_plugin__ssh_env}" ]; then - # Source SSH settings, if applicable - . ${_plugin__ssh_env} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - _plugin__start_agent; - } +# if [[ $state == "yes" && -n "$SSH_AUTH_SOCK" ]]; then +# [[ -L $SSH_AUTH_SOCK ]] || ln -sf $SSH_AUTH_SOCK /tmp/ssh-agent-$USER-screen +if [[ -f $ssh_env ]]; then + source $ssh_env >/dev/null + ps -p $SSH_AGENT_PID >/dev/null || start_agent else - _plugin__start_agent; + start_agent; fi # tidy up after ourselves -unfunction _plugin__start_agent -unset _plugin__forwarding -unset _plugin__ssh_env +unfunction start_agent +# unset state +unset ssh_env From 134a262d650814a044da8be9f5485371efd05753 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 09:14:47 -0500 Subject: [PATCH 142/203] Renamed ssh-agent plugin keychain. --- plugins/keychain/keychain.plugin.zsh | 37 ++++++++++++++++++++++++++ plugins/ssh-agent/ssh-agent.plugin.zsh | 33 ----------------------- 2 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 plugins/keychain/keychain.plugin.zsh delete mode 100644 plugins/ssh-agent/ssh-agent.plugin.zsh diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh new file mode 100644 index 000000000..3edf376a4 --- /dev/null +++ b/plugins/keychain/keychain.plugin.zsh @@ -0,0 +1,37 @@ +local ssh_env=$HOME/.ssh/environment-$HOST + +function start_agent() +{ + local -a identities + + # start ssh-agent and setup environment + ssh-agent | sed 's/^echo/#echo/' >${ssh_env} + chmod 600 $ssh_env + source $ssh_env >/dev/null + + # load identies + zstyle -a :omz:plugins:ssh-agent identities identities + ssh-add $HOME/.ssh/${^identities} +} + +function keychain() { + case $1 in + "start") ;; + "kill") + ssh-agent -k + ;; + esac +} + +zstyle -a :omz:plugins:keychain autostart state +if [[ $state == "on" ]]; then + if [[ -f $ssh_env ]]; then + source $ssh_env >/dev/null + ps -p $SSH_AGENT_PID >/dev/null || start_agent + else + start_agent; + fi +fi + +unfunction start_agent +unset ssh_env diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh deleted file mode 100644 index 40d78ca26..000000000 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ /dev/null @@ -1,33 +0,0 @@ -local ssh_env=$HOME/.ssh/environment-$HOST -# local state - -function start_agent() -{ - local -a identities - - # start ssh-agent and setup environment - ssh-agent | sed 's/^echo/#echo/' >${ssh_env} - chmod 600 $ssh_env - source $ssh_env >/dev/null - - # load identies - zstyle -a :omz:plugins:ssh-agent identities identities - ssh-add $HOME/.ssh/${^identities} -} - -# test if agent-forwarding is enabled -# zstyle -b :omz:plugins:ssh-agent agent-forwarding state - -# if [[ $state == "yes" && -n "$SSH_AUTH_SOCK" ]]; then -# [[ -L $SSH_AUTH_SOCK ]] || ln -sf $SSH_AUTH_SOCK /tmp/ssh-agent-$USER-screen -if [[ -f $ssh_env ]]; then - source $ssh_env >/dev/null - ps -p $SSH_AGENT_PID >/dev/null || start_agent -else - start_agent; -fi - -# tidy up after ourselves -unfunction start_agent -# unset state -unset ssh_env From 534b4ab12ec8719adbfe6af43c9023ec9e5a3010 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 09:20:05 -0500 Subject: [PATCH 143/203] sed in keychain is unnecessary, we can just redirect any output. --- plugins/keychain/keychain.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 3edf376a4..0f233812e 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -5,7 +5,7 @@ function start_agent() local -a identities # start ssh-agent and setup environment - ssh-agent | sed 's/^echo/#echo/' >${ssh_env} + ssh-agent >${ssh_env} chmod 600 $ssh_env source $ssh_env >/dev/null From 1f659b16dbe5338554a413223d5f7cb0de65386e Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 09:26:26 -0500 Subject: [PATCH 144/203] Reworking this plugin to work around a keychain function --- plugins/keychain/keychain.plugin.zsh | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 0f233812e..57175ffef 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -1,6 +1,4 @@ -local ssh_env=$HOME/.ssh/environment-$HOST - -function start_agent() +function keychain_start_agent() { local -a identities @@ -15,23 +13,23 @@ function start_agent() } function keychain() { + local ssh_env=$HOME/.ssh/environment-$HOST + case $1 in - "start") ;; + "start") + if [[ -f $ssh_env ]]; then + source $ssh_env >/dev/null + ps -p $SSH_AGENT_PID >/dev/null || keychain_start_agent + else + keychain_start_agent; + fi + ;; "kill") - ssh-agent -k + echo "Stopping agent" + ssh-agent -k >/dev/null ;; esac } zstyle -a :omz:plugins:keychain autostart state -if [[ $state == "on" ]]; then - if [[ -f $ssh_env ]]; then - source $ssh_env >/dev/null - ps -p $SSH_AGENT_PID >/dev/null || start_agent - else - start_agent; - fi -fi - -unfunction start_agent -unset ssh_env +[[ $state == "on" ]] && keychain start From dffd8a31f7a7fbcf9a23ac430b361fe3439915e6 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 09:36:05 -0500 Subject: [PATCH 145/203] Cleanup after ourselves in keychain --- plugins/keychain/keychain.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 57175ffef..cca7a7f5d 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -26,7 +26,7 @@ function keychain() { ;; "kill") echo "Stopping agent" - ssh-agent -k >/dev/null + ssh-agent -k >/dev/null && [[ -f $ssh_env ]] && rm $ssh_env ;; esac } From b826af0c7bc83a7e46fea3bc1a9cbf4336e83d1b Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 16:40:20 -0500 Subject: [PATCH 146/203] Use zstyle to set the theme --- oh-my-zsh.zsh | 3 +++ templates/zshrc.arch-zsh-template | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index c1538cd07..9334778fe 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -44,6 +44,9 @@ for plugin ($plugins); do fi done +local ZSH_THEME +zstyle -a :omz theme ZSH_THEME + # Load the theme if [ "$ZSH_THEME" = "random" ] then diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index a2c63913c..875de0228 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -1,6 +1,6 @@ ZSH=/usr/share/oh-my-zsh -ZSH_THEME="arch-blue" +zstyle -a :omz theme "arch-blue" plugins=(archlinux sprunge) omz_init(){ From 4cfd94100d6600e0ee00a24c133a1ec05ebd3eb0 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 16:52:54 -0500 Subject: [PATCH 147/203] Update the README --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index df253a705..26c8323d5 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,20 @@ install it: $ cower -dd oh-my-zsh-git ``` -The user must have zsh set as their shell. +First set zsh as your shell. ``` -# chsh -s /bin/zsh +$ chsh -s /bin/zsh ``` -The following needs to be added to the start of the user's `~/.zshrc` -file to activate oh-my-zshell goodness. +Then the following needs to be added to `~/.zshrc` file to activate +oh-my-zshell goodness. - ZSH_THEME="arch-blue" + zstyle :omz:style theme arch-blue plugins=(archlinux sprunge git) - load_oh_my_zshell + omz_init -A skeleton template can be found in +A skeleton template can be found at `/usr/share/oh-my-zsh/templates/user.zsh-template` Customization @@ -43,8 +43,7 @@ Customization - To enable more the plugins, customize the plugins array in your `~/.zshrc` -- To change themes, change the `ZSH_THEME` environment variable in - `~/.zshrc`. +- To change themes, change the `:omg:style` zstyle `~/.zshrc`. If you want to override any of the default behaviour, just add a new file (ending in `.zsh`) into the `~/.omz/` directory. If you have many From 2690c75bd4fc673d816bfd8fb09a71f2291c4c0e Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 16:53:39 -0500 Subject: [PATCH 148/203] s/omg/omz/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26c8323d5..2a2fc079c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Customization - To enable more the plugins, customize the plugins array in your `~/.zshrc` -- To change themes, change the `:omg:style` zstyle `~/.zshrc`. +- To change themes, change the `:omz:style` zstyle `~/.zshrc`. If you want to override any of the default behaviour, just add a new file (ending in `.zsh`) into the `~/.omz/` directory. If you have many From c5e7e332d0a7b6af6bf3c6bb62145a4475d297c8 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 16:55:33 -0500 Subject: [PATCH 149/203] Fix grammar in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a2fc079c..2db29c051 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Customization - To enable more the plugins, customize the plugins array in your `~/.zshrc` -- To change themes, change the `:omz:style` zstyle `~/.zshrc`. +- To change themes, change the `:omz:style` zstyle in `~/.zshrc`. If you want to override any of the default behaviour, just add a new file (ending in `.zsh`) into the `~/.omz/` directory. If you have many From ee56dc4a96e54f0987f78bdd9ad3bf1d44139c72 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 17:43:07 -0500 Subject: [PATCH 150/203] Add error message to keychain. --- plugins/keychain/keychain.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index cca7a7f5d..6fdf99e88 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -28,6 +28,9 @@ function keychain() { echo "Stopping agent" ssh-agent -k >/dev/null && [[ -f $ssh_env ]] && rm $ssh_env ;; + *) + echo "$0: invalid command $1" 2>&1 + ;; esac } From 4bf36130f45e5d1d810221182040c6aee48df227 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Fri, 2 Dec 2011 17:23:42 +1100 Subject: [PATCH 151/203] --- plugins/keychain/keychain.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 6fdf99e88..e599b1992 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -28,6 +28,10 @@ function keychain() { echo "Stopping agent" ssh-agent -k >/dev/null && [[ -f $ssh_env ]] && rm $ssh_env ;; + "status") + [[ -f "$ssh_env" ]] && echo "$0: status is running" \ + || echo "$0: status is stopped" + ;; *) echo "$0: invalid command $1" 2>&1 ;; From 31206870324992b0a0ba2ac8aa5dfa6ba239e378 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Fri, 2 Dec 2011 17:30:52 +1100 Subject: [PATCH 152/203] added in the status sub-function to the keychain function --- plugins/keychain/keychain.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index e599b1992..09e615551 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -1,5 +1,4 @@ -function keychain_start_agent() -{ +function keychain_start_agent() { local -a identities # start ssh-agent and setup environment From 95459c2c11fe200ed4c8273164c46b06ac4286ab Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sat, 3 Dec 2011 00:29:25 +1100 Subject: [PATCH 153/203] --- plugins/keychain/keychain.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 09e615551..6c1b9344f 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -23,7 +23,7 @@ function keychain() { keychain_start_agent; fi ;; - "kill") + "stop") echo "Stopping agent" ssh-agent -k >/dev/null && [[ -f $ssh_env ]] && rm $ssh_env ;; From 814d73f76f89f217a6ed13aff9f0c5f137abe4fd Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sat, 3 Dec 2011 00:31:28 +1100 Subject: [PATCH 154/203] --- plugins/keychain/keychain.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 6c1b9344f..3c1186479 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -7,7 +7,7 @@ function keychain_start_agent() { source $ssh_env >/dev/null # load identies - zstyle -a :omz:plugins:ssh-agent identities identities + zstyle -a :omz:plugins:keychain identities identities ssh-add $HOME/.ssh/${^identities} } From 6d2c7133786cfa1cdf5947a17d2e387c5ebf1674 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 08:32:43 -0500 Subject: [PATCH 155/203] Rename identities variable --- plugins/keychain/keychain.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 6fdf99e88..ca7990620 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -8,7 +8,7 @@ function keychain_start_agent() source $ssh_env >/dev/null # load identies - zstyle -a :omz:plugins:ssh-agent identities identities + zstyle -a :omz:plugins:keychain identities identities ssh-add $HOME/.ssh/${^identities} } From 6705ec98ca729e6b1bc8891ec9a1d6ba12d8823d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 08:36:38 -0500 Subject: [PATCH 156/203] Bad typo. set_theme $theme, not set_theme theme --- oh-my-zsh.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index d235e1fd4..76ebb83c6 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -46,4 +46,4 @@ done local theme zstyle -a :omz:style theme theme -set_theme theme +set_theme $theme From d6cf11f9925df30bf840f23e26bfe0fb835e99a7 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sat, 3 Dec 2011 00:43:43 +1100 Subject: [PATCH 157/203] cleaned up a little bit, also added a space to help with selecting the current path --- themes/arch-blue.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/arch-blue.zsh-theme b/themes/arch-blue.zsh-theme index 747198dae..d05a0700c 100644 --- a/themes/arch-blue.zsh-theme +++ b/themes/arch-blue.zsh-theme @@ -1,6 +1,6 @@ (( EUID == 0 )) && ucolor=red || ucolor=cyan -PROMPT='%{$fg[$ucolor]%}%n%{$reset_color%}@%{$fg[blue]%}%m:%{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' +PROMPT='%{$fg[$ucolor]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%}: %{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' RPROMPT='$(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" From e7acbeada5e6e8094f68dd94b9aca45eab2a4c71 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 09:39:45 -0500 Subject: [PATCH 158/203] Attempt to install omz as a site function instead. --- oh-my-zsh.zsh => oh-my-zsh | 2 ++ templates/zshrc.arch-zsh-template | 9 --------- templates/zshrc.zsh-template | 30 ------------------------------ 3 files changed, 2 insertions(+), 39 deletions(-) rename oh-my-zsh.zsh => oh-my-zsh (98%) delete mode 100644 templates/zshrc.arch-zsh-template delete mode 100644 templates/zshrc.zsh-template diff --git a/oh-my-zsh.zsh b/oh-my-zsh similarity index 98% rename from oh-my-zsh.zsh rename to oh-my-zsh index 76ebb83c6..d7166a74e 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh @@ -1,4 +1,5 @@ # Initializes Oh My Zsh +oh-my-zsh() { ZSH=${ZSH:-/usr/share/oh-my-zsh} OMZ=${OMZ:-$HOME/.omz} @@ -47,3 +48,4 @@ done local theme zstyle -a :omz:style theme theme set_theme $theme +} diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template deleted file mode 100644 index 09f51c8f7..000000000 --- a/templates/zshrc.arch-zsh-template +++ /dev/null @@ -1,9 +0,0 @@ -ZSH=/usr/share/oh-my-zsh - -zstyle :omz:style theme "arch-blue" - -plugins=(archlinux sprunge) - -omz_init() { - source $ZSH/oh-my-zsh.zsh -} diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template deleted file mode 100644 index bbec3a9d2..000000000 --- a/templates/zshrc.zsh-template +++ /dev/null @@ -1,30 +0,0 @@ -# Path to your oh-my-zsh configuration. -ZSH=$HOME/.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/*) -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) - -source $ZSH/oh-my-zsh.zsh - -# Load a theme -# Look in $ZSH/themes/ -set_theme "robbyrussell" -# random_theme - -# Customize to your needs... From c974f24fb5c50f65e99f91423f39db72eb6e50b0 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 09:52:28 -0500 Subject: [PATCH 159/203] This should be interesting. --- oh-my-zsh | 90 ++++++++++++++++++++----------------- templates/user.zsh-template | 4 +- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/oh-my-zsh b/oh-my-zsh index d7166a74e..19a89fdb3 100644 --- a/oh-my-zsh +++ b/oh-my-zsh @@ -1,51 +1,61 @@ -# Initializes Oh My Zsh -oh-my-zsh() { -ZSH=${ZSH:-/usr/share/oh-my-zsh} -OMZ=${OMZ:-$HOME/.omz} +# omz control center -local config_file plugin -plugin=${plugin:=()} +omz() { + ZSH=${ZSH:-/usr/share/oh-my-zsh} + OMZ=${OMZ:-$HOME/.omz} -# add a function path -fpath=($ZSH/functions $ZSH/completions $fpath) + case "$1" in + "start") + local config_file plugin + plugin=${plugin:=()} -if [[ -d $OMZ ]]; then - [[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath) - [[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath) -fi + # add a function path + fpath=($ZSH/functions $ZSH/completions $fpath) -for config_file ($ZSH/lib/*.zsh(N)) - source $config_file + if [[ -d $OMZ ]]; then + [[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath) + [[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath) + fi -if [[ -d $OMZ ]]; then - for config_file ($OMZ/*.zsh(N)) - source $config_file -fi + for config_file ($ZSH/lib/*.zsh(N)) + source $config_file -for plugin ($plugins) - fpath=($ZSH/plugins/$plugin $fpath) + if [[ -d $OMZ ]]; then + for config_file ($OMZ/*.zsh(N)) + source $config_file + fi -if [[ -d $OMZ ]]; then - if [[ -d $OMZ/plugins ]]; then - for plugin ($plugins) - fpath=($OMZ/plugins/$plugin $fpath) - fi -fi + for plugin ($plugins) + fpath=($ZSH/plugins/$plugin $fpath) -# Load and run compinit -autoload -U compinit -compinit -i + if [[ -d $OMZ ]]; then + if [[ -d $OMZ/plugins ]]; then + for plugin ($plugins) + fpath=($OMZ/plugins/$plugin $fpath) + fi + fi -# load plugins -for plugin ($plugins); do - if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then - source $OMZ/plugins/$plugin/$plugin.plugin.zsh - elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh - fi -done + # Load and run compinit + autoload -U compinit + compinit -i -local theme -zstyle -a :omz:style theme theme -set_theme $theme + # load plugins + for plugin ($plugins); do + if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then + source $OMZ/plugins/$plugin/$plugin.plugin.zsh + elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then + source $ZSH/plugins/$plugin/$plugin.plugin.zsh + fi + done + + local theme + zstyle -a :omz:style theme theme + set_theme $theme + ;; + *) + echo "$0: invalid command $1" 2>&1 + ;; + esac } + +# vi: ft=zsh diff --git a/templates/user.zsh-template b/templates/user.zsh-template index 51f3df690..c387d2161 100644 --- a/templates/user.zsh-template +++ b/templates/user.zsh-template @@ -1,7 +1,9 @@ # Check /etc/zsh/zshrc for system defaults. +autoload omz + zstyle :omz:style theme "arch-blue" plugins=(archlinux sprunge git github) -omz_init +omz init From 88b2cd8ad100d838b14ced8af8879f1ad32f1168 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 09:53:12 -0500 Subject: [PATCH 160/203] Fix needs to be named the same as the function --- oh-my-zsh => omz | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename oh-my-zsh => omz (100%) diff --git a/oh-my-zsh b/omz similarity index 100% rename from oh-my-zsh rename to omz From af444231441dc2a07b9b7ed81b531a98c4a68a83 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 09:54:16 -0500 Subject: [PATCH 161/203] Opps, not start, should be init. --- omz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omz b/omz index 19a89fdb3..9022d0c67 100644 --- a/omz +++ b/omz @@ -5,7 +5,7 @@ omz() { OMZ=${OMZ:-$HOME/.omz} case "$1" in - "start") + "init") local config_file plugin plugin=${plugin:=()} From 6363c6cbf0fc1030b5fcb619086370d4112c8ed3 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 11:00:25 -0500 Subject: [PATCH 162/203] We should start documenting things. --- README.md | 3 ++- plugins/archlinux/README.md | 0 plugins/git/README.md | 0 plugins/keychain/README.md | 0 plugins/notfound/README.md | 0 plugins/tmux/README.md | 34 ++++++++++++++++++++++++++++++++++ plugins/tmux/tmux.plugin.zsh | 18 +++++++++++++++++- 7 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 plugins/archlinux/README.md create mode 100644 plugins/git/README.md create mode 100644 plugins/keychain/README.md create mode 100644 plugins/notfound/README.md create mode 100644 plugins/tmux/README.md diff --git a/README.md b/README.md index 2db29c051..3c403b377 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,10 @@ $ chsh -s /bin/zsh Then the following needs to be added to `~/.zshrc` file to activate oh-my-zshell goodness. + autoload omz zstyle :omz:style theme arch-blue plugins=(archlinux sprunge git) - omz_init + omz init A skeleton template can be found at `/usr/share/oh-my-zsh/templates/user.zsh-template` diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/git/README.md b/plugins/git/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/keychain/README.md b/plugins/keychain/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/notfound/README.md b/plugins/notfound/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md new file mode 100644 index 000000000..6da3ef18c --- /dev/null +++ b/plugins/tmux/README.md @@ -0,0 +1,34 @@ +Tmux +==== + +DESCRIPTION TO GO HERE + +Configuration +------------- + +To set a corresponding command to a session name, set a zstyle like +this + + zstyle :omz:plugins:tmux:cmd irc weechat-curses + +This setups up the tmux plugin to start or jump to weechat when `t +irc` is executed. + +The plugin can be configured to start tmux with zsh. To do so, set +this zstyle appropriately. If so, it's ideal to have tmux first in the +plugin array + + zstyle :omz:plugins:tmux autostart on + +Usage +----- + +You can call the `t` function in two ways: + + t session + t session command + +Copyright & License +------------------- + +This plugin is released under the GLP3 diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index ce7e0d5b7..5e39f5792 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,9 +1,25 @@ +# tmux plugin +# Copyright (C) 2011 Simon Gomizelj +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# # Enable autostarting of tmux with: # zstyle :omz:plugins:tmux autostart on # # Configure t command to autostart a command like # this (example for "t irc"): -# zstyle :omz:plugins:cmd irc weechat-curses +# zstyle :omz:plugins:tmux:cmd irc weechat-curses # if (( $+commands[tmux] )); then From cf5be77c2e7d2b89dacb0f3cef28344efae57951 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 12:49:33 -0500 Subject: [PATCH 163/203] Load themes from ~/.omz/themes/ too --- lib/theming.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/theming.zsh b/lib/theming.zsh index 96d93cef2..b5921fcfd 100644 --- a/lib/theming.zsh +++ b/lib/theming.zsh @@ -1,10 +1,13 @@ set_theme() { - source "$ZSH/themes/$1.zsh-theme" + local theme + + theme=({$OMZ,$ZSH}/themes/$1-theme(N)) + source $theme[1] } random_theme() { local themes - themes=($ZSH/themes/*zsh-theme) + themes=($ZSH/themes/*zsh-theme(N)) source "$themes[$RANDOM%$#themes+1]" } From 15892d6e76ffb7a6a92d6cf574a8ae43a679d668 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 12:54:42 -0500 Subject: [PATCH 164/203] Try again. This works. --- lib/theming.zsh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/theming.zsh b/lib/theming.zsh index b5921fcfd..00d77f47b 100644 --- a/lib/theming.zsh +++ b/lib/theming.zsh @@ -1,14 +1,13 @@ set_theme() { - local theme - - theme=({$OMZ,$ZSH}/themes/$1-theme(N)) - source $theme[1] + local themes + themes=({$OMZ,$ZSH}/themes/$1.zsh-theme(N)) + source $themes[1] } random_theme() { local themes - themes=($ZSH/themes/*zsh-theme(N)) - source "$themes[$RANDOM%$#themes+1]" + themes=({$OMZ,$ZSH}/themes/*.zsh-theme(N)) + source $themes[$RANDOM%$#themes+1] } # compdef "_files -g '*.zsh'" set_theme From f8da14421c6bf85ce949236c445aafa60181309a Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 2 Dec 2011 18:38:32 -0500 Subject: [PATCH 165/203] Identify why this hangs. --- plugins/tmux/tmux.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 5e39f5792..dea9e4c9a 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -35,7 +35,8 @@ if (( $+commands[tmux] )); then (( $+commands[$cmd] )) || return 127 # start the command - if ! tmux has -t $1 2>/dev/null; then + # if ! tmux has -t $1 2>/dev/null; then + if ! tmux has -t $1; then TMUX= tmux new -ds $1 ${cmd-$2} fi From dbbcc0837d5f10b35f6c7757953bf4e4460c637a Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 4 Dec 2011 01:08:49 +1100 Subject: [PATCH 166/203] --- plugins/colorizer/colorizer.plugin.zsh | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 plugins/colorizer/colorizer.plugin.zsh diff --git a/plugins/colorizer/colorizer.plugin.zsh b/plugins/colorizer/colorizer.plugin.zsh new file mode 100644 index 000000000..16f8267c8 --- /dev/null +++ b/plugins/colorizer/colorizer.plugin.zsh @@ -0,0 +1,42 @@ +# This plugin is in the making, no need to start it. +# The point of this plugin is so we can use our own $fg replacements that respect customization! +# +# A method to get/collect escape codes from #RRGGBB hex needs to be added but only used to gather the escape codes. ( should be two-way. ) +__colors=(cyan white yellow magenta black blue red default grey green) +_ecolors=("\e[36m" "\e[37m" "\e[33m" "\e[35m" "\e[30m" "\e[34m" "\e[31m" "\e[39m" "\e[30m" "\e[32m") +# This is just an easy way to show all the colors. +echo ${^_ecolors}t + +## Extracted from my .Xdefaults; want to merge these colors into the terminal; TODO: Create a method/function to convert the #RRGGBB into an escapable character for strings! +#!--[Colours]--! +#! black +#URxvt*color0: #000000 +#URxvt*color8: #999999 +# +#! red +#URxvt*color1: #BD484A +#URxvt*color9: #F55D60 +# +#! green +#!URxvt*color2: #66994E +#!URxvt*color10: #93DB6F +# +#! yellow +#URxvt*color3: #C4A043 +#URxvt*color11: #F0C452 +# +#! blue +#URxvt*color4: #567B94 +#URxvt*color12: #7CB2D6 +# +#! magenta +#URxvt*color5: #BB88DD +#URxvt*color13: #D7AFD7 +# +#! cyan +#URxvt*color6: #00BBDD +#URxvt*color14: #0DEBFF +# +#! white +#URxvt*color7: #C7C7C7 +#URxvt*color15: #D9D9D9 From f95fded0c604c79b72d6dda2fce32eb1d54a7abd Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 4 Dec 2011 13:54:03 +1100 Subject: [PATCH 167/203] moved around some files, going to make them sub-plugins --- plugins/archlinux/aur-helpers/aur-helper-cower.zsh | 1 - plugins/archlinux/aur-helpers/aur-helper-meat.zsh | 0 2 files changed, 1 deletion(-) delete mode 100644 plugins/archlinux/aur-helpers/aur-helper-cower.zsh delete mode 100644 plugins/archlinux/aur-helpers/aur-helper-meat.zsh diff --git a/plugins/archlinux/aur-helpers/aur-helper-cower.zsh b/plugins/archlinux/aur-helpers/aur-helper-cower.zsh deleted file mode 100644 index 229af7653..000000000 --- a/plugins/archlinux/aur-helpers/aur-helper-cower.zsh +++ /dev/null @@ -1 +0,0 @@ -alias cower='cower --color=auto' diff --git a/plugins/archlinux/aur-helpers/aur-helper-meat.zsh b/plugins/archlinux/aur-helpers/aur-helper-meat.zsh deleted file mode 100644 index e69de29bb..000000000 From abf0d0d849459dc8fe6194e5d43e4803b0c3d528 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 4 Dec 2011 23:59:08 +1100 Subject: [PATCH 168/203] Added directory session-starter for tmux. --- plugins/tmux/tmux.plugin.zsh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index dea9e4c9a..6d7252e61 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -21,6 +21,9 @@ # this (example for "t irc"): # zstyle :omz:plugins:tmux:cmd irc weechat-curses # +# Another example would be to start a new session in a directory. (example for "t git") +# zstyle :omz:plugins:tmux:dir git $HOME/github +# if (( $+commands[tmux] )); then local state @@ -30,14 +33,17 @@ if (( $+commands[tmux] )); then [[ $state == "on" && -z $TMUX ]] && exec tmux t() { - #load the command from config + # Load the command or directory-path from config. zstyle -a :omz:plugins:tmux:cmd $1 cmd - (( $+commands[$cmd] )) || return 127 + zstyle -a :omz:plugins:tmux:dir $1 dir + (( $+commands[$cmd] )) || [[ -d $dir ]] || return 127 # start the command # if ! tmux has -t $1 2>/dev/null; then if ! tmux has -t $1; then - TMUX= tmux new -ds $1 ${cmd-$2} + # It would be nice to hide the message about set changing the default-path. + [[ -d $dir ]] && (cd $dir && tmux new -s $1 \; set default-path ${dir}) + (( $+commands[$cmd] )) && TMUX= tmux new -ds $1 ${cmd-$2} fi # switch or attach depending on if we're inside tmux From a05cd807ac5df4ed243b615beb97e3bf3f7b7162 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 00:00:54 +1100 Subject: [PATCH 169/203] Fixed a tiny issue, now we use sub-plugins for aur-helpers; Documentation will come very soon. --- plugins/archlinux/archlinux.plugin.zsh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 244528049..a2fbc0cf0 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -56,7 +56,3 @@ asroot() { # *) $pacman_bin "$@" ;; # esac # } - -# TODO There needs to be a better way to support this -[[ -x /usr/bin/cower ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-cower.zsh -[[ -x /usr/bin/meat ]] && source $ZSH/plugins/archlinux/aur-helpers/aur-helper-meat.zsh From 1dbb3202464e1516ef8f4e0162d9f6b1e37c98fa Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 00:04:34 +1100 Subject: [PATCH 170/203] These dirs and files were meant to be already commited :/ --- plugins/archlinux/cower/cower.plugin.zsh | 1 + plugins/archlinux/meat/meat.plugin.zsh | 0 2 files changed, 1 insertion(+) create mode 100644 plugins/archlinux/cower/cower.plugin.zsh create mode 100644 plugins/archlinux/meat/meat.plugin.zsh diff --git a/plugins/archlinux/cower/cower.plugin.zsh b/plugins/archlinux/cower/cower.plugin.zsh new file mode 100644 index 000000000..229af7653 --- /dev/null +++ b/plugins/archlinux/cower/cower.plugin.zsh @@ -0,0 +1 @@ +alias cower='cower --color=auto' diff --git a/plugins/archlinux/meat/meat.plugin.zsh b/plugins/archlinux/meat/meat.plugin.zsh new file mode 100644 index 000000000..e69de29bb From bfa7e7829c37bd012088c55d4b6139759ba70c43 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 00:12:02 +1100 Subject: [PATCH 171/203] Added support for sub-modules. --- omz | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/omz b/omz index 9022d0c67..fde19a10b 100644 --- a/omz +++ b/omz @@ -41,10 +41,11 @@ omz() { # load plugins for plugin ($plugins); do - if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then - source $OMZ/plugins/$plugin/$plugin.plugin.zsh - elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh + plugin_sub=$(echo $plugin|cut -d'/' -f2) + if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh + elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh fi done From 468d75e974664b0289ea4bd5ae9227ede96e85bc Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 00:16:21 +1100 Subject: [PATCH 172/203] added a note in the readme for this sub-plugin awesomenss! --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3c403b377..24b1cb5c7 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Customization - To enable more the plugins, customize the plugins array in your `~/.zshrc` - To change themes, change the `:omz:style` zstyle in `~/.zshrc`. +- To use sub-plugins simply add plugin/sub-plugin; example, archlinux/cower If you want to override any of the default behaviour, just add a new file (ending in `.zsh`) into the `~/.omz/` directory. If you have many From 377329a862697f2a39943418db440e0530d7888d Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 00:27:33 +1100 Subject: [PATCH 173/203] Added a link to my .zshrc as another example --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 24b1cb5c7..e276eed33 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,4 @@ The [refcard][] is pretty tasty for tips. [oh-my-zsh-git]: https://aur.archlinux.org/packages.php?ID=54375 [cower]: https://github.com/falconindy/cower [refcard]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf + [example.zshrc] http://sprunge.us/AgXc -- James' .zshrc From 31b73808b4fd18f6082576820acbb11a1a867bde Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Sun, 4 Dec 2011 12:10:32 -0500 Subject: [PATCH 174/203] If cmd isn't specified in either the zstyle or $2, default to $SHELL. If dir is set, change the directory prior to starting tmux to change the working directory. --- plugins/tmux/tmux.plugin.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 6d7252e61..12672a68e 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -34,16 +34,17 @@ if (( $+commands[tmux] )); then t() { # Load the command or directory-path from config. - zstyle -a :omz:plugins:tmux:cmd $1 cmd + zstyle -a :omz:plugins:tmux:cmd $1 cmd; cmd=${cmd:-$2} zstyle -a :omz:plugins:tmux:dir $1 dir - (( $+commands[$cmd] )) || [[ -d $dir ]] || return 127 + [[ -n $cmd ]] && (( ! $+commands[$cmd] )) && return 127 # start the command # if ! tmux has -t $1 2>/dev/null; then if ! tmux has -t $1; then - # It would be nice to hide the message about set changing the default-path. - [[ -d $dir ]] && (cd $dir && tmux new -s $1 \; set default-path ${dir}) - (( $+commands[$cmd] )) && TMUX= tmux new -ds $1 ${cmd-$2} + ( + [[ -d $dir ]] && cd $dir + TMUX= tmux new -ds $1 ${cmd:-$SHELL} + ) fi # switch or attach depending on if we're inside tmux From 8391a9b5601fdf507472452fff5e9b2216273ae4 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Sun, 4 Dec 2011 12:16:35 -0500 Subject: [PATCH 175/203] James you need to learn how to write markdown :P. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e276eed33..1297268c7 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ oh-my-zshell goodness. A skeleton template can be found at `/usr/share/oh-my-zsh/templates/user.zsh-template` +Here's some example configs: + +- James' example: [example.zshrc][] + Customization ============= @@ -66,4 +70,4 @@ The [refcard][] is pretty tasty for tips. [oh-my-zsh-git]: https://aur.archlinux.org/packages.php?ID=54375 [cower]: https://github.com/falconindy/cower [refcard]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf - [example.zshrc] http://sprunge.us/AgXc -- James' .zshrc + [example.zshrc]: http://sprunge.us/AgXc From c15ce20b304deddd0b6de75fde7866b5da7c71e3 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Sun, 4 Dec 2011 12:20:08 -0500 Subject: [PATCH 176/203] Relicenced. --- plugins/tmux/tmux.plugin.zsh | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 12672a68e..8f8ae0a76 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,29 +1,13 @@ # tmux plugin # Copyright (C) 2011 Simon Gomizelj # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Enable autostarting of tmux with: -# zstyle :omz:plugins:tmux autostart on -# -# Configure t command to autostart a command like -# this (example for "t irc"): -# zstyle :omz:plugins:tmux:cmd irc weechat-curses -# -# Another example would be to start a new session in a directory. (example for "t git") -# zstyle :omz:plugins:tmux:dir git $HOME/github -# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: if (( $+commands[tmux] )); then local state From abb32b020900ddf4eb180e1c78034bcbe6778f9c Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 23:17:28 +1100 Subject: [PATCH 177/203] made some things more slimmer, and faster --- omz | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/omz b/omz index fde19a10b..9f8c1564f 100644 --- a/omz +++ b/omz @@ -25,21 +25,25 @@ omz() { source $config_file fi + # for plugin ($plugins) + # fpath=($ZSH/plugins/$plugin $fpath) + + # if [[ -d $OMZ ]]; then + # if [[ -d $OMZ/plugins ]]; then + # for plugin ($plugins) + # fpath=($OMZ/plugins/$plugin $fpath) + # fi + # fi + for plugin ($plugins) - fpath=($ZSH/plugins/$plugin $fpath) + [[ -d $OMZ/plugins/$plugin ]] && fpath=($OMZ/plugins/$plugin $fpath) && continue || \ + [[ -d $ZSH/plugins/$plugin ]] && fpath=($ZSH/plugins/$plugin $fpath) || omz_log_msg "$plugin not found." - if [[ -d $OMZ ]]; then - if [[ -d $OMZ/plugins ]]; then - for plugin ($plugins) - fpath=($OMZ/plugins/$plugin $fpath) - fi - fi - - # Load and run compinit + # Load and run compinit autoload -U compinit compinit -i - # load plugins + # load plugins (TODO: Make this slimmer and better) for plugin ($plugins); do plugin_sub=$(echo $plugin|cut -d'/' -f2) if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then From 198d57d788995731c73d4a6037a1c3e1b7be1903 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Mon, 5 Dec 2011 23:22:31 +1100 Subject: [PATCH 178/203] same as last commit, but more! plugin sourcing. --- omz | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/omz b/omz index 9f8c1564f..e712d84b3 100644 --- a/omz +++ b/omz @@ -44,14 +44,15 @@ omz() { compinit -i # load plugins (TODO: Make this slimmer and better) - for plugin ($plugins); do - plugin_sub=$(echo $plugin|cut -d'/' -f2) - if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh - elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh - fi - done + for plugin ($fpath/*.plugin.zsh(N)) source $plugin + # for plugin ($plugins); do + # plugin_sub=$(echo $plugin|cut -d'/' -f2) + # if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + # source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh + # elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + # source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh + # fi + # done local theme zstyle -a :omz:style theme theme From c214d08b1b329d6657128535cb856dc1750f3afe Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Tue, 6 Dec 2011 00:30:51 +1100 Subject: [PATCH 179/203] This works, although one-liner in the making. --- omz | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/omz b/omz index e712d84b3..890b6396b 100644 --- a/omz +++ b/omz @@ -44,15 +44,15 @@ omz() { compinit -i # load plugins (TODO: Make this slimmer and better) - for plugin ($fpath/*.plugin.zsh(N)) source $plugin - # for plugin ($plugins); do - # plugin_sub=$(echo $plugin|cut -d'/' -f2) - # if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - # source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh - # elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - # source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh - # fi - # done + # for plugin ($fpath/*.plugin.zsh(N)) source $plugin + for plugin ($plugins); do + plugin_sub=$(echo $plugin|cut -d'/' -f2) + if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh + elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh + fi + done local theme zstyle -a :omz:style theme theme From e50b14bd3a80dc61e7457c2b0b67e707c18c2f0c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 5 Dec 2011 08:34:26 -0500 Subject: [PATCH 180/203] Fixed the for loop --- omz | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/omz b/omz index 890b6396b..531e31655 100644 --- a/omz +++ b/omz @@ -35,9 +35,10 @@ omz() { # fi # fi - for plugin ($plugins) + for plugin ($plugins); do [[ -d $OMZ/plugins/$plugin ]] && fpath=($OMZ/plugins/$plugin $fpath) && continue || \ [[ -d $ZSH/plugins/$plugin ]] && fpath=($ZSH/plugins/$plugin $fpath) || omz_log_msg "$plugin not found." + done # Load and run compinit autoload -U compinit From 599e4fef55cb8bdaa8abf6768a746ddc14cc1ef8 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 5 Dec 2011 08:36:55 -0500 Subject: [PATCH 181/203] Use basename, formatting. --- omz | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/omz b/omz index 531e31655..734473e64 100644 --- a/omz +++ b/omz @@ -47,11 +47,11 @@ omz() { # load plugins (TODO: Make this slimmer and better) # for plugin ($fpath/*.plugin.zsh(N)) source $plugin for plugin ($plugins); do - plugin_sub=$(echo $plugin|cut -d'/' -f2) - if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then + plugin_sub=$(basename $plugin) + if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh + source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh fi done From c1c11f01a7478149cdd94a5afb4e9a483f161ebc Mon Sep 17 00:00:00 2001 From: jamesm-sitegen Date: Tue, 6 Dec 2011 00:37:52 +1100 Subject: [PATCH 182/203] Cleaned up plugin_sub --- omz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omz b/omz index 890b6396b..697369fca 100644 --- a/omz +++ b/omz @@ -46,7 +46,7 @@ omz() { # load plugins (TODO: Make this slimmer and better) # for plugin ($fpath/*.plugin.zsh(N)) source $plugin for plugin ($plugins); do - plugin_sub=$(echo $plugin|cut -d'/' -f2) + plugin_sub=$(basename $plugin) if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then From b9819961eae69c3e4a58ac6bd0bebab6b00996a0 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 5 Dec 2011 09:06:17 -0500 Subject: [PATCH 183/203] Cleaner plugin finder. --- omz | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omz b/omz index 734473e64..62c3c88da 100644 --- a/omz +++ b/omz @@ -36,8 +36,8 @@ omz() { # fi for plugin ($plugins); do - [[ -d $OMZ/plugins/$plugin ]] && fpath=($OMZ/plugins/$plugin $fpath) && continue || \ - [[ -d $ZSH/plugins/$plugin ]] && fpath=($ZSH/plugins/$plugin $fpath) || omz_log_msg "$plugin not found." + files=({$OMZ,$ZSH}/plugins/$plugin(N)) + [[ -n $files[1] ]] && fpath=($files[1] $fpath) || omz_log_msg "$plugin not found." done # Load and run compinit From 6b6a4216bf1a6cc8a965b26843a502ec62111fb9 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 5 Dec 2011 09:40:03 -0500 Subject: [PATCH 184/203] This should be the bare minimum needed. Nothing bad will happen if a blank variable gets added to fpath or sourced. We don't need to check if its a file either since the globbing would already only return a file. --- omz | 49 ++++++++++++------------------------------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/omz b/omz index 33c0199c4..e2026a23c 100644 --- a/omz +++ b/omz @@ -9,50 +9,25 @@ omz() { local config_file plugin plugin=${plugin:=()} - # add a function path - fpath=($ZSH/functions $ZSH/completions $fpath) + # add a function path + fpath=({$ZSH,$OMZ}/functions(N) {$ZSH,$OMZ}/completions(N) $fpath) - if [[ -d $OMZ ]]; then - [[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath) - [[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath) - fi - - for config_file ($ZSH/lib/*.zsh(N)) - source $config_file - - if [[ -d $OMZ ]]; then - for config_file ($OMZ/*.zsh(N)) - source $config_file - fi - - # for plugin ($plugins) - # fpath=($ZSH/plugins/$plugin $fpath) - - # if [[ -d $OMZ ]]; then - # if [[ -d $OMZ/plugins ]]; then - # for plugin ($plugins) - # fpath=($OMZ/plugins/$plugin $fpath) - # fi - # fi - - for plugin ($plugins); do - files=({$OMZ,$ZSH}/plugins/$plugin(N)) - [[ -n $files[1] ]] && fpath=($files[1] $fpath) || omz_log_msg "$plugin not found." - done + # add plugins to fpath + for plugin ($plugins) + fpath=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N)) # Load and run compinit autoload -U compinit compinit -i - # load plugins (TODO: Make this slimmer and better) - # for plugin ($fpath/*.plugin.zsh(N)) source $plugin + # load lib + for config_file ({$ZSH/lib,$OMZ}/*.zsh(N)) + source $config_file + + # load plugins for plugin ($plugins); do - plugin_sub=$(basename $plugin) - if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh - elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then - source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh - fi + files=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N)) + source $files[1] || omz_log_msg "$plugin not found." done local theme From d872d12e768a4f7a7b5e92aa70790f430d5fa888 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 6 Dec 2011 17:07:07 +1100 Subject: [PATCH 185/203] testing --- omz | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/omz b/omz index e2026a23c..740a412c8 100644 --- a/omz +++ b/omz @@ -13,8 +13,10 @@ omz() { fpath=({$ZSH,$OMZ}/functions(N) {$ZSH,$OMZ}/completions(N) $fpath) # add plugins to fpath - for plugin ($plugins) - fpath=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N)) + for plugin ($plugins); do + files=({$OMZ,$ZSH}/plugins/$plugin) + fpath+=$files[1] + done # Load and run compinit autoload -U compinit @@ -26,7 +28,7 @@ omz() { # load plugins for plugin ($plugins); do - files=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N)) + files=({$OMZ,$ZSH}/plugins/$plugin/$(basename $plugin).plugin.zsh(N)) source $files[1] || omz_log_msg "$plugin not found." done From e84536c6aa68529e1264b57a887b8e068ad75c9a Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 6 Dec 2011 17:26:01 +1100 Subject: [PATCH 186/203] Fixed some things in the last commit; and also made it possible to run sections of the omz init after the initial init. eg, omz plugins; omz theme my-custom-theme --- omz | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/omz b/omz index 740a412c8..a6e4a39eb 100644 --- a/omz +++ b/omz @@ -25,16 +25,20 @@ omz() { # load lib for config_file ({$ZSH/lib,$OMZ}/*.zsh(N)) source $config_file - + omz plugin + omz theme + ;; + "plugin") # load plugins for plugin ($plugins); do files=({$OMZ,$ZSH}/plugins/$plugin/$(basename $plugin).plugin.zsh(N)) source $files[1] || omz_log_msg "$plugin not found." done - + ;; + "theme") local theme zstyle -a :omz:style theme theme - set_theme $theme + set_theme ${2:-$theme} ;; *) echo "$0: invalid command $1" 2>&1 From 1234fac27fa313a15e56d7e34615cba4f269a968 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 6 Dec 2011 17:38:45 +1100 Subject: [PATCH 187/203] more consistaint --- omz | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/omz b/omz index a6e4a39eb..4ca3fbe9d 100644 --- a/omz +++ b/omz @@ -15,7 +15,7 @@ omz() { # add plugins to fpath for plugin ($plugins); do files=({$OMZ,$ZSH}/plugins/$plugin) - fpath+=$files[1] + fpath=($files[1] $fpath) done # Load and run compinit @@ -38,7 +38,8 @@ omz() { "theme") local theme zstyle -a :omz:style theme theme - set_theme ${2:-$theme} + [[ -f {$OMZ,$ZSH}/themes/$2.zsh-theme(N) ]] && theme=$2 || omz_log_msg "Theme: $2 not found." + set_theme $theme ;; *) echo "$0: invalid command $1" 2>&1 From 1c950ceb91eb5b5623376cea3745873d38fc9751 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 6 Dec 2011 17:46:35 +1100 Subject: [PATCH 188/203] fixed a little bug, could be re-implemented and fixed, but for now; removed --- omz | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/omz b/omz index 4ca3fbe9d..6f80ea3af 100644 --- a/omz +++ b/omz @@ -38,8 +38,7 @@ omz() { "theme") local theme zstyle -a :omz:style theme theme - [[ -f {$OMZ,$ZSH}/themes/$2.zsh-theme(N) ]] && theme=$2 || omz_log_msg "Theme: $2 not found." - set_theme $theme + set_theme ${2:-$theme} ;; *) echo "$0: invalid command $1" 2>&1 From 0939b88a8260ecb925b55d10dcd1ccc06bc855f9 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Tue, 6 Dec 2011 17:55:56 +1100 Subject: [PATCH 189/203] tiny update with themeing --- lib/theming.zsh | 2 +- themes/default.zsh-theme | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 themes/default.zsh-theme diff --git a/lib/theming.zsh b/lib/theming.zsh index 00d77f47b..a890beacc 100644 --- a/lib/theming.zsh +++ b/lib/theming.zsh @@ -1,7 +1,7 @@ set_theme() { local themes themes=({$OMZ,$ZSH}/themes/$1.zsh-theme(N)) - source $themes[1] + source $themes[1] || omz_log_msg "theme: $1 was not found. falling back to default." && source $ZSH/themes/default.zsh-theme } random_theme() { diff --git a/themes/default.zsh-theme b/themes/default.zsh-theme new file mode 100644 index 000000000..d05a0700c --- /dev/null +++ b/themes/default.zsh-theme @@ -0,0 +1,9 @@ +(( EUID == 0 )) && ucolor=red || ucolor=cyan + +PROMPT='%{$fg[$ucolor]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%}: %{$fg[green]%}%0~%{$fg[red]%}%(?.. [%?]) %{$reset_color%}%% ' +RPROMPT='$(git_prompt_info)' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" From a78d112a7f26bdfd53e458bf82ef429c5667ee3c Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 6 Dec 2011 12:34:14 -0500 Subject: [PATCH 190/203] Reformatted code to be stylistically consistent --- omz | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omz b/omz index 6f80ea3af..24b7848ea 100644 --- a/omz +++ b/omz @@ -15,7 +15,7 @@ omz() { # add plugins to fpath for plugin ($plugins); do files=({$OMZ,$ZSH}/plugins/$plugin) - fpath=($files[1] $fpath) + fpath=($files[1] $fpath) done # Load and run compinit @@ -46,4 +46,4 @@ omz() { esac } -# vi: ft=zsh +# vi: ft=zsh sw=2 tb=2 et From 10272b9aa485de152e5d2e219e9dc874fdaffeed Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 6 Dec 2011 12:34:53 -0500 Subject: [PATCH 191/203] Better theme failing-to-load support. --- lib/theming.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/theming.zsh b/lib/theming.zsh index a890beacc..9ed58c701 100644 --- a/lib/theming.zsh +++ b/lib/theming.zsh @@ -1,7 +1,10 @@ set_theme() { local themes themes=({$OMZ,$ZSH}/themes/$1.zsh-theme(N)) - source $themes[1] || omz_log_msg "theme: $1 was not found. falling back to default." && source $ZSH/themes/default.zsh-theme + if ! source $themes[1]; then + omz_log_msg "theme: $1 was not found. falling back to default." + source $ZSH/themes/default.zsh-theme + fi } random_theme() { From d39d26b8fed7a3c946262335f90f34f3d5303663 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 01:18:29 +1100 Subject: [PATCH 192/203] Added a log for sprunge links. No need to re-make them anymore :D Well, unless you have updated it. --- plugins/sprunge/sprunge.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index bb38d23b5..632f8018b 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -62,7 +62,8 @@ sprunge() { # output each url on its own line for url in $urls - echo $url + echo $url && echo $url >> "$OMZ/sprunge.log" + # don't copy to clipboad if piped [[ -t 1 ]] && sendtoclip $urls From 630295efc8b2fcaff8a439ea362e5233e6badf96 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 01:21:53 +1100 Subject: [PATCH 193/203] Added a log for sprunge links. No need to re-make them anymore :D Well, unless you have updated it. --- plugins/sprunge/sprunge.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 632f8018b..de652ff9d 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -43,6 +43,7 @@ sprunge() { # read from stdin url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) urls=(${url//[[:space:]]}) + echo "stdin: $url" else # treat arguments as a list of files to upload for file in $@; do @@ -56,14 +57,14 @@ sprunge() { url=${url//[[:space:]]} [[ $syntax != text ]] && url=${url}?${syntax} + echo "$file: $url" >> $OMZ/sprunge.log urls+=(${url}) done fi # output each url on its own line for url in $urls - echo $url && echo $url >> "$OMZ/sprunge.log" - + echo $url # don't copy to clipboad if piped [[ -t 1 ]] && sendtoclip $urls From ba33dc788d16a70276b76b6ecf6b87cb9290f464 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 02:54:22 +1100 Subject: [PATCH 194/203] fixed a tiny typo --- plugins/sprunge/sprunge.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index de652ff9d..f0b6b7adf 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -43,7 +43,7 @@ sprunge() { # read from stdin url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0) urls=(${url//[[:space:]]}) - echo "stdin: $url" + echo "stdin: $url" >> $OMZ/sprunge.log else # treat arguments as a list of files to upload for file in $@; do From 9cae203b91d2fbac759077b66cae0eb932161b27 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 04:00:10 +1100 Subject: [PATCH 195/203] don\'t export stright to PAGER, use the existing less or fallback to less. --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 88732e664..7015b5686 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -9,5 +9,5 @@ bindkey "^[m" copy-prev-shell-word setopt long_list_jobs ## pager -export PAGER=less +export PAGER=${PAGER:-$commands[less]} export LC_CTYPE=$LANG From b7571caf398f8cbdbead756643c1afffe6812a85 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 04:10:08 +1100 Subject: [PATCH 196/203] just a few changes. less color changed. omz, modline doesn't cause vim to err/give a warning now. --- lib/less.zsh | 2 +- omz | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/less.zsh b/lib/less.zsh index f55bc1968..d685d937d 100644 --- a/lib/less.zsh +++ b/lib/less.zsh @@ -3,6 +3,6 @@ export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;44;33m' +export LESS_TERMCAP_so=$'\E[01;49;1m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m' diff --git a/omz b/omz index 24b7848ea..d6e4d6fe1 100644 --- a/omz +++ b/omz @@ -25,6 +25,7 @@ omz() { # load lib for config_file ({$ZSH/lib,$OMZ}/*.zsh(N)) source $config_file + omz plugin omz theme ;; @@ -46,4 +47,4 @@ omz() { esac } -# vi: ft=zsh sw=2 tb=2 et +# vi: ft=zsh sw=2 et From dd14b935cb0fb886495f8e099759844d5358ff58 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 04:29:04 +1100 Subject: [PATCH 197/203] plugin with aliases for vim. currenly only one. although can be expanded. --- plugins/vim/vim.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/vim/vim.plugin.zsh diff --git a/plugins/vim/vim.plugin.zsh b/plugins/vim/vim.plugin.zsh new file mode 100644 index 000000000..7d3002734 --- /dev/null +++ b/plugins/vim/vim.plugin.zsh @@ -0,0 +1,3 @@ +# Aliases to commands one may use with vim. +# Colorize the source of a file and create a html file. +alias code2html="vim omz -f +'syn on' +'set background=dark' +'colorscheme pablo' +'TOhtml' +'w' +'qa' &>/dev/null" From a4a108acd34f7622fa0aef3cd5ff90c63a50cc15 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 04:51:34 +1100 Subject: [PATCH 198/203] added a vim helper plugin; currently only one function, in which takes any file; colorizes it and gives you an output html file. --- plugins/vim/vim.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/vim/vim.plugin.zsh b/plugins/vim/vim.plugin.zsh index 7d3002734..5a6b65616 100644 --- a/plugins/vim/vim.plugin.zsh +++ b/plugins/vim/vim.plugin.zsh @@ -1,3 +1,5 @@ -# Aliases to commands one may use with vim. +# Vim helper plugin. # Colorize the source of a file and create a html file. -alias code2html="vim omz -f +'syn on' +'set background=dark' +'colorscheme pablo' +'TOhtml' +'w' +'qa' &>/dev/null" +code2html() { + vim $@ +'syn on' +'set background=dark' +'colorscheme pablo' +'TOhtml' +'w' +'qa' &>/dev/null +} From 46c42b4c8f73ec149c47ef9eb1b9ac6fd1fc6a3a Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Sun, 11 Dec 2011 05:09:35 +1100 Subject: [PATCH 199/203] fixed modline --- omz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omz b/omz index d6e4d6fe1..0e7a480c2 100644 --- a/omz +++ b/omz @@ -47,4 +47,4 @@ omz() { esac } -# vi: ft=zsh sw=2 et +# vi: ft=zsh sw=2 ts=2 et From 8c9d25d452d91eede64e845cef982593248e0701 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 12 Dec 2011 01:41:46 -0500 Subject: [PATCH 200/203] If LS_COLORS set, use those colours for tab completion for consistent appearance. Using this is simply a matter of calling dircolors _before_ omz init. --- lib/completion.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc91822..e0a94a664 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -18,7 +18,11 @@ else zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' fi -zstyle ':completion:*' list-colors '' +if [[ -n $LS_COLORS ]]; then + zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +else + zstyle ':completion:*' list-colors '' +fi # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history From e90467804519d49d6f64340b9918324044ac21e0 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 12 Dec 2011 02:25:30 -0500 Subject: [PATCH 201/203] Remove auto update / uninstall functions. --- lib/functions.zsh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index ef7cc6383..c6698f1c1 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -1,17 +1,3 @@ function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head } - -function uninstall_oh_my_zsh() { - /bin/sh $ZSH/tools/uninstall.sh -} - -function upgrade_oh_my_zsh() { - /bin/sh $ZSH/tools/upgrade.sh -} - -function take() { - mkdir -p $1 - cd $1 -} - From ac45d4589e21616aeeb399b9c76ac11d58aeff4d Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 12 Dec 2011 02:27:57 -0500 Subject: [PATCH 202/203] Tweak some correction settings. No more case sensitivity option. Use menus for completions. Simpler kill completion (to be improved). cd's completion will ignore parent and pwd. Cleanup of hosts. Changed cache path to ~/.omz/cache/. Added fuzzy matching and zsh should ignore functions that start with _ (ignore auto-completion helpers). --- lib/completion.zsh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index e0a94a664..830061e3b 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -10,13 +10,8 @@ WORDCHARS='' zmodload -i zsh/complist -## case-insensitive (all),partial-word and then substring completion -if [ "x$CASE_SENSITIVE" = "xtrue" ]; then - zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - unset CASE_SENSITIVE -else - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' -fi +zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' squeeze-slashes true if [[ -n $LS_COLORS ]]; then zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} @@ -27,28 +22,38 @@ fi # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' -zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" +zstyle ':completion:*:*:*:*:*' menu yes select +zstyle ':completion:*:kill:*' force-list always +# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' +# zstyle ':completion:*:*:*:*:processes' command "ps -u $(whoami) -o pid,user,comm -w -w" # disable named-directories autocompletion zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories +zstyle ':completion:*:cd:*' ignore-parents parent pwd cdpath=(.) # use /etc/hosts and known_hosts for hostname completion [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$( Date: Mon, 12 Dec 2011 21:02:38 +1100 Subject: [PATCH 203/203] >.< Why ~/.omz/ when we already have $OMZ --- lib/completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 830061e3b..bab1a6dfd 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -45,7 +45,7 @@ zstyle ':completion:*:hosts' hosts $hosts # Use caching so that commands like apt and dpkg complete are useable zstyle ':completion::complete:*' use-cache on -zstyle ':completion::complete:*' cache-path ~/.omz/cache/ +zstyle ':completion::complete:*' cache-path $OMZ/cache/ # Fuzzy matching of completions for when you mistype them zstyle ':completion:*' completer _complete _match _approximate