fb6fddda37b7693c0b6f49345e25f8cac66ba9e4
- Author
- Roman Kamyk <roman.kamyk@gmail.com>
- Committer
- Roman Kamyk <roman.kamyk@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/lib/functions.zsh b/lib/functions.zsh
2index 561586cba657cb274f76b6a7a87743e154f006e4..e3c0de43ed8852c672b877177898f27f52af2a02 100644
3--- a/lib/functions.zsh
4+++ b/lib/functions.zsh
5@@ -5,7 +5,7 @@ function title {
6 print -nR $'\033k'$1$'\033'\\\
7
8 print -nR $'\033]0;'$2$'\a'
9- elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
10+ elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then
11 # Use this one instead for XTerms:
12 print -nR $'\033]0;'$*$'\a'
13 fi
14@@ -37,4 +37,3 @@ function take() {
15 mkdir -p $1
16 cd $1
17 }
18-
19diff --git a/lib/git.zsh b/lib/git.zsh
20index 889dd98dff0f76d07c2ccd7adcbec5bf66c66cff..75fdc1f9c2e90f605d8b99542b3974d848b826a9 100644
21--- a/lib/git.zsh
22+++ b/lib/git.zsh
23@@ -11,3 +11,30 @@ parse_git_dirty () {
24 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
25 fi
26 }
27+
28+# get the status of the working tree
29+git_prompt_status() {
30+ INDEX=$(git status --porcelain 2> /dev/null)
31+ STATUS=""
32+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
33+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
34+ fi
35+ if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
36+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
37+ elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
38+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
39+ fi
40+ if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
41+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
42+ fi
43+ if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
44+ STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
45+ fi
46+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
47+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
48+ fi
49+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
50+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
51+ fi
52+ echo $STATUS
53+}
54diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
55index 655eaf728de883e37884ad328b45bc8104d7c53d..d317d179d8ec7bce0ecf600ec237d5c754f47215 100644
56--- a/plugins/git/git.plugin.zsh
57+++ b/plugins/git/git.plugin.zsh
58@@ -12,7 +12,7 @@ alias gb='git branch'
59 alias gba='git branch -a'
60 alias gcount='git shortlog -sn'
61 alias gcp='git cherry-pick'
62-
63+alias glg='git log --stat --max-count=5'
64
65 # Git and svn mix
66 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
67diff --git a/plugins/github/_github b/plugins/github/_github
68new file mode 100644
69index 0000000000000000000000000000000000000000..83e1713c774f5a6d898e9c3477cf5b11ee305084
70--- /dev/null
71+++ b/plugins/github/_github
72@@ -0,0 +1,40 @@
73+#compdef github
74+#autoload
75+
76+# in order to make this work, you will need to have the github gem installed
77+# http://github.com/defunkt/github-gem
78+
79+# github zsh completion, based on homebrew completion
80+
81+local -a _1st_arguments
82+_1st_arguments=(
83+ 'browse:Open this repo in a web browser'
84+ 'clone:Clone a repo'
85+ 'config:Automatically set configuration info, or pass args to specify'
86+ 'create-from-local:Create a new GitHub repository from the current local repository'
87+ 'create:Create a new empty GitHub repository'
88+ 'fetch:Fetch from a remote to a local branch'
89+ 'fetch_all:Fetch all refs from a user'
90+ 'fork:Forks a GitHub repository'
91+ 'home:Open this repos master branch in a web browser'
92+ 'ignore:Ignore a SHA from github network commits'
93+ 'info:Info about this project'
94+ 'issues:Project issues tools'
95+ 'network:Project network tools - sub-commands : web [user], list, fetch, commits'
96+ 'open:Open the given user/project in a web browser'
97+ 'pull-request:Generate the text for a pull request'
98+ 'pull:Pull from a remote'
99+ 'search:Search GitHub for the given repository name'
100+ 'track:Track another users repository'
101+)
102+
103+local expl
104+local -a pkgs installed_pkgs
105+
106+_arguments \
107+ '*:: :->subcmds' && return 0
108+
109+if (( CURRENT == 1 )); then
110+ _describe -t commands "github subcommand" _1st_arguments
111+ return
112+fi
113diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
114new file mode 100644
115index 0000000000000000000000000000000000000000..c23504b85b464b411c14abcbe9301e9348ebf5f6
116--- /dev/null
117+++ b/plugins/github/github.plugin.zsh
118@@ -0,0 +1,4 @@
119+# add github completion function to path
120+fpath=($ZSH/plugins/github $fpath)
121+autoload -U compinit
122+compinit -i
123diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme
124new file mode 100644
125index 0000000000000000000000000000000000000000..ad5e2834b832938faa4b0a8f12cb060e849cff64
126--- /dev/null
127+++ b/themes/cloud.zsh-theme
128@@ -0,0 +1,6 @@
129+PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
130+
131+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
132+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
133+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
134+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
135diff --git a/themes/gozilla.zsh-theme b/themes/gozilla.zsh-theme
136new file mode 100644
137index 0000000000000000000000000000000000000000..c6b752e9b400f9ce2ff8942c937822e62306f164
138--- /dev/null
139+++ b/themes/gozilla.zsh-theme
140@@ -0,0 +1,15 @@
141+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
142+
143+ZSH_THEME_GIT_PROMPT_PREFIX="("
144+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
145+ZSH_THEME_GIT_PROMPT_DIRTY=""
146+ZSH_THEME_GIT_PROMPT_CLEAN=""
147+
148+RPROMPT='$(git_prompt_status)%{$reset_color%}'
149+
150+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
151+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
152+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
153+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
154+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
155+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
156diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme
157new file mode 100644
158index 0000000000000000000000000000000000000000..fa7c590355a2a1fcd8b7c4d87ad19e9f234be2eb
159--- /dev/null
160+++ b/themes/philips.zsh-theme
161@@ -0,0 +1,14 @@
162+if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
163+
164+PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
165+RPROMPT='[%*]'
166+
167+# git theming
168+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
169+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
170+ZSH_THEME_GIT_PROMPT_CLEAN=""
171+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}"
172+
173+# LS colors, made with http://geoff.greer.fm/lscolors/
174+export LSCOLORS="Gxfxcxdxbxegedabagacad"