diff options
47 files changed, 370 insertions, 248 deletions
diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index f6edab65b..6eb8aab34 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -1,6 +1,6 @@  The MIT License -Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) +Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)  Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal diff --git a/README.textile b/README.textile index b80294c60..c808fb5d7 100644 --- a/README.textile +++ b/README.textile @@ -20,9 +20,19 @@ h4. via `wget`  @wget --no-check-certificate http://install.ohmyz.sh -O - | sh@ -h3. The manual way +h4. Optional: change the install directory + +The default location is `~/.oh-my-zsh` (hidden in your home directory). + +You can change the install directory with the ZSH environment variable, either +by running `export ZSH=/your/path` before installing, or setting it before the +end of the install pipeline like this: + +@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@ +h3. The manual way +  1. Clone the repository    @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ @@ -35,7 +45,6 @@ h3. The manual way    @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ -  4. Set zsh as your default shell:    @chsh -s /bin/zsh@ @@ -46,6 +55,8 @@ 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_. +If you installed manually or changed the install location, check ZSH in ~/.zshrc +  h2. Usage  * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 2094f60a0..3044c9660 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -6,11 +6,6 @@ alias po='popd'  alias ...='cd ../..'  alias -- -='cd -' -# Prevent headaches -alias cp='cp -v' -alias rm='rm -v' -alias mv='mv -v' -  # Super user  alias _='sudo'  alias please='sudo' diff --git a/lib/completion.zsh b/lib/completion.zsh index e0cdcf626..c54249c52 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -31,35 +31,20 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm  zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories  cdpath=(.) -# use /etc/hosts and known_hosts for hostname completion -[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=() -[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() -[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=() -[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=() -hosts=( -  "$_ssh_config[@]" -  "$_global_ssh_hosts[@]" -  "$_ssh_hosts[@]" -  "$_etc_hosts[@]" -  "$HOST" -  localhost -) -zstyle ':completion:*:hosts' hosts $hosts -zstyle ':completion:*' users off -  # Use caching so that commands like apt and dpkg complete are useable  zstyle ':completion::complete:*' use-cache 1  zstyle ':completion::complete:*' cache-path $ZSH/cache/  # Don't complete uninteresting users  zstyle ':completion:*:*:*:users' ignored-patterns \ -        adm amanda apache avahi beaglidx bin cacti canna clamav daemon \ -        dbus distcache dovecot fax ftp games gdm gkrellmd gopher \ -        hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \ -        mailman mailnull mldonkey mysql nagios \ -        named netdump news nfsnobody nobody nscd ntp nut nx openvpn \ -        operator pcap postfix postgres privoxy pulse pvm quagga radvd \ -        rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs +        adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \ +        clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \ +        gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \ +        ldap lp mail mailman mailnull man messagebus  mldonkey mysql nagios \ +        named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \ +        operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \ +        rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \ +        usbmux uucp vcsa wwwrun xfs  # ... unless we really want to.  zstyle '*' single-ignored show diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 49f80c8f3..94f1842f3 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -1,34 +1,43 @@ -# TODO: Explain what some of this does.. - -bindkey -e -bindkey '\ew' kill-region -bindkey -s '\el' "ls\n" -bindkey '^r' history-incremental-search-backward -bindkey "^[[5~" up-line-or-history -bindkey "^[[6~" down-line-or-history - -# make search up and down work, so partially type and hit up/down to find relevant stuff -bindkey '^[[A' up-line-or-search -bindkey '^[[B' down-line-or-search - -bindkey "^[[H" beginning-of-line -bindkey "^[[1~" beginning-of-line -bindkey "^[OH" beginning-of-line -bindkey "^[[F"  end-of-line -bindkey "^[[4~" end-of-line -bindkey "^[OF" end-of-line -bindkey ' ' magic-space    # also do history expansion on space - -bindkey "^[[1;5C" forward-word -bindkey "^[[1;5D" backward-word - -bindkey '^[[Z' reverse-menu-complete - -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ -bindkey '^?' backward-delete-char -bindkey "^[[3~" delete-char -bindkey "^[3;5~" delete-char -bindkey "\e[3~" delete-char +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets + +# Make sure that the terminal is in application mode when zle is active, since +# only then values from $terminfo are valid +if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then +  function zle-line-init() { +    echoti smkx +  } +  function zle-line-finish() { +    echoti rmkx +  } +  zle -N zle-line-init +  zle -N zle-line-finish +fi + +bindkey -e                                          # Use emacs key bindings + +bindkey '\ew' kill-region                           # [Esc-w] - Kill from the cursor to the mark +bindkey -s '\el' 'ls\n'                             # [Esc-l] - run command: ls +bindkey '^r' history-incremental-search-backward    # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. +bindkey "${terminfo[kpp]}" up-line-or-history       # [PageUp] - Up a line of history +bindkey "${terminfo[knp]}" down-line-or-history     # [PageDown] - Down a line of history + +bindkey "${terminfo[kcuu1]}" up-line-or-search      # start typing + [Up-Arrow] - fuzzy find history forward +bindkey "${terminfo[kcud1]}" down-line-or-search    # start typing + [Down-Arrow] - fuzzy find history backward + +bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line +bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line + +bindkey ' ' magic-space                             # [Space] - do history expansion + +bindkey '^[[1;5C' forward-word                      # [Ctrl-RightArrow] - move forward one word +bindkey '^[[1;5D' backward-word                     # [Ctrl-LeftArrow] - move backward one word + +bindkey "${terminfo[kcbt]}" reverse-menu-complete   # [Shift-Tab] - move through the completion menu backwards + +bindkey '^?' backward-delete-char                   # [Backspace] - delete backward +bindkey "${terminfo[kdch1]}" delete-char            # [Delete] - delete forward  # Edit the current command line in $EDITOR  autoload -U edit-command-line diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh new file mode 100644 index 000000000..3f7fb1995 --- /dev/null +++ b/plugins/aws/aws.plugin.zsh @@ -0,0 +1,17 @@ +export AWS_HOME=~/.aws + +function agp { +  echo $AWS_DEFAULT_PROFILE +   +} +function asp { +  export AWS_DEFAULT_PROFILE=$1 +    export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>" +     +} +function aws_profiles { +  reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) +} + +compctl -K aws_profiles asp +source `which aws_zsh_completer.sh` diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 16ad3e651..e39cc5b8f 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -17,12 +17,16 @@ if [[ $(uname) == "Darwin" ]] ; then      integer i=$(((currentcapacity/maxcapacity) * 100))      echo $i    } + +  function plugged_in() { +    [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ] +  }    function battery_pct_remaining() { -    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then -      battery_pct -    else +    if plugged_in ; then        echo "External Power" +    else +      battery_pct      fi    } diff --git a/plugins/brew/_brew b/plugins/brew/_brew index d4306f223..9eb3bb557 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -11,10 +11,25 @@ _brew_installed_formulae() {    installed_formulae=(`brew list`)  } +_brew_installed_taps() { +  installed_taps=(`brew tap`) +} + +_brew_outdated_formulae() { +  outdated_formulae=(`brew outdated`) +} + +_brew_running_services() { +  running_services=(`brew services list | awk '{print $1}'`) +} +  local -a _1st_arguments  _1st_arguments=( +  'audit:check formulae for Homebrew coding style' +  'bundle:look for a Brewfile and run each line as a brew command'    'cat:display formula file for a formula'    'cleanup:uninstall unused and old versions of packages' +  'commands:show a list of commands'    'create:create a new formula'    'deps:list dependencies and dependants of a formula'    'doctor:audits your installation for common issues' @@ -22,27 +37,38 @@ _1st_arguments=(    'home:visit the homepage of a formula or the brew project'    'info:information about a formula'    'install:install a formula' +  'reinstall:install a formula anew; re-using its current options'    '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.' -  'options:display install options specific to formula.' -  'outdated:list formulas for which a newer version is available' +  'outdated:list formulae for which a newer version is available' +  'pin:pin specified formulae'    'prune:remove dead links' -  'reinstall:reinstall a formula'    '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)' -  'services:manage background services via launchctl' +  'services:small wrapper around `launchctl` for supported formulae' +  'tap:tap a new formula repository from GitHub, or list existing taps'    'unlink:unlink a formula' +  'unpin:unpin specified formulae' +  'untap:remove a tapped repository'    'update:freshen up links'    'upgrade:upgrade outdated formulae' -  'uses:show formulas which depend on a formula' -  'versions:show all available formula versions' +  'uses:show formulae which depend on a formula' +) + +local -a _service_arguments +_service_arguments=( +  'cleanup:get rid of stale services and unused plists' +  'list:list all services managed by `brew services`' +  'restart:gracefully restart selected service' +  'start:start selected service' +  'stop:stop selected service'  )  local expl -local -a formulae installed_formulae +local -a formulae installed_formulae installed_taps outdated_formulae running_services  _arguments \    '(-v)-v[verbose]' \ @@ -61,24 +87,41 @@ if (( CURRENT == 1 )); then  fi  case "$words[1]" in -  search|-S) -    _arguments \ -      '(--macports)--macports[search the macports repository]' \ -      '(--fink)--fink[search the fink repository]' ;; +  install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options) +    _brew_all_formulae +    _wanted formulae expl 'all formulae' compadd -a formulae ;;    list|ls)      _arguments \        '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ +      '(--pinned)--pinned[list all versions of pinned formulae]' \        '(--versions)--versions[list all installed versions of a formula]' \ -      '1: :->forms' &&  return 0 +      '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|versions) -    _brew_all_formulae -    _wanted formulae expl 'all formulae' compadd -a formulae ;; -  reinstall|remove|rm|uninstall|unlink|cleanup|link|ln) +  remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)      _brew_installed_formulae      _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; +  search|-S) +    _arguments \ +      '(--macports)--macports[search the macports repository]' \ +      '(--fink)--fink[search the fink repository]' ;; +  services) +    if [[ -n "$words[2]" ]]; then +      case "$words[2]" in +        restart|start|stop) +          _brew_running_services +          _wanted running_services expl 'running services' compadd -a running_services ;; +      esac +    else +      _describe -t commands "brew services subcommand" _service_arguments +    fi ;; +  untap) +    _brew_installed_taps +    _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;; +  upgrade) +    _brew_outdated_formulae +    _wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;  esac diff --git a/plugins/docker/_docker b/plugins/docker/_docker index f13f876cf..12eee7a15 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -111,7 +111,7 @@ __ps() {          '-beforeId="[Show only container created before Id, include non-running ones.]' \          '-l[Show only the latest created container, include non-running ones.]' \          '-n=[Show n last created containers, include non-running ones.]' \ -        '-notrurrrrnc[Dont truncate output]' \ +        '-notrunc[Dont truncate output]' \          '-q[Only display numeric IDs]' \          '-s[Display sizes]' \          '-sinceId="[Show only containers created since Id, include non-running ones.]' diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh new file mode 100644 index 000000000..a3f0085a8 --- /dev/null +++ b/plugins/emacs/emacs.plugin.zsh @@ -0,0 +1,56 @@ +# Emacs 23 daemon capability is a killing feature. +# One emacs process handles all your frames whether +# you use a frame opened in a terminal via a ssh connection or X frames +# opened on the same host. + +# Benefits are multiple +# - You don't have the cost of starting Emacs all the time anymore +# - Opening a file is as fast as Emacs does not have anything else to do. +# - You can share opened buffered across opened frames. +# - Configuration changes made at runtime are applied to all frames. + + +if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then +    export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh" + +    # set EDITOR if not already defined. +    export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}" + +    alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait" +    alias e=emacs + +    # same than M-x eval but from outside Emacs. +    alias eeval="$EMACS_PLUGIN_LAUNCHER --eval" +    # create a new X frame +    alias eframe='emacsclient --alternate-editor "" --create-frame' + +    # to code all night long +    alias emasc=emacs +    alias emcas=emacs + +    # Write to standard output the path to the file +    # opened in the current buffer. +    function efile { +        local cmd="(buffer-file-name (window-buffer))" +        "$EMACS_PLUGIN_LAUNCHER" --eval "$cmd" | tr -d \" +    } + +    # Write to standard output the directory of the file +    # opened in the the current buffer +    function ecd { +        local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) +                     (if buf-name (file-name-directory buf-name)))" + +        local dir="$($EMACS_PLUGIN_LAUNCHER --eval $cmd | tr -d \")" +        if [ -n "$dir" ] ;then +            echo "$dir" +        else +            echo "can not deduce current buffer filename." >/dev/stderr +            return 1 +        fi +    } +fi + +## Local Variables: +## mode: sh +## End: diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh new file mode 100755 index 000000000..38d419813 --- /dev/null +++ b/plugins/emacs/emacsclient.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# get list of available X windows. +x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` + +if [ -z "$x" ] ;then +    # Create one if there is no X window yet. +    emacsclient --alternate-editor "" --create-frame "$@" +else +    # prevent creating another X frame if there is at least one present. +    emacsclient --alternate-editor "" "$@" +fi diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 66a10cfdb..25b1a1e1b 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -84,5 +84,14 @@ exist_gh() { # [DIRECTORY]      git push -u origin master  } +# git.io "GitHub URL" +# +# Shorten GitHub url, example: +#   https://github.com/nvogel/dotzsh    >   http://git.io/8nU25w   +# source: https://github.com/nvogel/dotzsh +# documentation: https://github.com/blog/985-git-io-github-url-shortener +# +git.io() {curl -i -s http://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "} +  # End Functions ############################################################# diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index ae065c12f..1b32ec2e4 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -36,3 +36,15 @@ alias nomnom='killall'  alias byes='exit'  alias cya='reboot'  alias kthxbai='halt' + +alias pwned='ssh' + +alias hackzor='git init' +alias rulz='git push' +alias bringz='git pull' +alias chicken='git add' +alias oanward='git commit -m' +alias ooanward='git commit -am' +alias letcat='git checkout' +alias violenz='git rebase' + diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index d2db89d04..2e99a12fb 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -13,7 +13,7 @@ alias hglr='hg pull --rebase'  alias hgo='hg outgoing'  alias hgp='hg push'  alias hgs='hg status' -alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" ' +alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '  # this is the 'git commit --amend' equivalent  alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor new file mode 100644 index 000000000..cd7fc304f --- /dev/null +++ b/plugins/meteor/_meteor @@ -0,0 +1,48 @@ +#compdef meteor +#autoload + +# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion +# Original author: Dimitri JORGE (https://github.com/jorge-d) + +_meteor_all_packages() { +  packages=(`meteor list | cut -d" " -f1`) +} +_meteor_installed_packages() { +  installed_packages=(`meteor list --using`) +} + +local -a _1st_arguments +_1st_arguments=( +  'run:[Default] Run this project in local development mode' +  'create:Create a new project' +  'update:Upgrade this project to the latest version of Meteor' +  'add:Add a package to this project' +  'remove:Remove a package from this project' +  'list:List available packages' +  'help:Display Meteor help' +  'bundle:Pack this project up into a tarball' +  'mongo:Connect to the Mongo database for the specified site' +  'deploy:Deploy this project to Meteor' +  'logs:Show logs for specified site' +  'reset:Reset the project state. Erases the local database.' +  'test-packages:Test one or more packages' +) + +local expl +local -a packages installed_packages + +if (( CURRENT == 2 )); then +  _describe -t commands "meteor subcommand" _1st_arguments +  return +fi + +case "$words[2]" in +    help) +      _describe -t commands "meteor subcommand" _1st_arguments ;; +    remove) +      _meteor_installed_packages +      _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;; +    add) +      _meteor_all_packages +      _wanted packages expl 'all packages' compadd -a packages ;; +esac
\ No newline at end of file diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 0c9141907..ed7968534 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -52,6 +52,11 @@ alias mvnc='mvn clean'  alias mvncom='mvn compile'  alias mvnt='mvn test'  alias mvnag='mvn archetype:generate' +alias mvn-updates='mvn versions:display-dependency-updates' +alias mvntc7='mvn tomcat7:run'  +alias mvntc='mvn tomcat:run' +alias mvnjetty='mvn jetty:run' +  function listMavenCompletions {        reply=( diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index 4a96754e4..fb46cdcf0 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -1,10 +1,10 @@  function _rails_command () { -  if [ -e "script/server" ]; then -    ruby script/$@ +  if [ -e "bin/rails" ]; then +    bin/rails $@    elif [ -e "script/rails" ]; then      ruby script/rails $@ -  elif [ -e "bin/rails" ]; then -    bin/rails $@ +  elif [ -e "script/server" ]; then +    ruby script/$@    else      rails $@    fi diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 4f008ba4e..ef6da5bd3 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -9,7 +9,7 @@ function svn_prompt_info() {        _DISPLAY=$(svn_get_repo_name)      fi      echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ -$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" +$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$(svn_dirty_pwd)$ZSH_PROMPT_BASE_COLOR"      unset _DISPLAY    fi  } @@ -74,3 +74,22 @@ function svn_dirty_choose() {  function svn_dirty() {    svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN  } + +function svn_dirty_choose_pwd () { +  if in_svn; then +    root=`pwd` +    if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then +      # Grep exits with 0 when "One or more lines were selected", return "dirty". +      echo $1 +    else +      # Otherwise, no lines were found, or an error occurred. Return clean. +      echo $2 +    fi +  fi +} + +function svn_dirty_pwd () { +  svn_dirty_choose_pwd $ZSH_THEME_SVN_PROMPT_DIRTY_PWD $ZSH_THEME_SVN_PROMPT_CLEAN_PWD +} + + diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index b2cad20e8..c2254d055 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -11,13 +11,13 @@ ZSH_THEME="robbyrussell"  # alias zshconfig="mate ~/.zshrc"  # alias ohmyzsh="mate ~/.oh-my-zsh" -# Set to this to use case-sensitive completion +# Set this to use case-sensitive completion  # CASE_SENSITIVE="true"  # Uncomment this to disable bi-weekly auto-update checks  # DISABLE_AUTO_UPDATE="true" -# Uncomment to change how often before auto-updates occur? (in days) +# Uncomment to change how often to auto-update? (in days)  # export UPDATE_ZSH_DAYS=13  # Uncomment following line if you want to disable colors in ls @@ -37,9 +37,9 @@ ZSH_THEME="robbyrussell"  # much faster.  # DISABLE_UNTRACKED_FILES_DIRTY="true" -# Uncomment following line if you want to  shown in the command execution time stamp  -# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"| -# yyyy-mm-dd +# Uncomment following line if you want to the command execution time stamp shown  +# in the history command output. +# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"  # HIST_STAMPS="mm/dd/yyyy"  # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) @@ -66,4 +66,3 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH  # ssh  # export SSH_KEY_PATH="~/.ssh/dsa_id" - diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index b64714f32..aa3093f64 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -2,12 +2,12 @@  # #  # # #README  # # -# # This theme provides two customizable header functionalities :  +# # This theme provides two customizable header functionalities:  # # a) displaying a pseudo-random message from a database of quotations  # # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29) -# # b) displaying randomly command line tips from The command line fu  +# # b) displaying randomly command line tips from The command line fu  # # (http://www.commandlinefu.com) community: in order to make use of this functionality -# # you will need Internet connection.  +# # you will need Internet connection.  # # This theme provides as well information for the current user's context, like;  # # branch and status for the current version control system (git and svn currently  # # supported) and time, presented to the user in a non invasive volatile way. @@ -25,11 +25,8 @@  # # -Solarized theme (https://github.com/altercation/solarized/)  # # -OS X: iTerm 2 (http://www.iterm2.com/)  # # -font Source code pro (https://github.com/adobe/source-code-pro) -# #  -# # Author: Adolfo Benedetti -# # email: adolfo.benedetti@gmail.com -# # License: Public Domain -# # This theme's look and feel is based on the Aaron Toponce's zsh theme , more info:  +# # +# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info:  # # http://pthree.org/2008/11/23/727/  # # enjoy!  ########## COLOR ########### diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 3c2f45658..97d142a0f 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -1,12 +1,6 @@  # af-magic.zsh-theme -# -# Author: Andy Fleming -# URL: http://andyfleming.com/  # Repo: https://github.com/andyfleming/oh-my-zsh  # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme -# -# Created on:		June 19, 2012 -# Last modified on:	June 20, 2012  if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi  local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index 51f5e375a..a21a9c8c4 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -1,22 +1,4 @@ -# -# Author:: Andrew Vit (<andrew@avit.ca>) -#  # AVIT ZSH Theme -# -# Copyright 2011, Andrew Vit -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -#     http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#  PROMPT='  $(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version) diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme index 25aeb6597..718977d90 100644 --- a/themes/candy-kingdom.zsh-theme +++ b/themes/candy-kingdom.zsh-theme @@ -1,11 +1,4 @@  # neuralsanwich.zsh-theme -# -# Author: Sean Jones -# URL: http://www.neuralsandwich.com -# Repo:  -# Direct link: -# Create: -# Modified:   if [ "x$OH_MY_ZSH_HG" = "x" ]; then      OH_MY_ZSH_HG="hg" diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme index f4d65ab74..0bd38acc2 100644 --- a/themes/dogenpunk.zsh-theme +++ b/themes/dogenpunk.zsh-theme @@ -1,10 +1,4 @@ -# ----------------------------------------------------------------------------- -#          FILE: dogenpunk.zsh-theme -#   DESCRIPTION: oh-my-zsh theme file. -#        AUTHOR: Matthew Nelson (dogenpunk@gmail.com) -#       VERSION: 0.1 -#    SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- +# dogenpunk.zsh-theme  MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"  local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme index 7350b4335..3849c35be 100644 --- a/themes/duellj.zsh-theme +++ b/themes/duellj.zsh-theme @@ -1,4 +1,3 @@ -  # 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 diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index db2529990..1b284cdc2 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -1,4 +1,4 @@ -#RVM settings +# RVM settings  if [[ -s ~/.rvm/scripts/rvm ]] ; then     RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"  else @@ -12,7 +12,7 @@ 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 +# 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 diff --git a/themes/essembeh.zsh-theme b/themes/essembeh.zsh-theme index 8c98ea1ed..939bb7a4c 100644 --- a/themes/essembeh.zsh-theme +++ b/themes/essembeh.zsh-theme @@ -1,7 +1,6 @@  # Theme with full path names and hostname  # Handy if you work on different servers all the time; -  local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"  function my_git_prompt_info() { diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 7154e09f1..901c4d99f 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -1,4 +1,4 @@ -# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) +# fino-time.zsh-theme  # Use with a dark background and 256-color terminal!  # Meant for people with RVM and git. Tested only on OS X 10.7. diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 4c7aabcff..35e6e02c1 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -1,4 +1,4 @@ -# Fino theme by Max Masnick (http://max.masnick.me) +# fino.zsh-theme  # Use with a dark background and 256-color terminal!  # Meant for people with rbenv and git. Tested only on OS X 10.7. @@ -11,7 +11,6 @@  #  # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ -  function prompt_char {    git branch >/dev/null 2>/dev/null && echo "±" && return    echo '○' @@ -41,4 +40,4 @@ PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$F  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 +ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" diff --git a/themes/fox.zsh-theme b/themes/fox.zsh-theme index 1959853cf..3ecd4e204 100644 --- a/themes/fox.zsh-theme +++ b/themes/fox.zsh-theme @@ -1,4 +1,5 @@ -#fox theme +# fox.zsh-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%}' diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index d624e3afc..1ff86b54c 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -18,7 +18,11 @@ else    if which rbenv &> /dev/null; then      RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'    else -    RPS1='$(git_custom_status) $EPS1' +    if which chruby_prompt_info &> /dev/null; then +      RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1' +    else +      RPS1='$(git_custom_status) $EPS1' +    fi    fi  fi diff --git a/themes/gianu.zsh-theme b/themes/gianu.zsh-theme index c7fe40665..faa80218e 100644 --- a/themes/gianu.zsh-theme +++ b/themes/gianu.zsh-theme @@ -1,8 +1,3 @@ -# Oh-my-Zsh prompt created by gianu -# -# github.com/gianu -# sgianazza@gmail.com -  PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ '  ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[green]%}" diff --git a/themes/intheloop.zsh-theme b/themes/intheloop.zsh-theme index 85b4a4d95..7a98db27a 100644 --- a/themes/intheloop.zsh-theme +++ b/themes/intheloop.zsh-theme @@ -1,4 +1,3 @@ -# ZSH theme by James Smith (http://loopj.com)  # A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status  local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" @@ -21,4 +20,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}"  ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})"  ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}"  ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}"
\ No newline at end of file +ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme index afc2abf69..c23889edf 100644 --- a/themes/itchy.zsh-theme +++ b/themes/itchy.zsh-theme @@ -1,4 +1,3 @@ -# Created by Daniel Bayerlein https://github.com/danielbayerlein  # Inspired by http://peepcode.com/blog/2012/my-command-line-prompt  local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme index aecc5b961..da1dd1e5d 100644 --- a/themes/jaischeema.zsh-theme +++ b/themes/jaischeema.zsh-theme @@ -1,11 +1,4 @@ -# ------------------------------------------------------------------------------ -#          FILE:  jaischeema.zsh-theme -#   DESCRIPTION:  oh-my-zsh theme file. -#        AUTHOR:  Jais Cheema -#       VERSION:  0.0.1 -# ------------------------------------------------------------------------------ - - +# jaischeema.zsh-theme  PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} ' diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme index 2f715cc9e..bc470e838 100644 --- a/themes/juanghurtado.zsh-theme +++ b/themes/juanghurtado.zsh-theme @@ -1,7 +1,4 @@ -# ------------------------------------------------------------------------ -# Juan G. Hurtado oh-my-zsh theme -# (Needs Git plugin for current_branch method) -# ------------------------------------------------------------------------ +# Needs Git plugin for current_branch method  # Color shortcuts  RED=$fg[red] @@ -43,4 +40,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"  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 +RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 57b4070dc..01fae4b95 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -1,8 +1,4 @@ -# ------------------------------------------------------------------------ -# Tyler Cipriani  -# oh-my-zsh theme  # Totally ripped off Dallas theme -# ------------------------------------------------------------------------  # Grab the current date (%W) and time (%t):  JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme index 0e9b5e73c..8e8894a34 100644 --- a/themes/kphoen.zsh-theme +++ b/themes/kphoen.zsh-theme @@ -1,11 +1,4 @@ -# ------------------------------------------------------------------------------ -#          FILE:  kphoen.zsh-theme -#   DESCRIPTION:  oh-my-zsh theme file. -#        AUTHOR:  Kévin Gomez (geek63@gmail.com) -#       VERSION:  1.0.0 -#    SCREENSHOT: -# ------------------------------------------------------------------------------ - +# kphoen.zsh-theme  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)] diff --git a/themes/pure.zsh-theme b/themes/pure.zsh-theme index d7ed624e4..1473194a5 100644 --- a/themes/pure.zsh-theme +++ b/themes/pure.zsh-theme @@ -18,28 +18,6 @@  #   Github:   https://github.com/nicoulaj  #   Twitter:  https://twitter.com/nicoulaj  # -# License -# -# Copyright (c) 2013 Kasper Kronborg Isager -# -# 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: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -#  # ------------------------------------------------------------------------------  # Set required options diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme index c0c5c9c71..b33f23e1c 100644 --- a/themes/rixius.zsh-theme +++ b/themes/rixius.zsh-theme @@ -1,6 +1,3 @@ -# /|/ 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 { diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 4ab3bc757..6289427c2 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -18,8 +18,11 @@ 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" +  ref1=$(git symbolic-ref HEAD 2> /dev/null) || return +  ref2=$(git rev-parse HEAD | head -c 6) || return +  ref="$ref1 %{$fg[grey]%}$ref2" +  #ref=$(git symbolic-ref HEAD 2> /dev/null) $(git rev-parse HEAD | head -c 6) || return +  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "  }  function retcode() {} diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme index bbd1031e1..f2b0526b7 100644 --- a/themes/smt.zsh-theme +++ b/themes/smt.zsh-theme @@ -1,10 +1,4 @@ -# ----------------------------------------------------------------------------- -#          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 -# ----------------------------------------------------------------------------- +# smt.zsh-theme, based on dogenpunk by Matthew Nelson.  MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"  local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} " diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme index 601dbe5d7..ac6a49840 100644 --- a/themes/sorin.zsh-theme +++ b/themes/sorin.zsh-theme @@ -1,11 +1,5 @@ -# ------------------------------------------------------------------------------ -#          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 -# ------------------------------------------------------------------------------ - +# sorin.zsh-theme +# 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%}" diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 312229e9f..e0080b8a5 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -8,7 +8,7 @@  # http://briancarper.net/blog/570/git-info-in-your-zsh-prompt  function virtualenv_info { -    [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +    [ $VIRTUAL_ENV ] && echo '('$fg[blue]`basename $VIRTUAL_ENV`%{$reset_color%}') '  }  PR_GIT_UPDATE=1 @@ -87,7 +87,7 @@ function steeef_precmd {          else              FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"          fi -        zstyle ':vcs_info:*:prompt:*' formats       "${FMT_BRANCH}" +        zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} "          vcs_info 'prompt'          PR_GIT_UPDATE= @@ -96,5 +96,5 @@ function steeef_precmd {  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)$ ' +%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_$(virtualenv_info)%{$reset_color%} +$ ' diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index acc6ed312..4bea20a1b 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -1,8 +1,6 @@ -#------------------------------------------------------------------------------- -# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) +# Sunrise theme for oh-my-zsh  # Intended to be used with Solarized: http://ethanschoonover.com/solarized  # (Needs Git plugin for current_branch method) -#-------------------------------------------------------------------------------  # Color shortcuts  R=$fg_no_bold[red] diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index cba14c42c..cb1c43c56 100644 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -1,5 +1,4 @@ -# Name:   trapd00r zsh theme -# Author: Magnus Woldrich <m@japh.se> +# trapd00r.zsh-theme  #  # 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 diff --git a/tools/install.sh b/tools/install.sh index b24bb4ad3..71e19a389 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,29 +1,31 @@ -ZSH=`/usr/bin/env|grep 'ZSH='|cut -d '=' -f 2` -if [ -d "$ZSH" ] -then +set -e + +if [ ! -n "$ZSH" ]; then +  ZSH=~/.oh-my-zsh +fi + +if [ -d "$ZSH" ]; then    echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install"    exit -elif [ -d ~/.oh-my-zsh ] -then -  echo "\033[0;33mYou already have One Oh My Zsh Directory.\033[0m You'll need to remove  ~/.oh-my-zsh if you want to clone" -  exit  fi  echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { +hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {    echo "git not installed"    exit  }  echo "\033[0;34mLooking for an existing zsh config...\033[0m" -if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] -then +if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then    echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";    mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;  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 +cp $ZSH/templates/zshrc.zsh-template ~/.zshrc +sed -i -e "/^ZSH=/ c\\ +ZSH=$ZSH +" ~/.zshrc  echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"  sed -i -e "/export PATH=/ c\\ @@ -38,9 +40,8 @@ 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" +echo "\033[0;32m"'                        /____/                       ....is now installed!'"\033[0m"  echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" +echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"  /usr/bin/env zsh  . ~/.zshrc  | 
