summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDallas Reedy <code@dallasreedy.com>2010-05-07 10:21:27 -0700
committerDallas Reedy <code@dallasreedy.com>2010-05-07 10:21:27 -0700
commit74429549856521ea71fb4a3c9e6be0741f7c86f8 (patch)
tree85b9905066cb652ee607e84a926dfbb859b2f843
parentf9abe041e2b70217b0d2f5519a51a57854b49857 (diff)
parent7d036913c4476916fe8b0325ea9cd54266787021 (diff)
downloadzsh-74429549856521ea71fb4a3c9e6be0741f7c86f8.tar.gz
zsh-74429549856521ea71fb4a3c9e6be0741f7c86f8.tar.bz2
zsh-74429549856521ea71fb4a3c9e6be0741f7c86f8.zip
Merge remote branch 'robbyrussell/master'
-rw-r--r--lib/completion.zsh12
-rw-r--r--lib/git.zsh2
-rw-r--r--lib/rake_completion.zsh21
-rw-r--r--lib/spectrum.zsh20
-rw-r--r--oh-my-zsh.sh2
-rw-r--r--themes/sporty_256.zsh-theme13
6 files changed, 40 insertions, 30 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh
index 46b6d8f65..619dc0243 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -1,11 +1,11 @@
## fixme - the load process here seems a bit bizarre
-setopt noautomenu
+unsetopt menu_complete # do not autoselect the first completion entry
+unsetopt flowcontrol
+setopt auto_menu # show completion menu on succesive tab press
setopt complete_in_word
setopt always_to_end
-unsetopt flowcontrol
-
WORDCHARS=''
autoload -U compinit
@@ -23,14 +23,10 @@ fi
zstyle ':completion:*' list-colors ''
-
-unsetopt MENU_COMPLETE
-#setopt AUTO_MENU
-
# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history
-zstyle ':completion:*:*:*:*:*' menu yes select
+zstyle ':completion:*:*:*:*:*' menu select
# zstyle ':completion:*:*:*:*:processes' force-list always
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
diff --git a/lib/git.zsh b/lib/git.zsh
index 629a08b0e..1d1d24deb 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -5,7 +5,7 @@ function git_prompt_info() {
}
parse_git_dirty () {
- if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
+ if [[ -n $(git status -s 2> /dev/null) ]]; 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 c425a625e..8336182d5 100644
--- a/lib/rake_completion.zsh
+++ b/lib/rake_completion.zsh
@@ -1,24 +1,3 @@
-_rake_does_task_list_need_generating () {
- if [ ! -f .rake_tasks~ ]; then return 0;
- else
- accurate=$(stat -f%m .rake_tasks~)
- changed=$(stat -f%m Rakefile)
- return $(expr $accurate '>=' $changed)
- fi
-}
-
-_rake () {
- if [ -f Rakefile ]; then
- if _rake_does_task_list_need_generating; then
- echo "\nGenerating .rake_tasks~..." > /dev/stderr
- rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~
- fi
- compadd `cat .rake_tasks~`
- fi
-}
-
-compctl -K _rake rake
-
function _cap_does_task_list_need_generating () {
if [ ! -f .cap_tasks~ ]; then return 0;
else
diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
new file mode 100644
index 000000000..4006a7fe1
--- /dev/null
+++ b/lib/spectrum.zsh
@@ -0,0 +1,20 @@
+#! /bin/zsh
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+ reset "%{%}"
+ bold "%{%}" no-bold "%{%}"
+ italic "%{%}" no-italic "%{%}"
+ underline "%{%}" no-underline "%{%}"
+ blink "%{%}" no-blink "%{%}"
+ reverse "%{%}" no-reverse "%{%}"
+)
+
+for color in {000..255}; do
+ FG[$color]="%{[38;5;${color}m%}"
+ BG[$color]="%{[48;5;${color}m%}"
+done
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index fa2738e18..a41f3d89e 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -17,3 +17,5 @@ then
else
/usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
fi
+
+unset config_file \ No newline at end of file
diff --git a/themes/sporty_256.zsh-theme b/themes/sporty_256.zsh-theme
new file mode 100644
index 000000000..db0fc4277
--- /dev/null
+++ b/themes/sporty_256.zsh-theme
@@ -0,0 +1,13 @@
+# zsh theme requires 256 color enabled terminal
+# i.e TERM=xterm-256color
+# Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/
+# based on robbyrussell's shell but louder!
+
+PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f
+%{$fg_bold[white]%}%# %{$reset_color%}'
+RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}|"