Browse code

Merge remote branch 'upstream/master'

Conflicts:
plugins/github/github.plugin.zsh

Pat Regan authored on 20/04/2011 at 05:29:58
Showing 10 changed files
... ...
@@ -54,12 +54,6 @@ h3. Uninstalling
54 54
 
55 55
 If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
56 56
 
57
-h2. Thanks
58
-
59
-* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
60
-* Marcel (noradio) provided Rick the original zsh configuration.
61
-* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh.
62
-
63 57
 h2. Help out!
64 58
 
65 59
 I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
... ...
@@ -67,3 +61,11 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y
67 67
 h3. Send us your theme!
68 68
 
69 69
 I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
70
+
71
+h2. Contributors
72
+
73
+This project wouldn't exist without all of our awesome users and contributors.
74
+
75
+* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
76
+
77
+Thank you so much!
70 78
\ No newline at end of file
... ...
@@ -4,7 +4,6 @@ unsetopt menu_complete   # do not autoselect the first completion entry
4 4
 unsetopt flowcontrol
5 5
 setopt auto_menu         # show completion menu on succesive tab press
6 6
 setopt complete_in_word
7
-setopt complete_aliases
8 7
 setopt always_to_end
9 8
 
10 9
 WORDCHARS=''
... ...
@@ -3,11 +3,12 @@
3 3
 #Fully support screen, iterm, and probably most modern xterm and rxvt
4 4
 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
5 5
 function title {
6
-  if [[ "$TERM" == "screen" ]]; then 
7
-    print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
6
+  [ "$DISABLE_AUTO_TITLE" != "true" ] || return
7
+  if [[ $TERM =~ "^screen" ]]; then 
8
+    print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
8 9
   elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
9
-    print -Pn "\e]2;$2\a" #set window name
10
-    print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
10
+    print -Pn "\e]2;$2:q\a" #set window name
11
+    print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
11 12
   fi
12 13
 }
13 14
 
... ...
@@ -16,15 +17,13 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
16 16
 
17 17
 #Appears when you have the prompt
18 18
 function precmd {
19
-  if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
20
-    title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
21
-  fi
19
+  title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
22 20
 }
23 21
 
24 22
 #Appears at the beginning of (and during) of command execution
25 23
 function preexec {
26
-  if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
27
-    local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
28
-    title "$CMD" "%100>...>$2%<<"
29
-  fi
24
+  emulate -L zsh
25
+  setopt extended_glob
26
+  local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
27
+  title "$CMD" "%100>...>$2%<<"
30 28
 }
... ...
@@ -6,24 +6,21 @@ compdef _git gst=git-status
6 6
 alias gl='git pull'
7 7
 compdef _git gl=git-pull
8 8
 alias gup='git fetch && git rebase'
9
-compdef gup=git
9
+compdef _git gup=git-fetch
10 10
 alias gp='git push'
11 11
 compdef _git gp=git-push
12
-alias gd='git diff | mate'
13
-# WTF is mate??
14
-compdef _git gd=git-diff
15
-alias gdv='git diff -w "$@" | vim -R -'
16
-compdef gdv=git
12
+gdv() { git-diff -w "$@" | view - }
13
+compdef _git gdv=git-diff
17 14
 alias gc='git commit -v'
18
-compdef gc=git
15
+compdef _git gc=git-commit
19 16
 alias gca='git commit -v -a'
20
-compdef gca=git
17
+compdef _git gca=git-commit
21 18
 alias gco='git checkout'
22 19
 compdef _git gco=git-checkout
23 20
 alias gb='git branch'
24 21
 compdef _git gb=git-branch
25 22
 alias gba='git branch -a'
26
-compdef gba=git
23
+compdef _git gba=git-branch
27 24
 alias gcount='git shortlog -sn'
28 25
 compdef gcount=git
29 26
 alias gcp='git cherry-pick'
30 27
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# hub alias from defunkt
1
+# https://github.com/defunkt/hub
2
+if [ "$commands[(I)hub]" ]; then
3
+    # eval `hub alias -s zsh`
4
+    function git(){hub "$@"}
5
+fi
6
+
7
+# add github completion function to path
8
+fpath=($ZSH/plugins/github $fpath)
9
+autoload -U compinit
10
+compinit -i
0 11
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+#compdef npm
1
+
2
+# Node Package Manager 0.3.15 completion, letting npm do all the completion work
3
+
4
+_npm() {
5
+  compadd -- $(_npm_complete $words)
6
+}
7
+
8
+# We want to show all errors of any substance, but never the "npm (not )ok" one.
9
+# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
10
+_npm_complete() {
11
+  local ask_npm
12
+  ask_npm=(npm completion --color false --loglevel error -- $@)
13
+  { _call_program npm $ask_npm 2>&1 >&3 \
14
+  | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
15
+  } 3>&1
16
+}
17
+
18
+_npm "$@"
0 19
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add npm completion function to path
1
+fpath=($ZSH/plugins/npm $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+PROMPT=$'
1
+%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%}
2
+%{$fg_bold[black]%}>%{$reset_color%} '
3
+
4
+PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
5
+
6
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
7
+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
8
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
9
+ZSH_THEME_GIT_PROMPT_CLEAN=""
0 10
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+autoload -U colors && colors
1
+
2
+autoload -Uz vcs_info
3
+
4
+zstyle ':vcs_info:*' stagedstr '%F{green}●'
5
+zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
6
+zstyle ':vcs_info:*' check-for-changes true
7
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
8
+zstyle ':vcs_info:*' enable git svn
9
+precmd () {
10
+    if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
11
+        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
12
+    } else {
13
+        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
14
+    }
15
+
16
+    vcs_info
17
+}
18
+
19
+setopt prompt_subst
20
+PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
0 21
new file mode 100644
... ...
@@ -0,0 +1,50 @@
0
+# ------------------------------------------------------------------------------
1
+#          FILE:  kphoen.zsh-theme
2
+#   DESCRIPTION:  oh-my-zsh theme file.
3
+#        AUTHOR:  Kévin Gomez (geek63@gmail.com)
4
+#       VERSION:  1.0.0
5
+#    SCREENSHOT:
6
+# ------------------------------------------------------------------------------
7
+
8
+
9
+if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
10
+    PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)]
11
+%# '
12
+
13
+    ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
14
+    ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
15
+    ZSH_THEME_GIT_PROMPT_DIRTY=""
16
+    ZSH_THEME_GIT_PROMPT_CLEAN=""
17
+
18
+    # display exitcode on the right when >0
19
+    return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
20
+
21
+    RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}'
22
+
23
+    ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
24
+    ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
25
+    ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
26
+    ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
27
+    ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
28
+    ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
29
+else
30
+    PROMPT='[%n@%m:%~$(git_prompt_info)]
31
+%# '
32
+
33
+    ZSH_THEME_GIT_PROMPT_PREFIX=" on"
34
+    ZSH_THEME_GIT_PROMPT_SUFFIX=""
35
+    ZSH_THEME_GIT_PROMPT_DIRTY=""
36
+    ZSH_THEME_GIT_PROMPT_CLEAN=""
37
+
38
+    # display exitcode on the right when >0
39
+    return_code="%(?..%? ↵)"
40
+
41
+    RPROMPT='${return_code}$(git_prompt_status)'
42
+
43
+    ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
44
+    ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
45
+    ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
46
+    ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
47
+    ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
48
+    ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
49
+fi