Permalink
Browse files

Pared down oh-my-zsh to only what I wanted.

  • Loading branch information...
0 parents commit cf08d5b814fc61033094be2fe900efefff79b4f5 @Soares committed Sep 15, 2012
Showing with 8,971 additions and 0 deletions.
  1. +1,215 −0 .zcompdump
  2. +1 −0 .zshrc
  3. +5 −0 README
  4. +37 −0 lib/aliases.zsh
  5. +12 −0 lib/complete.zsh
  6. +19 −0 lib/config.zsh
  7. +107 −0 lib/git.zsh
  8. +13 −0 lib/history.zsh
  9. +13 −0 lib/misc.zsh
  10. +13 −0 lib/multiplexor.zsh
  11. +6 −0 lib/music.zsh
  12. +17 −0 lib/nav.zsh
  13. +5 −0 lib/nocorrect.zsh
  14. +24 −0 lib/solarized.zsh
  15. +28 −0 lib/spectrum.zsh
  16. +36 −0 lib/theme-and-appearance.zsh
  17. +26 −0 plugins/ant/ant.plugin.zsh
  18. +6 −0 plugins/apache2-macports/apache2-macports.plugin.zsh
  19. +77 −0 plugins/archlinux/archlinux.plugin.zsh
  20. +9 −0 plugins/autojump/autojump.plugin.zsh
  21. +20 −0 plugins/battery/battery.plugin.zsh
  22. +80 −0 plugins/brew/_brew
  23. +1 −0 plugins/brew/brew.plugin.zsh
  24. +82 −0 plugins/bundler/_bundler
  25. +42 −0 plugins/bundler/bundler.plugin.zsh
  26. +36 −0 plugins/cake/cake.plugin.zsh
  27. +21 −0 plugins/cap/cap.plugin.zsh
  28. +2 −0 plugins/cloudapp/cloudapp.plugin.zsh
  29. +60 −0 plugins/cloudapp/cloudapp.rb
  30. +5 −0 plugins/command-not-found/command-not-found.plugin.zsh
  31. +20 −0 plugins/compleat/compleat.plugin.zsh
  32. +67 −0 plugins/cpanm/_cpanm
  33. +181 −0 plugins/debian/debian.plugin.zsh
  34. +39 −0 plugins/dirpersist/dirpersist.plugin.zsh
  35. +223 −0 plugins/django/django.plugin.zsh
  36. +8 −0 plugins/extract/_extract
  37. +80 −0 plugins/extract/extract.plugin.zsh
  38. +34 −0 plugins/gas/_gas
  39. +64 −0 plugins/gem/_gem
  40. +332 −0 plugins/git-flow/git-flow.plugin.zsh
  41. +63 −0 plugins/git/git.plugin.zsh
  42. +40 −0 plugins/github/_github
  43. +70 −0 plugins/github/github.plugin.zsh
  44. +80 −0 plugins/gnu-utils/gnu-utils.plugin.zsh
  45. +26 −0 plugins/gpg-agent/gpg-agent.plugin.zsh
  46. +119 −0 plugins/gradle/gradle.plugin.zsh
  47. +54 −0 plugins/grails/grails.plugin.zsh
  48. +158 −0 plugins/heroku/_heroku
  49. +7 −0 plugins/history-substring-search/README
  50. +12 −0 plugins/history-substring-search/history-substring-search.plugin.zsh
  51. +642 −0 plugins/history-substring-search/history-substring-search.zsh
  52. +14 −0 plugins/jake-node/jake-node.plugin.zsh
  53. +9 −0 plugins/kate/kate.plugin.zsh
  54. +181 −0 plugins/knife/_knife
  55. +27 −0 plugins/lein/lein.plugin.zsh
  56. +16 −0 plugins/lighthouse/lighthouse.plugin.zsh
  57. +37 −0 plugins/lol/lol.plugin.zsh
  58. +89 −0 plugins/macports/_port
  59. +8 −0 plugins/macports/macports.plugin.zsh
  60. +14 −0 plugins/mercurial/mercurial.plugin.zsh
  61. +8 −0 plugins/mysql-macports/mysql-macports.plugin.zsh
  62. +5 −0 plugins/node/node.plugin.zsh
  63. +1 −0 plugins/npm/npm.plugin.zsh
  64. +5 −0 plugins/nyan/nyan.plugin.zsh
  65. +5 −0 plugins/osx/_man-preview
  66. +99 −0 plugins/osx/osx.plugin.zsh
  67. +62 −0 plugins/perl/perl.plugin.zsh
  68. +19 −0 plugins/phing/phing.plugin.zsh
  69. +74 −0 plugins/pip/_pip
  70. +66 −0 plugins/pow/pow.plugin.zsh
  71. +4 −0 plugins/powder/_powder
  72. +5 −0 plugins/python/python.plugin.zsh
  73. +14 −0 plugins/rails/rails.plugin.zsh
  74. +22 −0 plugins/rails3/rails3.plugin.zsh
  75. +6 −0 plugins/rake/rake.plugin.zsh
  76. +44 −0 plugins/rbenv/rbenv.plugin.zsh
  77. +142 −0 plugins/redis-cli/_redis-cli
  78. +6 −0 plugins/ruby/ruby.plugin.zsh
  79. +147 −0 plugins/rvm/_rvm
  80. +44 −0 plugins/rvm/rvm.plugin.zsh
  81. +64 −0 plugins/sprunge/sprunge.plugin.zsh
  82. +62 −0 plugins/ssh-agent/ssh-agent.plugin.zsh
  83. +42 −0 plugins/svn/svn.plugin.zsh
  84. +13 −0 plugins/symfony2/symfony2.plugin.zsh
  85. +248 −0 plugins/taskwarrior/_task
  86. +21 −0 plugins/taskwarrior/taskwarrior.plugin.zsh
  87. +11 −0 plugins/terminalapp/terminalapp.plugin.zsh
  88. +38 −0 plugins/terminitor/_terminitor
  89. +12 −0 plugins/textmate/textmate.plugin.zsh
  90. +4 −0 plugins/thor/_thor
  91. +104 −0 plugins/vagrant/_vagrant
  92. +50 −0 plugins/vi-mode/vi-mode.plugin.zsh
  93. +23 −0 plugins/vundle/vundle.plugin.zsh
  94. +29 −0 plugins/wakeonlan/README
  95. +4 −0 plugins/wakeonlan/_wake
  96. +14 −0 plugins/wakeonlan/wakeonlan.plugin.zsh
  97. +12 −0 plugins/yum/yum.plugin.zsh
  98. +86 −0 themes/Soliah.zsh-theme
  99. +10 −0 themes/afowler.zsh-theme
  100. +28 −0 themes/alanpeabody.zsh-theme
  101. +29 −0 themes/apple.zsh-theme
  102. +14 −0 themes/arrow.zsh-theme
  103. +8 −0 themes/aussiegeek.zsh-theme
  104. +18 −0 themes/awesomepanda.zsh-theme
  105. +21 −0 themes/bira.zsh-theme
  106. +20 −0 themes/blinks.zsh-theme
  107. +7 −0 themes/candy.zsh-theme
  108. +14 −0 themes/clean.zsh-theme
  109. +6 −0 themes/cloud.zsh-theme
  110. +43 −0 themes/crunch.zsh-theme
  111. +4 −0 themes/cypher.zsh-theme
  112. +32 −0 themes/dallas.zsh-theme
  113. +9 −0 themes/darkblood.zsh-theme
  114. +7 −0 themes/daveverwer.zsh-theme
  115. +56 −0 themes/dieter.zsh-theme
  116. +85 −0 themes/dogenpunk.zsh-theme
  117. +14 −0 themes/dpoggi.zsh-theme
  118. +16 −0 themes/dst.zsh-theme
  119. +19 −0 themes/dstufft.zsh-theme
  120. +8 −0 themes/duellj.zsh-theme
  121. +23 −0 themes/eastwood.zsh-theme
  122. +6 −0 themes/edvardm.zsh-theme
  123. +2 −0 themes/evan.zsh-theme
  124. +5 −0 themes/example.zsh-theme
  125. +46 −0 themes/fino.zsh-theme
  126. +20 −0 themes/fishy.zsh-theme
  127. +19 −0 themes/flazz.zsh-theme
  128. +12 −0 themes/fletcherm.zsh-theme
  129. +8 −0 themes/fox.zsh-theme
  130. +10 −0 themes/frisk.zsh-theme
  131. +14 −0 themes/funky.zsh-theme
  132. +6 −0 themes/fwalch.zsh-theme
  133. +8 −0 themes/gallifrey.zsh-theme
  134. +25 −0 themes/gallois.zsh-theme
  135. +6 −0 themes/garyblessington.zsh-theme
  136. +4 −0 themes/gentoo.zsh-theme
  137. +5 −0 themes/geoffgarside.zsh-theme
  138. +54 −0 themes/gnzh.zsh-theme
  139. +15 −0 themes/gozilla.zsh-theme
  140. +26 −0 themes/humza.zsh-theme
  141. +5 −0 themes/imajes.zsh-theme
  142. +6 −0 themes/jbergantine.zsh-theme
  143. +4 −0 themes/jispwoso.zsh-theme
  144. +31 −0 themes/jnrowe.zsh-theme
  145. +141 −0 themes/jonathan.zsh-theme
  146. +43 −0 themes/josh.zsh-theme
  147. +16 −0 themes/jreese.zsh-theme
  148. +8 −0 themes/jtriley.zsh-theme
  149. +46 −0 themes/juanghurtado.zsh-theme
  150. +12 −0 themes/kardan.zsh-theme
  151. +13 −0 themes/kennethreitz.zsh-theme
  152. +24 −0 themes/kolo.zsh-theme
  153. +50 −0 themes/kphoen.zsh-theme
  154. +6 −0 themes/lambda.zsh-theme
  155. +80 −0 themes/linuxonly
  156. +24 −0 themes/lukerandall.zsh-theme
  157. +15 −0 themes/macovsky-ruby.zsh-theme
  158. +14 −0 themes/macovsky.zsh-theme
  159. +6 −0 themes/maran.zsh-theme
  160. +6 −0 themes/mgutz.zsh-theme
  161. +24 −0 themes/mh.zsh-theme
  162. +23 −0 themes/mikeh.zsh-theme
  163. +8 −0 themes/miloshadzic.zsh-theme
  164. +15 −0 themes/minimal.zsh-theme
  165. +58 −0 themes/mortalscumbag.zsh-theme
  166. +7 −0 themes/mrtazz.zsh-theme
  167. +14 −0 themes/murilasso.zsh-theme
  168. +30 −0 themes/muse.zsh-theme
  169. +7 −0 themes/nanotech.zsh-theme
  170. +21 −0 themes/nebirhos.zsh-theme
  171. +43 −0 themes/nicoulaj.zsh-theme
  172. +4 −0 themes/norm.zsh-theme
  173. +11 −0 themes/obraun.zsh-theme
  174. +14 −0 themes/philips.zsh-theme
  175. +16 −0 themes/pmcgee.zsh-theme
  176. +9 −0 themes/pygmalion.zsh-theme
  177. +15 −0 themes/re5et.zsh-theme
  178. +8 −0 themes/rgm.zsh-theme
  179. +6 −0 themes/risto.zsh-theme
  180. +24 −0 themes/rixius.zsh-theme
  181. +29 −0 themes/rkj-repos.zsh-theme
  182. +8 −0 themes/rkj.zsh-theme
  183. +6 −0 themes/robbyrussell.zsh-theme
  184. +6 −0 themes/sammy.zsh-theme
  185. +6 −0 themes/simple.zsh-theme
  186. +7 −0 themes/skaro.zsh-theme
  187. +91 −0 themes/smt.zsh-theme
  188. +67 −0 themes/so8res.zsh-theme
  189. +48 −0 themes/sorin.zsh-theme
  190. +13 −0 themes/sporty_256.zsh-theme
  191. +100 −0 themes/steeef.zsh-theme
  192. +26 −0 themes/sunaku.zsh-theme
  193. +96 −0 themes/sunrise.zsh-theme
  194. +24 −0 themes/superjarin.zsh-theme
  195. +30 −0 themes/suvash.zsh-theme
  196. +27 −0 themes/takashiyoshida.zsh-theme
  197. +9 −0 themes/terminalparty.zsh-theme
  198. +16 −0 themes/theunraveler.zsh-theme
  199. +15 −0 themes/tjkirch.zsh-theme
  200. +12 −0 themes/tonotdo.zsh-theme
  201. +95 −0 themes/trapd00r.zsh-theme
  202. +107 −0 themes/wedisagree.zsh-theme
  203. +7 −0 themes/wezm+.zsh-theme
  204. +7 −0 themes/wezm.zsh-theme
  205. +5 −0 themes/wuffers.zsh-theme
  206. +6 −0 themes/xiong-chiamiov-plus.zsh-theme
  207. +6 −0 themes/xiong-chiamiov.zsh-theme
  208. +15 −0 themes/zhann.zsh-theme
  209. +51 −0 zsh.rc
