729fd0ab3cae9636ea8d40b76b80a0763c9150da
- Author
- Toon Claes <toon@tonotdo.com>
- Committer
- Toon Claes <toon@tonotdo.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/lib/aliases.zsh b/lib/aliases.zsh
2index 88d68e1426b356e7ed52b304125f2773181368b7..d3ee2dd8c38ef3cf0ae01817c7306daa3a1456c1 100644
3--- a/lib/aliases.zsh
4+++ b/lib/aliases.zsh
5@@ -37,7 +37,6 @@ alias gc='git commit -v'
6 alias gca='git commit -v -a'
7 alias gb='git branch'
8 alias gba='git branch -a'
9-alias gdb='git branch -d'
10 alias gcount='git shortlog -sn'
11 alias gcp='git cherry-pick'
12
13diff --git a/lib/completion.zsh b/lib/completion.zsh
14index deeb52824e8df33653704b67cc28bf431a9e225a..c231ee21e2ff1d051177526d1403900670efcb5b 100644
15--- a/lib/completion.zsh
16+++ b/lib/completion.zsh
17@@ -22,7 +22,7 @@ else
18 fi
19
20 zstyle ':completion:*' list-colors ''
21-zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
22+
23
24 unsetopt MENU_COMPLETE
25 #setopt AUTO_MENU
26@@ -35,7 +35,12 @@ zstyle ':completion:*:*:*:*:*' menu yes select
27
28 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
29 zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
30-zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
31+
32+# Load known hosts file for auto-completion with ssh and scp commands
33+if [ -f ~/.ssh/known_hosts ]; then
34+ zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
35+ zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
36+fi
37
38 # Complete on history
39 # zstyle ':completion:*:history-words' stop yes
40diff --git a/lib/git.zsh b/lib/git.zsh
41index 84a3af0b97e46faf49516fec58f43bd8f8401301..6ef950f121d9c6ef51d0e6e3fafa1c6e0a62b50a 100644
42--- a/lib/git.zsh
43+++ b/lib/git.zsh
44@@ -5,7 +5,7 @@ function git_prompt_info() {
45 }
46
47 parse_git_dirty () {
48- if [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]]; then
49+ if [[ $((git status &> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
50 echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
51 else
52 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
53diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh
54index 9ee8213ae08fd78b8c8499a49afa1f49601e129d..c425a625e1d219740e2b63bacf42e0e10fc1b46a 100644
55--- a/lib/rake_completion.zsh
56+++ b/lib/rake_completion.zsh
57@@ -1,8 +1,8 @@
58 _rake_does_task_list_need_generating () {
59 if [ ! -f .rake_tasks~ ]; then return 0;
60 else
61- accurate=$(stat -c "%n" .rake_tasks~)
62- changed=$(stat -c "%n" Rakefile)
63+ accurate=$(stat -f%m .rake_tasks~)
64+ changed=$(stat -f%m Rakefile)
65 return $(expr $accurate '>=' $changed)
66 fi
67 }
68diff --git a/themes/darkblood.zsh-theme b/themes/darkblood.zsh-theme
69index 8a00c345910e368f16deb76b78e04bd55bfa2980..33508fbd2ce7d647647acc53a4ec3c1cb677f94d 100644
70--- a/themes/darkblood.zsh-theme
71+++ b/themes/darkblood.zsh-theme
72@@ -1,9 +1,9 @@
73 # meh. Dark Blood Rewind, a new beginning.
74
75-PROMPT=$'${fg[red]}┌[${fg_bold[white]}%n${reset_color}${fg[red]}@${fg_bold[white]}%m${reset_color}${fg[red]}] [${fg_bold[white]}/dev/%y${reset_color}${fg[red]}] $(git_prompt_info)%(?,,${fg[red]}[${fg_bold[white]}%?${reset_color}${fg[red]}])
76-${fg[red]}└[${fg_bold[white]}%~${reset_color}${fg[red]}]>${reset_color} '
77-PS2=$' ${fg[red]}|>${reset_color} '
78diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
79new file mode 100644
80index 0000000000000000000000000000000000000000..7c8a7082e96696931d797f1e847d7eeef2f4c581
81--- /dev/null
82+++ b/themes/jnrowe.zsh-theme
83@@ -0,0 +1,31 @@
84+autoload -U add-zsh-hook
85+autoload -Uz vcs_info
86+
87+zstyle ':vcs_info:*' actionformats \
88+ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
89+zstyle ':vcs_info:*' formats \
90+ '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
91+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
92+zstyle ':vcs_info:*' enable git
93+
94+add-zsh-hook precmd prompt_jnrowe_precmd
95+
96+prompt_jnrowe_precmd () {
97+ vcs_info
98+
99+ if [ "${vcs_info_msg_0_}" = "" ]; then
100+ dir_status="%F{2}→%f"
101+ elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
102+ dir_status="%F{1}▶%f"
103+ elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
104+ dir_status="%F{3}▶%f"
105+ else
106+ dir_status="%F{2}▶%f"
107+ fi
108+}
109+
110+local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
111+
112+PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
113+
114+# vim: set ft=zsh ts=4 sw=4 et: