Browse code

Merge remote-tracking branch 'robbyrussell/master'

Adam Lindberg authored on 07/06/2011 at 13:31:26
Showing 16 changed files
... ...
@@ -52,11 +52,11 @@ git_prompt_status() {
52 52
   if $(echo "$INDEX" | grep '^R  ' &> /dev/null); then
53 53
     STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
54 54
   fi
55
-  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
55
+  if $(echo "$INDEX" | grep '^D ' &> /dev/null); then
56 56
     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
57 57
   fi
58 58
   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
59 59
     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
60 60
   fi
61 61
   echo $STATUS
62
-}
63 62
\ No newline at end of file
63
+}
... ...
@@ -1,3 +1,9 @@
1
+# Check for updates on initial load...
2
+if [ "$DISABLE_AUTO_UPDATE" != "true" ]
3
+then
4
+  /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
5
+fi
6
+
1 7
 # Initializes Oh My Zsh
2 8
 
3 9
 # add a function path
... ...
@@ -28,7 +34,6 @@ done
28 28
 for config_file ($ZSH/custom/*.zsh) source $config_file
29 29
 
30 30
 # Load the theme
31
-# Check for updates on initial load...
32 31
 if [ "$ZSH_THEME" = "random" ]
33 32
 then
34 33
   themes=($ZSH/themes/*zsh-theme)
... ...
@@ -41,11 +46,3 @@ else
41 41
   source "$ZSH/themes/$ZSH_THEME.zsh-theme"
42 42
 fi
43 43
 
44
-
45
-# Check for updates on initial load...
46
-if [ "$DISABLE_AUTO_UPDATE" = "true" ]
47
-then
48
-  return
49
-else
50
-  /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
51
-fi
... ...
@@ -2,14 +2,14 @@ stat -f%m . > /dev/null 2>&1
2 2
 if [ "$?" = 0 ]; then
3 3
 	stat_cmd=(stat -f%m)
4 4
 else
5
-	stat_cmd=(stat -L --format=%y)
5
+	stat_cmd=(stat -L --format=%Y)
6 6
 fi
7 7
 
8 8
 _ant_does_target_list_need_generating () {
9 9
   if [ ! -f .ant_targets ]; then return 0;
10 10
   else
11
-    accurate=$($stat_cmd -f%m .ant_targets)
12
-    changed=$($stat_cmd -f%m build.xml)
11
+    accurate=$($stat_cmd .ant_targets)
12
+    changed=$($stat_cmd build.xml)
13 13
     return $(expr $accurate '>=' $changed)
14 14
   fi
15 15
 }
... ...
@@ -1,13 +1 @@
1
-# Move /usr/local/bin (path where brews are linked) to the front of the path
2
-# This will allow us to override system binaries like ruby with our brews
3
-# TODO: Do this in a more compatible way.
4
-#       What if someone doesn't have /usr/bin in their path?
5
-export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
6
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'`     # Add it in front of /usr/bin
7
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'`    # Add /usr/local/sbin
8
-
9 1
 alias brews='brew list -1'
10
-
11
-function brew-link-completion {
12
-	ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
13
-}
... ...
@@ -1,8 +1,5 @@
1
-# This works if you installed node via homebrew.
2
-export NODE_PATH="/usr/local/lib/node"
3
-
4 1
 # Open the node api for your current version to the optional section.
5 2
 # TODO: Make the section part easier to use.
6
-function node-api {
3
+function node-docs {
7 4
 	open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
8 5
 }
9 6
deleted file mode 100644
... ...
@@ -1,2 +0,0 @@
1
-# TODO: Don't do this in such a weird way.
2
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'`
... ...
@@ -1,7 +1,3 @@
1
-fpath=($ZSH/plugins/rvm $fpath)
2
-autoload -U compinit
3
-compinit -i
4
-
5 1
 alias rubies='rvm list rubies'
6 2
 alias gemsets='rvm gemset list'
7 3
 
... ...
@@ -35,10 +31,6 @@ function rvm-update {
35 35
 	rvm reload # TODO: Reload rvm completion?
36 36
 }
37 37
 
38
-function rvm-link-completion {
39
-	ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official"
40
-}
41
-
42 38
 # TODO: Make this usable w/o rvm.
43 39
 function gems {
44 40
 	local current_ruby=`rvm-prompt i v p`
... ...
@@ -13,7 +13,7 @@ function in_svn() {
13 13
 }
14 14
 
15 15
 function svn_get_repo_name {
16
-    if [ is_svn ]; then
16
+    if [ in_svn ]; then
17 17
         svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
18 18
     
19 19
         svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
... ...
@@ -21,13 +21,13 @@ function svn_get_repo_name {
21 21
 }
22 22
 
23 23
 function svn_get_rev_nr {
24
-    if [ is_svn ]; then
24
+    if [ in_svn ]; then
25 25
         svn info 2> /dev/null | sed -n s/Revision:\ //p
26 26
     fi
27 27
 }
28 28
 
29 29
 function svn_dirty_choose {
30
-    if [ is_svn ]; then
30
+    if [ in_svn ]; then
31 31
         s=$(svn status 2>/dev/null)
32 32
         if [ $s ]; then 
33 33
             echo $1
... ...
@@ -39,4 +39,4 @@ function svn_dirty_choose {
39 39
 
40 40
 function svn_dirty {
41 41
     svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
42
-}
43 42
\ No newline at end of file
43
+}
44 44
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+
1
+local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
2
+local pwd='%{$fg[blue]%}%~%{$reset_color%}'
3
+local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
4
+local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
5
+local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
6
+
7
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
8
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
9
+ZSH_THEME_GIT_PROMPT_DIRTY=""
10
+ZSH_THEME_GIT_PROMPT_CLEAN=""
11
+
12
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
13
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
14
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
15
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
16
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
17
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
18
+
19
+PROMPT="${user} ${pwd}$ "
20
+RPROMPT="${return_code} ${git_branch} ${rvm}"
21
+
0 22
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme
1
+
2
+let TotalBytes=0
3
+for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }')
4
+do
5
+   let TotalBytes=$TotalBytes+$Bytes
6
+done
7
+		# should it say b, kb, Mb, or Gb
8
+if [ $TotalBytes -lt 1024 ]; then
9
+   TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc)
10
+   suffix="b"
11
+elif [ $TotalBytes -lt 1048576 ]; then
12
+   TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc)
13
+   suffix="kb"
14
+elif [ $TotalBytes -lt 1073741824 ]; then
15
+   TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc)
16
+   suffix="Mb"
17
+else
18
+   TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc)
19
+   suffix="Gb"
20
+fi
21
+
22
+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%} ☞ '
23
+
24
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±("
25
+ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}"
0 26
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+# Yay! High voltage and arrows!
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
3
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
4
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
5
+ZSH_THEME_GIT_PROMPT_CLEAN=""
6
+
7
+PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} '
0 8
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# Based on robbyrussell's theme, with host and rvm indicators. Example:
1
+# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname)
2
+
3
+# Get the current ruby version in use with RVM:
4
+if [ -e ~/.rvm/bin/rvm-prompt ]; then
5
+    RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} "
6
+fi
7
+
8
+# Get the host name (first 4 chars)
9
+HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜  %{$fg_bold[cyan]%}%c "
10
+GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}"
11
+PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT"
12
+
13
+ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
14
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
15
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
16
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
0 17
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# Git-centric variation of the "fishy" theme.
1
+# See screenshot at http://ompldr.org/vOHcwZg
2
+
3
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+"
4
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!"
5
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-"
6
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>"
7
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#"
8
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?"
9
+
10
+ZSH_THEME_GIT_PROMPT_PREFIX=""
11
+ZSH_THEME_GIT_PROMPT_SUFFIX=" "
12
+ZSH_THEME_GIT_PROMPT_DIRTY=""
13
+ZSH_THEME_GIT_PROMPT_CLEAN=""
14
+
15
+local user_color='green'
16
+test $UID -eq 0 && user_color='red'
17
+
18
+PROMPT='%(?..%{$fg_bold[red]%}exit %?
19
+%{$reset_color%})'\
20
+'%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\
21
+'$(git_prompt_info)'\
22
+'%{$fg[$user_color]%}%~%{$reset_color%}'\
23
+'%(!.#.>) '
24
+
25
+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
0 26
deleted file mode 100644
... ...
@@ -1,29 +0,0 @@
1
-function prompt_char {
2
-    git branch >/dev/null 2>/dev/null && echo '±' && return
3
-    hg root >/dev/null 2>/dev/null && echo '☿' && return
4
-    echo '○'
5
-}
6
-
7
-function virtualenv_info {
8
-    [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
9
-}
10
-
11
-function hg_prompt_info {
12
-    hg prompt --angle-brackets "\
13
-< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
14
-< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
15
-%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
16
-patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
17
-}
18
-
19
-PROMPT='
20
-%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
21
-$(virtualenv_info)$(prompt_char) '
22
-
23
-ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
24
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
25
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
26
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
27
-ZSH_THEME_GIT_PROMPT_CLEAN=""
28
-
29
-. ~/bin/dotfiles/zsh/aliases
... ...
@@ -1,36 +1,36 @@
1 1
 if [ -d ~/.oh-my-zsh ]
2 2
 then
3
-  echo "You already have Oh My Zsh installed. You'll need to remove ~/.oh-my-zsh if you want to install"
3
+  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"
4 4
   exit
5 5
 fi
6 6
 
7
-echo "Cloning Oh My Zsh..."
7
+echo "\033[0;34mCloning Oh My Zsh...\033[0m"
8 8
 /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
9 9
 
10
-echo "Looking for an existing zsh config..."
10
+echo "\033[0;34mLooking for an existing zsh config...\033[0m"
11 11
 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
12 12
 then
13
-  echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
13
+  echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32]Backing up to ~/.zshrc.pre-oh-my-zsh\033[0m";
14 14
   cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
15 15
   rm ~/.zshrc;
16 16
 fi
17 17
 
18
-echo "Using the Oh My Zsh template file and adding it to ~/.zshrc"
18
+echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
19 19
 cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
20 20
 
21
-echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
21
+echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
22 22
 echo "export PATH=$PATH" >> ~/.zshrc
23 23
 
24
-echo "Time to change your default shell to zsh!"
24
+echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
25 25
 chsh -s `which zsh`
26 26
 
27
-echo '         __                                     __  '
28
-echo '  ____  / /_     ____ ___  __  __   ____  _____/ /_ '
29
-echo ' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '
30
-echo '/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '
31
-echo '\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '
32
-echo '                        /____/'
27
+echo "\033[0;32m"'         __                                     __   '"\033[0m"
28
+echo "\033[0;32m"'  ____  / /_     ____ ___  __  __   ____  _____/ /_  '"\033[0m"
29
+echo "\033[0;32m"' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '"\033[0m"
30
+echo "\033[0;32m"'/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '"\033[0m"
31
+echo "\033[0;32m"'\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '"\033[0m"
32
+echo "\033[0;32m"'                        /____/                       '"\033[0m"
33 33
 
34
-echo "\n\n ....is now installed."
34
+echo "\n\n \033[0;32m....is now installed.\033[0m"
35 35
 /usr/bin/env zsh
36 36
 source ~/.zshrc
... ...
@@ -1,12 +1,12 @@
1 1
 current_path=`pwd`
2
-echo "Upgrading Oh My Zsh"
2
+echo "\033[0;34mUpgrading Oh My Zsh\033[0m"
3 3
 ( cd $ZSH && git pull origin master )
4
-echo '         __                                     __  '
5
-echo '  ____  / /_     ____ ___  __  __   ____  _____/ /_ '
6
-echo ' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '
7
-echo '/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '
8
-echo '\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '
9
-echo '                        /____/'
10
-echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session."
11
-echo "To keep up on the latest, be sure to follow Oh My Zsh on twitter: http://twitter.com/ohmyzsh"
12
-cd $current_path
13 4
\ No newline at end of file
5
+echo "\033[0;32m"'         __                                     __   '"\033[0m"
6
+echo "\033[0;32m"'  ____  / /_     ____ ___  __  __   ____  _____/ /_  '"\033[0m"
7
+echo "\033[0;32m"' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '"\033[0m"
8
+echo "\033[0;32m"'/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '"\033[0m"
9
+echo "\033[0;32m"'\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '"\033[0m"
10
+echo "\033[0;32m"'                        /____/                       '"\033[0m"
11
+echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m"
12
+echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m"
13
+cd $current_path