... | ... |
@@ -22,7 +22,7 @@ else |
22 | 22 |
fi |
23 | 23 |
|
24 | 24 |
zstyle ':completion:*' list-colors '' |
25 |
-zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) |
|
25 |
+ |
|
26 | 26 |
|
27 | 27 |
unsetopt MENU_COMPLETE |
28 | 28 |
#setopt AUTO_MENU |
... | ... |
@@ -35,7 +35,12 @@ zstyle ':completion:*:*:*:*:*' menu yes select |
35 | 35 |
|
36 | 36 |
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' |
37 | 37 |
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" |
38 |
-zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` |
|
38 |
+ |
|
39 |
+# Load known hosts file for auto-completion with ssh and scp commands |
|
40 |
+if [ -f ~/.ssh/known_hosts ]; then |
|
41 |
+ zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) |
|
42 |
+ zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` |
|
43 |
+fi |
|
39 | 44 |
|
40 | 45 |
# Complete on history |
41 | 46 |
# zstyle ':completion:*:history-words' stop yes |
... | ... |
@@ -5,7 +5,7 @@ function git_prompt_info() { |
5 | 5 |
} |
6 | 6 |
|
7 | 7 |
parse_git_dirty () { |
8 |
- if [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]]; then |
|
8 |
+ if [[ $((git status &> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then |
|
9 | 9 |
echo "$ZSH_THEME_GIT_PROMPT_DIRTY" |
10 | 10 |
else |
11 | 11 |
echo "$ZSH_THEME_GIT_PROMPT_CLEAN" |
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
_rake_does_task_list_need_generating () { |
2 | 2 |
if [ ! -f .rake_tasks~ ]; then return 0; |
3 | 3 |
else |
4 |
- accurate=$(stat -c "%n" .rake_tasks~) |
|
5 |
- changed=$(stat -c "%n" Rakefile) |
|
4 |
+ accurate=$(stat -f%m .rake_tasks~) |
|
5 |
+ changed=$(stat -f%m Rakefile) |
|
6 | 6 |
return $(expr $accurate '>=' $changed) |
7 | 7 |
fi |
8 | 8 |
} |
... | ... |
@@ -1,9 +1,9 @@ |
1 | 1 |
# meh. Dark Blood Rewind, a new beginning. |
2 | 2 |
|
3 |
-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]}]) |
|
4 |
-${fg[red]}└[${fg_bold[white]}%~${reset_color}${fg[red]}]>${reset_color} ' |
|
5 |
-PS2=$' ${fg[red]}|>${reset_color} ' |
|
3 |
+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]%}]) |
|
4 |
+%{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} ' |
|
5 |
+PS2=$' %{$fg[red]%}|>%{$reset_color%} ' |
|
6 | 6 |
|
7 |
-ZSH_THEME_GIT_PROMPT_PREFIX="${fg[red]}[${fg_bold[white]}" |
|
8 |
-ZSH_THEME_GIT_PROMPT_SUFFIX="${reset_color}${fg[red]}] " |
|
9 |
-ZSH_THEME_GIT_PROMPT_DIRTY=" ${fg[red]}⚡${reset_color}" |
|
7 |
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}[%{$fg_bold[white]%}" |
|
8 |
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[red]%}] " |
|
9 |
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡%{$reset_color%}" |
10 | 10 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,31 @@ |
0 |
+autoload -U add-zsh-hook |
|
1 |
+autoload -Uz vcs_info |
|
2 |
+ |
|
3 |
+zstyle ':vcs_info:*' actionformats \ |
|
4 |
+ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' |
|
5 |
+zstyle ':vcs_info:*' formats \ |
|
6 |
+ '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' |
|
7 |
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' |
|
8 |
+zstyle ':vcs_info:*' enable git |
|
9 |
+ |
|
10 |
+add-zsh-hook precmd prompt_jnrowe_precmd |
|
11 |
+ |
|
12 |
+prompt_jnrowe_precmd () { |
|
13 |
+ vcs_info |
|
14 |
+ |
|
15 |
+ if [ "${vcs_info_msg_0_}" = "" ]; then |
|
16 |
+ dir_status="%F{2}→%f" |
|
17 |
+ elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then |
|
18 |
+ dir_status="%F{1}▶%f" |
|
19 |
+ elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then |
|
20 |
+ dir_status="%F{3}▶%f" |
|
21 |
+ else |
|
22 |
+ dir_status="%F{2}▶%f" |
|
23 |
+ fi |
|
24 |
+} |
|
25 |
+ |
|
26 |
+local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" |
|
27 |
+ |
|
28 |
+PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' |
|
29 |
+ |
|
30 |
+# vim: set ft=zsh ts=4 sw=4 et: |