summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/aliases.zsh1
-rw-r--r--lib/completion.zsh9
-rw-r--r--lib/git.zsh2
-rw-r--r--lib/rake_completion.zsh4
4 files changed, 10 insertions, 6 deletions
diff --git a/lib/aliases.zsh b/lib/aliases.zsh
index 88d68e142..d3ee2dd8c 100644
--- a/lib/aliases.zsh
+++ b/lib/aliases.zsh
@@ -37,7 +37,6 @@ alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch'
alias gba='git branch -a'
-alias gdb='git branch -d'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
diff --git a/lib/completion.zsh b/lib/completion.zsh
index deeb52824..c231ee21e 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -22,7 +22,7 @@ else
fi
zstyle ':completion:*' list-colors ''
-zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
+
unsetopt MENU_COMPLETE
#setopt AUTO_MENU
@@ -35,7 +35,12 @@ zstyle ':completion:*:*:*:*:*' menu yes select
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
-zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
+
+# Load known hosts file for auto-completion with ssh and scp commands
+if [ -f ~/.ssh/known_hosts ]; then
+ zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
+ zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
+fi
# Complete on history
# zstyle ':completion:*:history-words' stop yes
diff --git a/lib/git.zsh b/lib/git.zsh
index 84a3af0b9..6ef950f12 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -5,7 +5,7 @@ function git_prompt_info() {
}
parse_git_dirty () {
- if [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]]; then
+ if [[ $((git status &> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh
index 9ee8213ae..c425a625e 100644
--- a/lib/rake_completion.zsh
+++ b/lib/rake_completion.zsh
@@ -1,8 +1,8 @@
_rake_does_task_list_need_generating () {
if [ ! -f .rake_tasks~ ]; then return 0;
else
- accurate=$(stat -c "%n" .rake_tasks~)
- changed=$(stat -c "%n" Rakefile)
+ accurate=$(stat -f%m .rake_tasks~)
+ changed=$(stat -f%m Rakefile)
return $(expr $accurate '>=' $changed)
fi
}