From b65195156dd0e44ec179246452f29753034c06e3 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 11 Sep 2011 01:02:10 -0400 Subject: [PATCH] Added missing FX and named colors to spectrum. --- functions/spectrum.zsh | 63 +++++++++++++++---- oh-my-zsh.zsh => init.zsh | 6 +- plugins/ant/{ant.plugin.zsh => init.zsh} | 0 .../archive/{archive.plugin.zsh => init.zsh} | 0 .../{autojump.plugin.zsh => init.zsh} | 0 plugins/brew/{brew.plugin.zsh => init.zsh} | 0 .../bundler/{bundler.plugin.zsh => init.zsh} | 0 plugins/cake/{cake.plugin.zsh => init.zsh} | 0 ...{command-not-found.plugin.zsh => init.zsh} | 0 .../{compleat.plugin.zsh => init.zsh} | 0 plugins/dpkg/{dpkg.plugin.zsh => init.zsh} | 0 .../{git-flow.plugin.zsh => init.zsh} | 0 plugins/git/{git.plugin.zsh => init.zsh} | 0 .../github/{github.plugin.zsh => init.zsh} | 0 .../{gnu-utils.plugin.zsh => init.zsh} | 0 .../{gpg-agent.plugin.zsh => init.zsh} | 0 ...y-substring-search.plugin.zsh => init.zsh} | 2 +- plugins/kate/{kate.plugin.zsh => init.zsh} | 0 .../{leiningen.plugin.zsh => init.zsh} | 0 .../{macports.plugin.zsh => init.zsh} | 0 plugins/node/{node.plugin.zsh => init.zsh} | 0 plugins/osx/{osx.plugin.zsh => init.zsh} | 0 .../pacman/{pacman.plugin.zsh => init.zsh} | 0 plugins/perl/{perl.plugin.zsh => init.zsh} | 0 plugins/phing/{phing.plugin.zsh => init.zsh} | 0 plugins/pow/{pow.plugin.zsh => init.zsh} | 0 .../python/{python.plugin.zsh => init.zsh} | 0 plugins/rails/{rails.plugin.zsh => init.zsh} | 0 plugins/rsync/{rsync.plugin.zsh => init.zsh} | 0 plugins/ruby/{ruby.plugin.zsh => init.zsh} | 0 .../screen/{screen.plugin.zsh => init.zsh} | 0 .../{ssh-agent.plugin.zsh => init.zsh} | 0 .../{taskwarrior.plugin.zsh => init.zsh} | 0 .../{textmate.plugin.zsh => init.zsh} | 0 plugins/tmux/{tmux.plugin.zsh => init.zsh} | 0 .../{wakeonlan.plugin.zsh => init.zsh} | 0 plugins/yum/{yum.plugin.zsh => init.zsh} | 0 plugins/z/{z.plugin.zsh => init.zsh} | 0 templates/{zshrc.template.zsh => zshrc.zsh} | 2 +- 39 files changed, 57 insertions(+), 16 deletions(-) rename oh-my-zsh.zsh => init.zsh (83%) rename plugins/ant/{ant.plugin.zsh => init.zsh} (100%) rename plugins/archive/{archive.plugin.zsh => init.zsh} (100%) rename plugins/autojump/{autojump.plugin.zsh => init.zsh} (100%) rename plugins/brew/{brew.plugin.zsh => init.zsh} (100%) rename plugins/bundler/{bundler.plugin.zsh => init.zsh} (100%) rename plugins/cake/{cake.plugin.zsh => init.zsh} (100%) rename plugins/command-not-found/{command-not-found.plugin.zsh => init.zsh} (100%) rename plugins/compleat/{compleat.plugin.zsh => init.zsh} (100%) rename plugins/dpkg/{dpkg.plugin.zsh => init.zsh} (100%) rename plugins/git-flow/{git-flow.plugin.zsh => init.zsh} (100%) rename plugins/git/{git.plugin.zsh => init.zsh} (100%) rename plugins/github/{github.plugin.zsh => init.zsh} (100%) rename plugins/gnu-utils/{gnu-utils.plugin.zsh => init.zsh} (100%) rename plugins/gpg-agent/{gpg-agent.plugin.zsh => init.zsh} (100%) rename plugins/history-substring-search/{history-substring-search.plugin.zsh => init.zsh} (87%) rename plugins/kate/{kate.plugin.zsh => init.zsh} (100%) rename plugins/leiningen/{leiningen.plugin.zsh => init.zsh} (100%) rename plugins/macports/{macports.plugin.zsh => init.zsh} (100%) rename plugins/node/{node.plugin.zsh => init.zsh} (100%) rename plugins/osx/{osx.plugin.zsh => init.zsh} (100%) rename plugins/pacman/{pacman.plugin.zsh => init.zsh} (100%) rename plugins/perl/{perl.plugin.zsh => init.zsh} (100%) rename plugins/phing/{phing.plugin.zsh => init.zsh} (100%) rename plugins/pow/{pow.plugin.zsh => init.zsh} (100%) rename plugins/python/{python.plugin.zsh => init.zsh} (100%) rename plugins/rails/{rails.plugin.zsh => init.zsh} (100%) rename plugins/rsync/{rsync.plugin.zsh => init.zsh} (100%) rename plugins/ruby/{ruby.plugin.zsh => init.zsh} (100%) rename plugins/screen/{screen.plugin.zsh => init.zsh} (100%) rename plugins/ssh-agent/{ssh-agent.plugin.zsh => init.zsh} (100%) rename plugins/taskwarrior/{taskwarrior.plugin.zsh => init.zsh} (100%) rename plugins/textmate/{textmate.plugin.zsh => init.zsh} (100%) rename plugins/tmux/{tmux.plugin.zsh => init.zsh} (100%) rename plugins/wakeonlan/{wakeonlan.plugin.zsh => init.zsh} (100%) rename plugins/yum/{yum.plugin.zsh => init.zsh} (100%) rename plugins/z/{z.plugin.zsh => init.zsh} (100%) rename templates/{zshrc.template.zsh => zshrc.zsh} (96%) diff --git a/functions/spectrum.zsh b/functions/spectrum.zsh index 43a013d..67beeac 100644 --- a/functions/spectrum.zsh +++ b/functions/spectrum.zsh @@ -1,20 +1,61 @@ # A script to make using 256 colors in ZSH less painful. # P.C. Shyamshankar -# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ +# Sorin Ionescu typeset -Ag FX FG BG FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" + none "\e[00m" + normal "\e[22m" + bold "\e[01m" no-bold "\e[22m" + faint "\e[02m" no-faint "\e[22m" + standout "\e[03m" no-standout "\e[23m" + underline "\e[04m" no-underline "\e[24m" + blink "\e[05m" no-blink "\e[25m" + fast-blink "\e[06m" no-fast-blink "\e[25m" + reverse "\e[07m" no-reverse "\e[27m" + conceal "\e[08m" no-conceal "\e[28m" + strikethrough "\e[09m" no-strikethrough "\e[29m" + gothic "\e[20m" no-gothic "\e[22m" + double-underline "\e[21m" no-double-underline "\e[22m" + proportional "\e[26m" no-proportional "\e[50m" + overline "\e[53m" no-overline "\e[55m" + + no-border "\e[54m" + border-rectangle "\e[51m" no-border-rectangle "\e[54m" + border-circle "\e[52m" no-border-circle "\e[54m" + + no-ideogram-marking "\e[65m" + underline-or-right "\e[60m" no-underline-or-right "\e[65m" + double-underline-or-right "\e[61m" no-double-underline-or-right "\e[65m" + overline-or-left "\e[62m" no-overline-or-left "\e[65m" + double-overline-or-left "\e[63m" no-double-overline-or-left "\e[65m" + stress "\e[64m" no-stress "\e[65m" + + font-default "\e[10m" + font-first "\e[11m" no-font-first "\e[10m" + font-second "\e[12m" no-font-second "\e[10m" + font-third "\e[13m" no-font-third "\e[10m" + font-fourth "\e[14m" no-font-fourth "\e[10m" + font-fifth "\e[15m" no-font-fifth "\e[10m" + font-sixth "\e[16m" no-font-sixth "\e[10m" + font-seventh "\e[17m" no-font-seventh "\e[10m" + font-eigth "\e[18m" no-font-eigth "\e[10m" + font-ninth "\e[19m" no-font-ninth "\e[10m" ) -for color in {000..255}; do - FG[$color]="%{[38;5;${color}m%}" - BG[$color]="%{[48;5;${color}m%}" -done +FG[none]="$FX[none]" +BG[none]="$FX[none]" +colors=(black red green yellow blue magenta cyan white) +for color in {0..255}; do + if (( $color >= 0 )) && (( $color < $#colors )); then + index=$(( $color + 1 )) + FG[$colors[$index]]="\e[38;5;${color}m" + BG[$colors[$index]]="\e[48;5;${color}m" + fi + + FG[$color]="\e[38;5;${color}m" + BG[$color]="\e[48;5;${color}m" +done +unset colors color index diff --git a/oh-my-zsh.zsh b/init.zsh similarity index 83% rename from oh-my-zsh.zsh rename to init.zsh index 7635683..ab7b6d1 100644 --- a/oh-my-zsh.zsh +++ b/init.zsh @@ -14,10 +14,10 @@ autoload -Uz compinit && compinit -i # Source function files. source "$OMZ/functions/init.zsh" -# Load all plugins defined in ~/.zshrc. +# Source plugins defined in ~/.zshrc. for plugin in $plugins; do - if [[ -f "$OMZ/plugins/$plugin/$plugin.plugin.zsh" ]]; then - source "$OMZ/plugins/$plugin/$plugin.plugin.zsh" + if [[ -f "$OMZ/plugins/$plugin/init.zsh" ]]; then + source "$OMZ/plugins/$plugin/init.zsh" fi done diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/init.zsh similarity index 100% rename from plugins/ant/ant.plugin.zsh rename to plugins/ant/init.zsh diff --git a/plugins/archive/archive.plugin.zsh b/plugins/archive/init.zsh similarity index 100% rename from plugins/archive/archive.plugin.zsh rename to plugins/archive/init.zsh diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/init.zsh similarity index 100% rename from plugins/autojump/autojump.plugin.zsh rename to plugins/autojump/init.zsh diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/init.zsh similarity index 100% rename from plugins/brew/brew.plugin.zsh rename to plugins/brew/init.zsh diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/init.zsh similarity index 100% rename from plugins/bundler/bundler.plugin.zsh rename to plugins/bundler/init.zsh diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/init.zsh similarity index 100% rename from plugins/cake/cake.plugin.zsh rename to plugins/cake/init.zsh diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/init.zsh similarity index 100% rename from plugins/command-not-found/command-not-found.plugin.zsh rename to plugins/command-not-found/init.zsh diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/init.zsh similarity index 100% rename from plugins/compleat/compleat.plugin.zsh rename to plugins/compleat/init.zsh diff --git a/plugins/dpkg/dpkg.plugin.zsh b/plugins/dpkg/init.zsh similarity index 100% rename from plugins/dpkg/dpkg.plugin.zsh rename to plugins/dpkg/init.zsh diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/init.zsh similarity index 100% rename from plugins/git-flow/git-flow.plugin.zsh rename to plugins/git-flow/init.zsh diff --git a/plugins/git/git.plugin.zsh b/plugins/git/init.zsh similarity index 100% rename from plugins/git/git.plugin.zsh rename to plugins/git/init.zsh diff --git a/plugins/github/github.plugin.zsh b/plugins/github/init.zsh similarity index 100% rename from plugins/github/github.plugin.zsh rename to plugins/github/init.zsh diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/init.zsh similarity index 100% rename from plugins/gnu-utils/gnu-utils.plugin.zsh rename to plugins/gnu-utils/init.zsh diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/init.zsh similarity index 100% rename from plugins/gpg-agent/gpg-agent.plugin.zsh rename to plugins/gpg-agent/init.zsh diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/init.zsh similarity index 87% rename from plugins/history-substring-search/history-substring-search.plugin.zsh rename to plugins/history-substring-search/init.zsh index 12d8dc5..e31eb17 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/init.zsh @@ -1,6 +1,6 @@ # This file integrates the history-substring-search script into oh-my-zsh. -source "${0:r:r}.zsh" +source "${0:h}/history-substring-search.zsh" if check-bool "$CASE_SENSITIVE"; then unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS diff --git a/plugins/kate/kate.plugin.zsh b/plugins/kate/init.zsh similarity index 100% rename from plugins/kate/kate.plugin.zsh rename to plugins/kate/init.zsh diff --git a/plugins/leiningen/leiningen.plugin.zsh b/plugins/leiningen/init.zsh similarity index 100% rename from plugins/leiningen/leiningen.plugin.zsh rename to plugins/leiningen/init.zsh diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/init.zsh similarity index 100% rename from plugins/macports/macports.plugin.zsh rename to plugins/macports/init.zsh diff --git a/plugins/node/node.plugin.zsh b/plugins/node/init.zsh similarity index 100% rename from plugins/node/node.plugin.zsh rename to plugins/node/init.zsh diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/init.zsh similarity index 100% rename from plugins/osx/osx.plugin.zsh rename to plugins/osx/init.zsh diff --git a/plugins/pacman/pacman.plugin.zsh b/plugins/pacman/init.zsh similarity index 100% rename from plugins/pacman/pacman.plugin.zsh rename to plugins/pacman/init.zsh diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/init.zsh similarity index 100% rename from plugins/perl/perl.plugin.zsh rename to plugins/perl/init.zsh diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/init.zsh similarity index 100% rename from plugins/phing/phing.plugin.zsh rename to plugins/phing/init.zsh diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/init.zsh similarity index 100% rename from plugins/pow/pow.plugin.zsh rename to plugins/pow/init.zsh diff --git a/plugins/python/python.plugin.zsh b/plugins/python/init.zsh similarity index 100% rename from plugins/python/python.plugin.zsh rename to plugins/python/init.zsh diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/init.zsh similarity index 100% rename from plugins/rails/rails.plugin.zsh rename to plugins/rails/init.zsh diff --git a/plugins/rsync/rsync.plugin.zsh b/plugins/rsync/init.zsh similarity index 100% rename from plugins/rsync/rsync.plugin.zsh rename to plugins/rsync/init.zsh diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/init.zsh similarity index 100% rename from plugins/ruby/ruby.plugin.zsh rename to plugins/ruby/init.zsh diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/init.zsh similarity index 100% rename from plugins/screen/screen.plugin.zsh rename to plugins/screen/init.zsh diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/init.zsh similarity index 100% rename from plugins/ssh-agent/ssh-agent.plugin.zsh rename to plugins/ssh-agent/init.zsh diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/init.zsh similarity index 100% rename from plugins/taskwarrior/taskwarrior.plugin.zsh rename to plugins/taskwarrior/init.zsh diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/init.zsh similarity index 100% rename from plugins/textmate/textmate.plugin.zsh rename to plugins/textmate/init.zsh diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/init.zsh similarity index 100% rename from plugins/tmux/tmux.plugin.zsh rename to plugins/tmux/init.zsh diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/init.zsh similarity index 100% rename from plugins/wakeonlan/wakeonlan.plugin.zsh rename to plugins/wakeonlan/init.zsh diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/init.zsh similarity index 100% rename from plugins/yum/yum.plugin.zsh rename to plugins/yum/init.zsh diff --git a/plugins/z/z.plugin.zsh b/plugins/z/init.zsh similarity index 100% rename from plugins/z/z.plugin.zsh rename to plugins/z/init.zsh diff --git a/templates/zshrc.template.zsh b/templates/zshrc.zsh similarity index 96% rename from templates/zshrc.template.zsh rename to templates/zshrc.zsh index 1cc9130..93b67fe 100644 --- a/templates/zshrc.template.zsh +++ b/templates/zshrc.zsh @@ -24,7 +24,7 @@ COMPLETION_INDICATOR='false' plugins=(git) # This will make you scream: OH MY ZSH! -source "$OMZ/oh-my-zsh.zsh" +source "$OMZ/init.zsh" # Load the prompt theme (type prompt -l to list all themes). # Setting it to 'random' loads a random theme.