1,215 .zcompdump

Large diffs are not rendered by default.

Oops, something went wrong.
1 .zshrc
5 README
@@ -0,0 +1,5 @@
+My Z shell configuration.
+
+Originally this was just a custom [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
+configuration, but I eventually found it too bloated. This is a pared down and later
+modified version of the above.
@@ -0,0 +1,37 @@
+alias browse='nautilus --browser .'
+alias ...='cd ../..'
+alias -- -='cd -'
+alias history='fc -l 1'
+
+export IGNORED_FILES='*.pyc'
+alias ls="ls --color --hide='$IGNORED_FILES'"
+alias ll="ls -l --color --hide='$IGNORED_FILES'"
+alias lb="ls --hide='$IGNORED_FILES'"
+
+alias sim="sudoedit"
+alias o="gnome-open"
+alias so='source'
+alias mkdir='mkdir -p'
+alias less='less -R'
+
+alias gs='git status --short'
+alias gcd="cd ./$(git rev-parse --show-cdup 2> /dev/null)"
+
+alias afind='ack -il'
+alias qfind='find . -iname'
+
+alias get="sudo apt-get install"
+alias canget="apt-cache search"
+alias clean="deborphan | xargs sudo apt-get remove -y --purge"
+
+alias bbuild="bookbuilder -a \"Nate Soares\""
+alias doc="libreoffice"
+alias ebook="calibre"
+alias music="ncmpcpp"
+alias pdf="evince"
+alias song="cvlc 2>/dev/null&"
+
+local tmux="tmux -f $XDG_CONFIG_HOME/tmux/config"
+local vim="vim -u $XDG_CONFIG_HOME/vim/vim.rc"
+alias tmux=$tmux
+alias vim=$vim
@@ -0,0 +1,12 @@
+# Autocompletion
+zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd' # Better killall
+zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
+zstyle ':completion:*' matcher-list '' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
+unsetopt correct_all # No correcting
+setopt completeinword # Complete from both ends
+autoload select-word-style # Better 'word' usage (^W)
+select-word-style shell
+setopt extendedglob
+unsetopt caseglob
+autoload -Uz compinit
+compinit
@@ -0,0 +1,19 @@
+setopt DVORAK autocd beep extendedglob nomatch interactivecomments long_list_jobs
+stty -ixon
+
+# smart urls
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+# file rename magic
+bindkey "^[m" copy-prev-shell-word
+
+export CCACHE_DIR=$XDG_CACHE_HOME/ccache
+export GIT_CONFIG_FILE=$XDG_CONFIG_HOME/git/config
+export GIT_EDITOR=vim
+export GNUPGHOME=$XDG_CONFIG_HOME/gnupg
+export GREP_COLOR='1;32'
+export GREP_OPTIONS='--color=auto'
+export LC_CTYPE=$LANG
+export LESSHISTFILE=$XDG_DATA_HOME/less/history
+export PAGER=less
@@ -0,0 +1,107 @@
+# get the name of the branch we are on
+function git_prompt_info() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+parse_git_dirty () {
+ gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)')
+
+ if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\|# Changes not staged for commit:\)$") > 0 ]]; then
+ echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED"
+ fi
+
+ if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
+ echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ fi
+
+ if [[ $(echo ${gitstat} | grep -v '^$' | wc -l | tr -d ' ') == 0 ]]; then
+ echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
+}
+
+
+# Checks if there are commits ahead from remote
+function git_prompt_ahead() {
+ if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
+ fi
+}
+
+#
+# Will return the current branch name
+# Usage example: git pull origin $(current_branch)
+#
+function current_branch() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ echo ${ref#refs/heads/}
+}
+
+# Formats prompt string for current git commit short SHA
+function git_prompt_short_sha() {
+ SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Formats prompt string for current git commit long SHA
+function git_prompt_long_sha() {
+ SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Get the status of the working tree
+git_prompt_status() {
+ INDEX=$(git status --porcelain 2> /dev/null)
+ STATUS=""
+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+ elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$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
+ if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
+ fi
+ echo $STATUS
+}
+
+#compare the provided version of git to the version installed and on path
+#prints 1 if input version <= installed version
+#prints -1 otherwise
+function git_compare_version() {
+ local INPUT_GIT_VERSION=$1;
+ local INSTALLED_GIT_VERSION
+ INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
+ INSTALLED_GIT_VERSION=($(git --version));
+ INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
+
+ for i in {1..3}; do
+ if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
+ echo -1
+ return 0
+ fi
+ done
+ echo 1
+}
+
+#this is unlikely to change so make it all statically assigned
+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
+#clean up the namespace slightly by removing the checker function
+unset -f git_compare_version
+
+
@@ -0,0 +1,13 @@
+## Command history configuration
+HISTFILE=$XDG_DATA_HOME/zsh/history
+HISTSIZE=10000
+SAVEHIST=10000
+
+setopt append_history
+setopt extended_history
+setopt hist_expire_dups_first
+setopt hist_ignore_dups # ignore duplication command history list
+setopt hist_ignore_space
+setopt hist_verify
+setopt inc_append_history
+setopt share_history # share command history data
@@ -0,0 +1,13 @@
+## smart urls
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+## file rename magick
+bindkey "^[m" copy-prev-shell-word
+
+## jobs
+setopt long_list_jobs
+
+## pager
+export PAGER=less
+export LC_CTYPE=$LANG
@@ -0,0 +1,13 @@
+if which tmux 2>&1 >/dev/null; then
+ local SESSION_NAME="So8res"
+
+ if [ $(tmux list-sessions 2>/dev/null | grep -c $SESSION_NAME) -eq 0 ]; then
+ tmux -f $XDG_CONFIG_HOME/tmux/config new-session -s $SESSION_NAME -n main -d
+ fi
+
+ if [[ $TERM == $GUI_TERM; ]]; then
+ if [ -z $TMUX ]; then
+ tmux attach-session -t $SESSION_NAME -d
+ fi
+ fi
+fi
@@ -0,0 +1,6 @@
+if test -n `which mpd`; then
+ if ps -u nate | grep mpd > /dev/null; then
+ else
+ mpd $XDG_CONFIG_HOME/mpd/config 2> /dev/null
+ fi
+fi
@@ -0,0 +1,17 @@
+setopt auto_name_dirs
+setopt auto_pushd
+setopt pushd_ignore_dups
+
+alias cd..='cd ..'
+alias ..='cd ..'
+alias ...='cd ../..'
+alias ....='cd ../..'
+
+function mcd() {
+ mkdir -p "$1" && cd "$1";
+}
+
+function chpwd() {
+ emulate -L zsh
+ ls
+}
@@ -0,0 +1,5 @@
+alias man='nocorrect man'
+alias mv='nocorrect mv'
+alias mysql='nocorrect mysql'
+alias mkdir='nocorrect mkdir'
+alias gist='nocorrect gist'
@@ -0,0 +1,24 @@
+function light { set_theme "Solarized Light" }
+function dark { set_theme "Solarized Dark" }
+
+function set_theme {
+ if [[ $SYSTEM == "MAC" ]]; then
+ osascript -e "tell application \"Terminal\" to set current settings of window 1 to settings set \"$1\""
+ fi
+
+ if [[ $SYSTEM == "LINUX" ]]; then
+ local TERMINAL_THEME=`cat $XDG_CACHE_DIR/terminal_theme`
+ if [[ $1 == $TERMINAL_THEME ]]; then; return; fi
+
+ if [[ $1 == "Solarized Light" ]]; then
+ xrdb -DSOLARIZED_LIGHT -merge $XDG_CONFIG_HOME/X11/resources
+ eval `dircolors $XDG_CONFIG_HOME/dircolors/ansi-light`
+ else
+ xrdb -DSOLARIZED_DARK -merge $XDG_CONFIG_HOME/X11/resources
+ eval `dircolors $XDG_CONFIG_HOME/dircolors/ansi-dark`
+ fi
+
+ echo $1 > $XDG_CACHE_DIR/terminal_theme
+ killall urxvt
+ fi
+}
@@ -0,0 +1,28 @@
+#! /bin/zsh
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+ reset "%{%}"
+ bold "%{%}" no-bold "%{%}"
+ italic "%{%}" no-italic "%{%}"
+ underline "%{%}" no-underline "%{%}"
+ blink "%{%}" no-blink "%{%}"
+ reverse "%{%}" no-reverse "%{%}"
+)
+
+for color in {000..255}; do
+ FG[$color]="%{[38;5;${color}m%}"
+ BG[$color]="%{[48;5;${color}m%}"
+done
+
+# Show all 256 colors with color number
+function spectrum_ls() {
+ for code in {000..255}; do
+ print -P -- "$code: %F{$code}Test%f"
+ done
+}
+
@@ -0,0 +1,36 @@
+# ls colors
+autoload colors; colors;
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+#export LS_COLORS
+
+# Enable ls colors
+if [ "$DISABLE_LS_COLORS" != "true" ]
+then
+ # Find the option for using colors in ls, depending on the version: Linux or BSD
+ ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+fi
+
+#setopt no_beep
+setopt auto_cd
+setopt multios
+setopt cdablevarS
+
+if [[ x$WINDOW != x ]]
+then
+ SCREEN_NO="%B$WINDOW%b "
+else
+ SCREEN_NO=""
+fi
+
+# Apply theming defaults
+PS1="%n@%m:%~%# "
+
+# git theming default: Variables for theming the git info prompt
+ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
+ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
+ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
+ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
+
+# Setup the prompt with pretty colors
+setopt prompt_subst
+
@@ -0,0 +1,26 @@
+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 '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ fi
+ compadd `cat .ant_targets`
+ fi
+}
+
+compdef _ant ant
@@ -0,0 +1,6 @@
+# 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'
Oops, something went wrong.

0 comments on commit cf08d5b

Please sign in to comment.