... | ... |
@@ -5,7 +5,7 @@ function title { |
5 | 5 |
print -nR $'\033k'$1$'\033'\\\ |
6 | 6 |
|
7 | 7 |
print -nR $'\033]0;'$2$'\a' |
8 |
- elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then |
|
8 |
+ elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then |
|
9 | 9 |
# Use this one instead for XTerms: |
10 | 10 |
print -nR $'\033]0;'$*$'\a' |
11 | 11 |
fi |
... | ... |
@@ -37,4 +37,3 @@ function take() { |
37 | 37 |
mkdir -p $1 |
38 | 38 |
cd $1 |
39 | 39 |
} |
40 |
- |
... | ... |
@@ -11,3 +11,30 @@ parse_git_dirty () { |
11 | 11 |
echo "$ZSH_THEME_GIT_PROMPT_CLEAN" |
12 | 12 |
fi |
13 | 13 |
} |
14 |
+ |
|
15 |
+# get the status of the working tree |
|
16 |
+git_prompt_status() { |
|
17 |
+ INDEX=$(git status --porcelain 2> /dev/null) |
|
18 |
+ STATUS="" |
|
19 |
+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then |
|
20 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" |
|
21 |
+ fi |
|
22 |
+ if $(echo "$INDEX" | grep '^A ' &> /dev/null); then |
|
23 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" |
|
24 |
+ elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then |
|
25 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" |
|
26 |
+ fi |
|
27 |
+ if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then |
|
28 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" |
|
29 |
+ fi |
|
30 |
+ if $(echo "$INDEX" | grep '^R ' &> /dev/null); then |
|
31 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" |
|
32 |
+ fi |
|
33 |
+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then |
|
34 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" |
|
35 |
+ fi |
|
36 |
+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then |
|
37 |
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" |
|
38 |
+ fi |
|
39 |
+ echo $STATUS |
|
40 |
+} |
... | ... |
@@ -12,7 +12,7 @@ alias gb='git branch' |
12 | 12 |
alias gba='git branch -a' |
13 | 13 |
alias gcount='git shortlog -sn' |
14 | 14 |
alias gcp='git cherry-pick' |
15 |
- |
|
15 |
+alias glg='git log --stat --max-count=5' |
|
16 | 16 |
|
17 | 17 |
# Git and svn mix |
18 | 18 |
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' |
19 | 19 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,40 @@ |
0 |
+#compdef github |
|
1 |
+#autoload |
|
2 |
+ |
|
3 |
+# in order to make this work, you will need to have the github gem installed |
|
4 |
+# http://github.com/defunkt/github-gem |
|
5 |
+ |
|
6 |
+# github zsh completion, based on homebrew completion |
|
7 |
+ |
|
8 |
+local -a _1st_arguments |
|
9 |
+_1st_arguments=( |
|
10 |
+ 'browse:Open this repo in a web browser' |
|
11 |
+ 'clone:Clone a repo' |
|
12 |
+ 'config:Automatically set configuration info, or pass args to specify' |
|
13 |
+ 'create-from-local:Create a new GitHub repository from the current local repository' |
|
14 |
+ 'create:Create a new empty GitHub repository' |
|
15 |
+ 'fetch:Fetch from a remote to a local branch' |
|
16 |
+ 'fetch_all:Fetch all refs from a user' |
|
17 |
+ 'fork:Forks a GitHub repository' |
|
18 |
+ 'home:Open this repos master branch in a web browser' |
|
19 |
+ 'ignore:Ignore a SHA from github network commits' |
|
20 |
+ 'info:Info about this project' |
|
21 |
+ 'issues:Project issues tools' |
|
22 |
+ 'network:Project network tools - sub-commands : web [user], list, fetch, commits' |
|
23 |
+ 'open:Open the given user/project in a web browser' |
|
24 |
+ 'pull-request:Generate the text for a pull request' |
|
25 |
+ 'pull:Pull from a remote' |
|
26 |
+ 'search:Search GitHub for the given repository name' |
|
27 |
+ 'track:Track another users repository' |
|
28 |
+) |
|
29 |
+ |
|
30 |
+local expl |
|
31 |
+local -a pkgs installed_pkgs |
|
32 |
+ |
|
33 |
+_arguments \ |
|
34 |
+ '*:: :->subcmds' && return 0 |
|
35 |
+ |
|
36 |
+if (( CURRENT == 1 )); then |
|
37 |
+ _describe -t commands "github subcommand" _1st_arguments |
|
38 |
+ return |
|
39 |
+fi |
0 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,6 @@ |
0 |
+PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
|
1 |
+ |
|
2 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" |
|
3 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
|
4 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}" |
|
5 |
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" |
|
0 | 6 |
\ No newline at end of file |
1 | 7 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
0 |
+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
|
1 |
+ |
|
2 |
+ZSH_THEME_GIT_PROMPT_PREFIX="(" |
|
3 |
+ZSH_THEME_GIT_PROMPT_SUFFIX=")" |
|
4 |
+ZSH_THEME_GIT_PROMPT_DIRTY="" |
|
5 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
6 |
+ |
|
7 |
+RPROMPT='$(git_prompt_status)%{$reset_color%}' |
|
8 |
+ |
|
9 |
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" |
|
10 |
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" |
|
11 |
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" |
|
12 |
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" |
|
13 |
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" |
|
14 |
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" |
0 | 15 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,14 @@ |
0 |
+if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi |
|
1 |
+ |
|
2 |
+PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' |
|
3 |
+RPROMPT='[%*]' |
|
4 |
+ |
|
5 |
+# git theming |
|
6 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B" |
|
7 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " |
|
8 |
+ZSH_THEME_GIT_PROMPT_CLEAN="" |
|
9 |
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}" |
|
10 |
+ |
|
11 |
+# LS colors, made with http://geoff.greer.fm/lscolors/ |
|
12 |
+export LSCOLORS="Gxfxcxdxbxegedabagacad" |
|
13 |
+export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' |