From 926d116259ee46b718d2a2fa068dcc6d1bbd426f Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 18 Jan 2010 11:46:41 -0500 Subject: [PATCH 01/60] Add a new "prose" theme. --- themes/prose.zsh-theme | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 themes/prose.zsh-theme diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme new file mode 100644 index 000000000..d83361e61 --- /dev/null +++ b/themes/prose.zsh-theme @@ -0,0 +1,32 @@ +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + hg root >/dev/null 2>/dev/null && echo '☿' && return + echo '○' +} + +function battery_charge { + echo `$BAT_CHARGE` 2>/dev/null +} + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function hg_prompt_info { + hg prompt --angle-brackets "\ +< on %{$fg[magenta]%}%{$reset_color%}>\ +< at %{$fg[yellow]%}%{$reset_color%}>\ +%{$fg[green]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +PROMPT=' +%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) +$(virtualenv_info)$(prompt_char) ' + +RPROMPT='$(battery_charge)' + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 0f711cab40a8d838e7bffd3a114bd1c689e7b952 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 18 Jan 2010 11:47:06 -0500 Subject: [PATCH 02/60] Switch around the .gitignore a bit to account for symlinking. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f84db6dc2..18a09e24d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ locals.zsh log/.zsh_history projects.zsh +custom custom/*.zsh -!custom/example.zsh \ No newline at end of file +!custom/example.zsh From d136031d3552c4c136a210809c2df6981cc80d39 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 20 Jan 2010 00:40:13 -0500 Subject: [PATCH 03/60] Fix the collapsed-pwd. --- themes/prose.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index d83361e61..319e620f5 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -1,3 +1,7 @@ +function collapse_pwd { + echo $(pwd | sed -e "s,^$HOME,~,") +} + function prompt_char { git branch >/dev/null 2>/dev/null && echo '±' && return hg root >/dev/null 2>/dev/null && echo '☿' && return @@ -21,7 +25,7 @@ patches: Date: Wed, 20 Jan 2010 00:41:41 -0500 Subject: [PATCH 04/60] Add annoying OS X files to the ignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 18a09e24d..e173dab09 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ projects.zsh custom custom/*.zsh !custom/example.zsh + +.DS_Store From 3d22ee248c6bce357c018a93d31f8d292d2cb4cd Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 20 Jan 2010 12:12:48 -0500 Subject: [PATCH 05/60] Improve the git prompt. --- lib/git.zsh | 16 ++++++++++++---- themes/prose.zsh-theme | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 629a08b0e..a34140d89 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -5,10 +5,18 @@ function git_prompt_info() { } parse_git_dirty () { - if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then - echo "$ZSH_THEME_GIT_PROMPT_DIRTY" - else - echo "$ZSH_THEME_GIT_PROMPT_CLEAN" + gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)') + + if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then + echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY" + fi + + if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\)$") > 0 ]]; then + echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED" + fi + + if [[ $(echo ${gitstat} | wc -l | tr -d ' ') == 0 ]]; then + echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 319e620f5..9071ee07f 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -33,4 +33,5 @@ RPROMPT='$(battery_charge)' ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="" From 6ec9f8c1688c3e99e301632aa818763c28fad896 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 25 Jan 2010 09:06:45 -0500 Subject: [PATCH 06/60] Clear new tabs. --- lib/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index 74b93f00e..aa974e5c2 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -44,7 +44,7 @@ function tab() { end tell application "Terminal" activate - do script with command "cd \"$PWD\"; $*" in window 1 + do script with command "cd \"$PWD\"; clear; $*" in window 1 end tell EOF } From 26866cf4be95b1e1bfc427a8228b8e6e3d5c62b9 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 1 Feb 2010 18:43:54 -0500 Subject: [PATCH 07/60] themes/prose: Replace collapse_pwd with a built-in version. --- themes/prose.zsh-theme | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 9071ee07f..cab930f87 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -1,7 +1,3 @@ -function collapse_pwd { - echo $(pwd | sed -e "s,^$HOME,~,") -} - function prompt_char { git branch >/dev/null 2>/dev/null && echo '±' && return hg root >/dev/null 2>/dev/null && echo '☿' && return @@ -25,7 +21,7 @@ patches: Date: Mon, 1 Feb 2010 23:31:59 -0700 Subject: [PATCH 08/60] Initial merge, adding vi key bindings and RPROMPT clock --- themes/mattcable.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 themes/mattcable.zsh-theme diff --git a/themes/mattcable.zsh-theme b/themes/mattcable.zsh-theme new file mode 100644 index 000000000..29ef6a22b --- /dev/null +++ b/themes/mattcable.zsh-theme @@ -0,0 +1,9 @@ +# based on robbyrussel.zsh-theme + +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +RPROMPT="%{$fg_bold[red]%}(%D{%m-%d %H:%M})%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" From 2e9ab0b8eafa8188754e27624117cda5463eccda Mon Sep 17 00:00:00 2001 From: Matt Cable Date: Mon, 1 Feb 2010 23:44:57 -0700 Subject: [PATCH 09/60] vi keybindings --- lib/key-bindings.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 87e47bab6..f6cf45ce3 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -2,7 +2,7 @@ autoload -U compinit compinit -bindkey -e +bindkey -v bindkey '\ew' kill-region bindkey -s '\el' "ls\n" bindkey -s '\e.' "..\n" From 35e544f76f4e39c6f5d5fb42db61f96e62b92077 Mon Sep 17 00:00:00 2001 From: Matt Cable Date: Mon, 1 Feb 2010 23:46:20 -0700 Subject: [PATCH 10/60] Changed default theme --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index d905be04b..5d4072186 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -3,7 +3,7 @@ export ZSH=$HOME/.oh-my-zsh # Set to the name theme to load. # Look in ~/.oh-my-zsh/themes/ -export ZSH_THEME="robbyrussell" +export ZSH_THEME="mattcable" # Set to this to use case-sensitive completion # export CASE_SENSITIVE="true" From 2b6116039b42da1d4deca9a954819fe1458a4c84 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 2 Feb 2010 09:11:41 -0500 Subject: [PATCH 11/60] Add bare dot aliases for backing out of directories. --- lib/directories.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/directories.zsh b/lib/directories.zsh index 56d7a2316..146a5b069 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -4,6 +4,9 @@ setopt auto_pushd setopt pushd_ignore_dups alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' alias cd..='cd ..' alias cd...='cd ../..' alias cd....='cd ../../..' From 863b28411fa9b96ad4ef7f296ee8c1548af51d21 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 2 Feb 2010 09:21:54 -0500 Subject: [PATCH 12/60] Load zmv to help with complex renames. --- lib/misc.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index 4c1743657..bf68182e1 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -3,6 +3,7 @@ autoload -U url-quote-magic zle -N self-insert url-quote-magic ## file rename magick +autoload -U zmv bindkey "^[m" copy-prev-shell-word ## jobs From 7bde96c7b207a9989fac19882c4553f7b0d07670 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 2 Feb 2010 09:26:02 -0500 Subject: [PATCH 13/60] Add a file for Python-related things. --- lib/python.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/python.zsh diff --git a/lib/python.zsh b/lib/python.zsh new file mode 100644 index 000000000..79c8e151e --- /dev/null +++ b/lib/python.zsh @@ -0,0 +1,3 @@ +function wo() { + [ -f './.venv' ] && workon `cat ./.venv` +} From db2302a59cc6e37f1b94871c94df6a4908141f19 Mon Sep 17 00:00:00 2001 From: Matt Cable Date: Tue, 2 Feb 2010 10:39:11 -0700 Subject: [PATCH 14/60] git_prompt_info didn't account for empty gitstat case. Problem was only noticable with non-empty $ZSH_THEME_GIT_PROMPT_CLEAN --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index a34140d89..31fa77c10 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -15,7 +15,7 @@ parse_git_dirty () { echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED" fi - if [[ $(echo ${gitstat} | wc -l | tr -d ' ') == 0 ]]; then + if [[ $(echo ${gitstat} | grep -v '^$' | wc -l | tr -d ' ') == 0 ]]; then echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } From e5fa536313178aa37713b575c00b5fe4139102a8 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 2 Feb 2010 19:22:28 -0500 Subject: [PATCH 15/60] Undo the VI keybinding change and switch my prompt to be the default. --- lib/key-bindings.zsh | 2 +- templates/zshrc.zsh-template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index f6cf45ce3..87e47bab6 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -2,7 +2,7 @@ autoload -U compinit compinit -bindkey -v +bindkey -e bindkey '\ew' kill-region bindkey -s '\el' "ls\n" bindkey -s '\e.' "..\n" diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 5d4072186..ef1e645d5 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -3,7 +3,7 @@ export ZSH=$HOME/.oh-my-zsh # Set to the name theme to load. # Look in ~/.oh-my-zsh/themes/ -export ZSH_THEME="mattcable" +export ZSH_THEME="prose" # Set to this to use case-sensitive completion # export CASE_SENSITIVE="true" From db18f4361beac88fd8f31fe9ac67113fdef146e3 Mon Sep 17 00:00:00 2001 From: Ole Reifschneider Date: Tue, 19 Jan 2010 15:51:54 +0100 Subject: [PATCH 16/60] lib/completion: Don't select the first item of completion list. Based on a commit by: Ole Reifschneider --- lib/completion.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 46b6d8f65..0e2e38849 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,6 +1,5 @@ ## fixme - the load process here seems a bit bizarre -setopt noautomenu setopt complete_in_word setopt always_to_end @@ -30,7 +29,7 @@ unsetopt MENU_COMPLETE # 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' From 66e9fa165ddbe079f5e9a5a81ed09d1be8ccbc1d Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 16 Feb 2010 17:31:21 -0500 Subject: [PATCH 17/60] Trash all the ruby/git cruft and tweak completion a bit. --- lib/aliases.zsh | 35 ---------------------------------- lib/appearance.zsh | 1 - lib/completion.zsh | 18 ++++++------------ lib/directories.zsh | 10 +++++++++- lib/functions.zsh | 21 --------------------- lib/git.zsh | 15 --------------- lib/key-bindings.zsh | 20 -------------------- lib/misc.zsh | 2 +- lib/rake_completion.zsh | 42 ----------------------------------------- 9 files changed, 16 insertions(+), 148 deletions(-) delete mode 100644 lib/rake_completion.zsh diff --git a/lib/aliases.zsh b/lib/aliases.zsh index f97daf41a..eac15103f 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -5,49 +5,14 @@ alias pu='pushd' alias po='popd' alias ss='thin --stats "/thin/stats" start' -alias sg='ruby script/generate' -alias sd='ruby script/destroy' -alias sp='ruby script/plugin' -alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias sc='ruby script/console' -alias sd='ruby script/server --debugger' alias devlog='tail -f log/development.log' -# Basic directory operations -alias .='pwd' -alias ...='cd ../..' -alias -- -='cd -' - # Super user alias _='sudo' alias ss='sudo su -' -#alias g='grep -in' - # Show history alias history='fc -l 1' -# List direcory contents -alias lsa='ls -lah' -alias l='ls -la' -alias ll='ls -alr' -alias sl=ls # often screw this up - -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' -alias afind='ack-grep -il' - -# Git and svn mix -alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' - # TextMate alias et='mate . &' -alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' - -# Editor Ruby file in TextMate -alias mr='mate CHANGELOG app config db lib public script spec test' diff --git a/lib/appearance.zsh b/lib/appearance.zsh index ffee52b5e..0fd7f463f 100644 --- a/lib/appearance.zsh +++ b/lib/appearance.zsh @@ -1,7 +1,6 @@ # ls colors autoload colors; colors; export LSCOLORS="Gxfxcxdxbxegedabagacad" -#export LS_COLORS # Enable ls colors if [ "$DISABLE_LS_COLORS" != "true" ] diff --git a/lib/completion.zsh b/lib/completion.zsh index 0e2e38849..dbf8572a6 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,7 +1,8 @@ ## fixme - the load process here seems a bit bizarre +unsetopt noautomenu setopt complete_in_word -setopt always_to_end +unsetopt always_to_end unsetopt flowcontrol @@ -12,7 +13,7 @@ compinit zmodload -i zsh/complist -## case-insensitive (all),partial-word and then substring completion +# case-insensitive (all), partial-word and then substring completion if [ "x$CASE_SENSITIVE" = "xtrue" ]; then zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' unset CASE_SENSITIVE @@ -22,15 +23,14 @@ fi zstyle ':completion:*' list-colors '' - unsetopt MENU_COMPLETE -#setopt AUTO_MENU +setopt AUTO_MENU # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history -zstyle ':completion:*:*:*:*:*' menu select -# zstyle ':completion:*:*:*:*:processes' force-list always +zstyle ':completion:*:*:*:*:*' menu select=1 +zstyle ':completion:*:*:*:*:processes' force-list always 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" @@ -40,9 +40,3 @@ 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 -#zstyle ':completion:*:history-words' remove-all-dups yes -#zstyle ':completion:*:history-words' list false -#zstyle ':completion:*:history-words' menu yes diff --git a/lib/directories.zsh b/lib/directories.zsh index 146a5b069..3fd274fc9 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -3,6 +3,8 @@ setopt auto_name_dirs setopt auto_pushd setopt pushd_ignore_dups +alias -- -='cd -' +alias .='pwd' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' @@ -40,4 +42,10 @@ cd () { alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v' \ No newline at end of file +alias d='dirs -v' + +# List direcory contents +alias lsa='ls -lah' +alias l='ls -la' +alias ll='ls -alr' +alias sl=ls diff --git a/lib/functions.zsh b/lib/functions.zsh index aa974e5c2..d272b6460 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -21,10 +21,6 @@ function preexec { title $cmd[1]:t "$cmd[2,-1]" } -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} - function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head } @@ -58,20 +54,3 @@ function tm() { cd $1 mate $1 } - -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: http://screencast.com/t/ZDgwNDUwNT -open_lighthouse_ticket () { - if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - `open $lighthouse_url/tickets/$1`; - fi -} - -alias lho='open_lighthouse_ticket' diff --git a/lib/git.zsh b/lib/git.zsh index 31fa77c10..7628d9e8a 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -28,18 +28,3 @@ function current_branch() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } - -# Aliases -alias g='git' -alias gst='git status' -alias gl='git pull' -alias gup='git fetch && git rebase' -alias gp='git push' -alias gd='git diff | mate' -alias gdv='git diff -w "$@" | vim -R -' -alias gc='git commit -v' -alias gca='git commit -v -a' -alias gb='git branch' -alias gba='git branch -a' -alias gcount='git shortlog -sn' -alias gcp='git cherry-pick' diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 87e47bab6..134a0bcbd 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -19,23 +19,3 @@ bindkey "^[[1~" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[4~" end-of-line bindkey ' ' magic-space # also do history expansion on space - - -# consider emacs keybindings: - -#bindkey -e ## emacs key bindings -# -#bindkey '^[[A' up-line-or-search -#bindkey '^[[B' down-line-or-search -#bindkey '^[^[[C' emacs-forward-word -#bindkey '^[^[[D' emacs-backward-word -# -#bindkey -s '^X^Z' '%-^M' -#bindkey '^[e' expand-cmd-path -#bindkey '^[^I' reverse-menu-complete -#bindkey '^X^N' accept-and-infer-next-history -#bindkey '^W' kill-region -#bindkey '^I' complete-word -## Fix weird sequence that rxvt produces -#bindkey -s '^[[Z' '\t' -# \ No newline at end of file diff --git a/lib/misc.zsh b/lib/misc.zsh index bf68182e1..d09375044 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -10,5 +10,5 @@ bindkey "^[m" copy-prev-shell-word setopt long_list_jobs ## pager -export PAGER=less +export PAGER='less -R' export LC_CTYPE=en_US.UTF-8 diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh deleted file mode 100644 index c425a625e..000000000 --- a/lib/rake_completion.zsh +++ /dev/null @@ -1,42 +0,0 @@ -_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 - accurate=$(stat -f%m .cap_tasks~) - changed=$(stat -f%m config/deploy.rb) - return $(expr $accurate '>=' $changed) - fi -} - -function _cap () { - if [ -f config/deploy.rb ]; then - if _cap_does_task_list_need_generating; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' -> .cap_tasks~ - fi - compadd `cat .cap_tasks~` - fi -} - -compctl -K _cap cap From ce4dc6fac28028d82099b969bead1966bfbfb0ad Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Sat, 27 Feb 2010 16:55:53 -0500 Subject: [PATCH 18/60] Add the cdv alias to cd to the virtualenvs directory. --- lib/python.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/python.zsh b/lib/python.zsh index 79c8e151e..1eeb65741 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -1,3 +1,5 @@ function wo() { [ -f './.venv' ] && workon `cat ./.venv` } + +alias cdv='cd $WORKON_HOME' From 9d43c16f4e1d0617bcb615275be5483e0cfadadb Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 10 Mar 2010 09:18:52 -0500 Subject: [PATCH 19/60] Add the pman function to view man pages as PDFs. --- lib/misc.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index d09375044..a608f9dda 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -12,3 +12,8 @@ setopt long_list_jobs ## pager export PAGER='less -R' export LC_CTYPE=en_US.UTF-8 + +## pretty man pages +function pman() { + man $1 -t | open -f -a Preview +} \ No newline at end of file From f7e528b4a155aa59475157c18af50ffdfd548d2f Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 18 Mar 2010 15:44:13 -0400 Subject: [PATCH 20/60] Add some useful Django-related aliases. --- lib/django.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/django.zsh diff --git a/lib/django.zsh b/lib/django.zsh new file mode 100644 index 000000000..0d563ab5d --- /dev/null +++ b/lib/django.zsh @@ -0,0 +1,6 @@ +alias pmr='python manage.py runserver' +alias pmrp='python manage.py runserver_plus' +alias pmrpg='pmrp --adminmedia=`pwd`/media/admin' +alias pmsdb='python manage.py syncdb' +alias pms='python manage.py shell' +alias pmlf='python manage.py loaddata fixtures/*' From 9cc2d0964beb4249434e773819a9345da713573b Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 23 Apr 2010 11:20:24 -0400 Subject: [PATCH 21/60] Add the cdp function. --- lib/python.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/python.zsh b/lib/python.zsh index 1eeb65741..f1e507c48 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -3,3 +3,9 @@ function wo() { } alias cdv='cd $WORKON_HOME' + +function cdp () { + cd "$(python -c "import os.path as _, ${1}; \ + print _.dirname(_.realpath(${1}.__file__[:-1]))" + )" +} \ No newline at end of file From ad2d5b0bf5f348c927934de62a8ea313750a9adb Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 23 Apr 2010 21:10:06 -0400 Subject: [PATCH 22/60] Add some simple Redis aliases. --- lib/redis.zsh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 lib/redis.zsh diff --git a/lib/redis.zsh b/lib/redis.zsh new file mode 100644 index 000000000..751a01a84 --- /dev/null +++ b/lib/redis.zsh @@ -0,0 +1,2 @@ +alias res='./redis-server' +alias rec='./redis-cli' From 1df9ea8c2888b90fa42e7762e00227fe8fc14d24 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 30 Apr 2010 10:25:30 -0400 Subject: [PATCH 23/60] Add the pj function to easily prettify JSON. --- lib/misc.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index a608f9dda..b85bdf212 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -16,4 +16,9 @@ export LC_CTYPE=en_US.UTF-8 ## pretty man pages function pman() { man $1 -t | open -f -a Preview +} + +## pretty JSON +function pj() { + python -mjson.tool } \ No newline at end of file From 0be470c37d12e58e0977ecc25ec861eed3b148c0 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 30 Apr 2010 15:11:26 -0400 Subject: [PATCH 24/60] Add some Gunicorn aliases and the oo alias. --- lib/django.zsh | 4 ++++ lib/misc.zsh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/django.zsh b/lib/django.zsh index 0d563ab5d..901c2f6ef 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -4,3 +4,7 @@ alias pmrpg='pmrp --adminmedia=`pwd`/media/admin' alias pmsdb='python manage.py syncdb' alias pms='python manage.py shell' alias pmlf='python manage.py loaddata fixtures/*' + +alias gs='gunicorn_django' +alias gk='kill `cat .gunicorn.pid`' +alias gl='tail -f .gunicorn.log' \ No newline at end of file diff --git a/lib/misc.zsh b/lib/misc.zsh index b85bdf212..aa033dec3 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -21,4 +21,7 @@ function pman() { ## pretty JSON function pj() { python -mjson.tool -} \ No newline at end of file +} + +## Open current directory +alias oo='open .' \ No newline at end of file From 01680434ff31f19eb05b6c29251430f5f8f311a5 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 30 Apr 2010 15:13:51 -0400 Subject: [PATCH 25/60] Add some Supervisord aliases. --- lib/supervisord.zsh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 lib/supervisord.zsh diff --git a/lib/supervisord.zsh b/lib/supervisord.zsh new file mode 100644 index 000000000..b09effb67 --- /dev/null +++ b/lib/supervisord.zsh @@ -0,0 +1,2 @@ +alias ssd='sudo supervisord' +alias ssc='sudo supervisorctl' \ No newline at end of file From 37303d022e1d8a47dec56fda4c7f946fd9437d87 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 30 Apr 2010 15:26:03 -0400 Subject: [PATCH 26/60] Move over a few more aliases from my personal .zshrc. --- lib/directories.zsh | 1 + lib/django.zsh | 3 ++- lib/misc.zsh | 11 ++++++++++- lib/python.zsh | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 3fd274fc9..fbd90f888 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -48,4 +48,5 @@ alias d='dirs -v' alias lsa='ls -lah' alias l='ls -la' alias ll='ls -alr' +alias ls='ls -Goh' alias sl=ls diff --git a/lib/django.zsh b/lib/django.zsh index 901c2f6ef..b1d2c9974 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -1,3 +1,4 @@ +alias pm='python manage.py' alias pmr='python manage.py runserver' alias pmrp='python manage.py runserver_plus' alias pmrpg='pmrp --adminmedia=`pwd`/media/admin' @@ -7,4 +8,4 @@ alias pmlf='python manage.py loaddata fixtures/*' alias gs='gunicorn_django' alias gk='kill `cat .gunicorn.pid`' -alias gl='tail -f .gunicorn.log' \ No newline at end of file +alias gl='tail -f .gunicorn.log' diff --git a/lib/misc.zsh b/lib/misc.zsh index aa033dec3..722412a82 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -24,4 +24,13 @@ function pj() { } ## Open current directory -alias oo='open .' \ No newline at end of file +alias oo='open .' + +## Start a local SMTP server and dump emails sent to it to the console +alias smtpconsole='python -m smtpd -n -c DebuggingServer localhost:1025' + +## Serve the current folder on port 80 +alias serve_this='python -m SimpleHTTPServer' + +## Highlight-aware less command +alias hl='less -R' \ No newline at end of file diff --git a/lib/python.zsh b/lib/python.zsh index f1e507c48..7c17a097e 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -1,7 +1,7 @@ function wo() { [ -f './.venv' ] && workon `cat ./.venv` } - +alias deact='deactivate' alias cdv='cd $WORKON_HOME' function cdp () { From 4ea95c3c166df3d7201fa44f3a67f12ca711c8ca Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 4 May 2010 14:36:48 -0400 Subject: [PATCH 27/60] Start a custom version of startapp. --- lib/django.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/django.zsh b/lib/django.zsh index b1d2c9974..2e0eeeaaa 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -9,3 +9,11 @@ alias pmlf='python manage.py loaddata fixtures/*' alias gs='gunicorn_django' alias gk='kill `cat .gunicorn.pid`' alias gl='tail -f .gunicorn.log' + +function djapp() { + mkdir -p $1/templates/$1 + touch $1/__init__.py + echo "from django.db import models\n\n" > $1/models.py + echo "from django.contrib import admin\nfrom $1.models import *\n\n" > $1/admin.py + echo "from django.conf.urls.defaults import *\n\n" > $1/urls.py +} \ No newline at end of file From 968aaf26271d6a88841c4204389eccd8eac8010e Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 5 May 2010 13:01:28 -0400 Subject: [PATCH 28/60] Start using tree. --- lib/directories.zsh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index fbd90f888..4c7fd2394 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -45,8 +45,13 @@ alias rd=rmdir alias d='dirs -v' # List direcory contents -alias lsa='ls -lah' -alias l='ls -la' -alias ll='ls -alr' -alias ls='ls -Goh' -alias sl=ls +alias l1='tree --dirsfirst -ChFL 1' +alias l2='tree --dirsfirst -ChFL 2' +alias l3='tree --dirsfirst -ChFL 3' + +alias ll1='tree --dirsfirst -ChFupDaL 1' +alias ll2='tree --dirsfirst -ChFupDaL 2' +alias ll3='tree --dirsfirst -ChFupDaL 3' + +alias l='l1' +alias ll='ll1' \ No newline at end of file From 2d82f60bfc1138f5cd3e59b6c91f60c51d274855 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 8 Jul 2010 10:27:45 -0400 Subject: [PATCH 29/60] lib/django: add a pmsp alias --- lib/directories.zsh | 2 +- lib/django.zsh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 4c7fd2394..9065011f9 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -54,4 +54,4 @@ alias ll2='tree --dirsfirst -ChFupDaL 2' alias ll3='tree --dirsfirst -ChFupDaL 3' alias l='l1' -alias ll='ll1' \ No newline at end of file +alias ll='ll1' diff --git a/lib/django.zsh b/lib/django.zsh index 2e0eeeaaa..14b11f5ce 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -4,6 +4,7 @@ alias pmrp='python manage.py runserver_plus' alias pmrpg='pmrp --adminmedia=`pwd`/media/admin' alias pmsdb='python manage.py syncdb' alias pms='python manage.py shell' +alias pmsp='python manage.py shell_plus' alias pmlf='python manage.py loaddata fixtures/*' alias gs='gunicorn_django' @@ -16,4 +17,4 @@ function djapp() { echo "from django.db import models\n\n" > $1/models.py echo "from django.contrib import admin\nfrom $1.models import *\n\n" > $1/admin.py echo "from django.conf.urls.defaults import *\n\n" > $1/urls.py -} \ No newline at end of file +} From e13b2dc811484018eb9e3e876328d235eba20194 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 14 Jul 2010 10:04:44 -0400 Subject: [PATCH 30/60] Add an alias for quick looking. --- lib/misc.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 722412a82..607ee8649 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -26,6 +26,9 @@ function pj() { ## Open current directory alias oo='open .' +## Quick-look a file (^C to close) +alias ql='qlmanage -p 2>/dev/null' + ## Start a local SMTP server and dump emails sent to it to the console alias smtpconsole='python -m smtpd -n -c DebuggingServer localhost:1025' @@ -33,4 +36,4 @@ alias smtpconsole='python -m smtpd -n -c DebuggingServer localhost:1025' alias serve_this='python -m SimpleHTTPServer' ## Highlight-aware less command -alias hl='less -R' \ No newline at end of file +alias hl='less -R' From d52ac73a988e2b7e001f0cd42f90005649017691 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 21 Jul 2010 16:37:09 -0400 Subject: [PATCH 31/60] Update Mercurial tab completion functions. --- functions/_hg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functions/_hg b/functions/_hg index 6028baa24..9f9863690 100644 --- a/functions/_hg +++ b/functions/_hg @@ -1,4 +1,3 @@ - #compdef hg # Zsh completion script for mercurial. Rename this file to _hg and copy @@ -359,7 +358,7 @@ _hg_pat_opts=( _hg_diff_opts=( '(--text -a)'{-a,--text}'[treat all files as text]' '(--git -g)'{-g,--git}'[use git extended diff format]' - "--nodates[don't include dates in diff headers]") + "--nodates[omit dates from diff headers]") _hg_dryrun_opts=( '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') @@ -735,6 +734,11 @@ _hg_cmd_status() { '*:files:_files' } +_hg_cmd_summary() { + _arguments -s -w : $_hg_global_opts \ + '--remote[check for push and pull]' +} + _hg_cmd_tag() { _arguments -s -w : $_hg_global_opts \ '(--local -l)'{-l,--local}'[make the tag local]' \ From 7ab8155aa89d5cd5e371438508ac6abce001a35c Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 21 Jul 2010 16:38:12 -0400 Subject: [PATCH 32/60] Remove the example script to make custom symlinkable. --- custom/example.zsh | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 custom/example.zsh diff --git a/custom/example.zsh b/custom/example.zsh deleted file mode 100644 index 28ffcae25..000000000 --- a/custom/example.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Add yourself some shortcuts to projects you often work on -# Example: -# -# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr -# \ No newline at end of file From 8b78c0135f0e01ad07526b6fdab440ed01840390 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 21 Jul 2010 16:52:28 -0400 Subject: [PATCH 33/60] Remove some unused aliases/functions. --- lib/directories.zsh | 10 ---------- lib/functions.zsh | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 9065011f9..0070ad882 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -15,16 +15,6 @@ alias cd....='cd ../../..' alias cd.....='cd ../../../..' alias cd/='cd /' -alias 1='cd -' -alias 2='cd +2' -alias 3='cd +3' -alias 4='cd +4' -alias 5='cd +5' -alias 6='cd +6' -alias 7='cd +7' -alias 8='cd +8' -alias 9='cd +9' - cd () { if [[ "x$*" == "x..." ]]; then cd ../.. diff --git a/lib/functions.zsh b/lib/functions.zsh index 75f27efd3..96f7e26a7 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -32,15 +32,3 @@ function uninstall_oh_my_zsh() { function upgrade_oh_my_zsh() { /bin/sh $ZSH/tools/upgrade.sh } - -function tab() { - osascript 2>/dev/null < Date: Tue, 27 Jul 2010 15:12:23 -0400 Subject: [PATCH 34/60] django: add pmt --- lib/django.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/django.zsh b/lib/django.zsh index 14b11f5ce..b72160adc 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -6,6 +6,7 @@ alias pmsdb='python manage.py syncdb' alias pms='python manage.py shell' alias pmsp='python manage.py shell_plus' alias pmlf='python manage.py loaddata fixtures/*' +alias pmt='python -W ignore::DeprecationWarning manage.py test' alias gs='gunicorn_django' alias gk='kill `cat .gunicorn.pid`' From f2dad51a2c8e3ab47fa00bd89f07b2ebe07d1901 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 12 Aug 2010 09:20:12 -0400 Subject: [PATCH 35/60] lib/python: lazily load the extremely slow virtualenvwrapper --- lib/python.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/python.zsh b/lib/python.zsh index 7c17a097e..3f740b4c9 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -1,5 +1,7 @@ function wo() { - [ -f './.venv' ] && workon `cat ./.venv` + [ "$VEW_SOURCED" ] || source "$VEW_PATH" + [ -f './.venv' ] && workon `cat ./.venv` || workon $1 + export VEW_SOURCED=1 } alias deact='deactivate' alias cdv='cd $WORKON_HOME' @@ -8,4 +10,4 @@ function cdp () { cd "$(python -c "import os.path as _, ${1}; \ print _.dirname(_.realpath(${1}.__file__[:-1]))" )" -} \ No newline at end of file +} From 3e4947673687b94139f819b39de86d9a2fdc2eb8 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 12 Aug 2010 09:34:14 -0400 Subject: [PATCH 36/60] lib: prune some things to load faster --- lib/aliases.zsh | 9 --------- lib/correction.zsh | 4 ---- lib/grep.zsh | 6 ------ lib/misc.zsh | 8 ++++++++ lib/rvm.zsh | 7 ------- 5 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 lib/aliases.zsh delete mode 100644 lib/grep.zsh delete mode 100644 lib/rvm.zsh diff --git a/lib/aliases.zsh b/lib/aliases.zsh deleted file mode 100644 index eabafbc4d..000000000 --- a/lib/aliases.zsh +++ /dev/null @@ -1,9 +0,0 @@ -# Push and pop directories on directory stack -alias pu='pushd' -alias po='popd' - -# Super user -alias _='sudo' - -# Show history -alias history='fc -l 1' diff --git a/lib/correction.zsh b/lib/correction.zsh index fc60dcdbd..0ad789881 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -4,7 +4,3 @@ alias man='nocorrect man' alias mv='nocorrect mv' alias mysql='nocorrect mysql' alias mkdir='nocorrect mkdir' -alias gist='nocorrect gist' -alias heroku='nocorrect heroku' -alias ebuild='nocorrect ebuild' -alias hpodder='nocorrect hpodder' diff --git a/lib/grep.zsh b/lib/grep.zsh deleted file mode 100644 index 93c4270b6..000000000 --- a/lib/grep.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# -# Color grep results -# Examples: http://rubyurl.com/ZXv -# -export GREP_OPTIONS='--color=auto' -export GREP_COLOR='1;32' \ No newline at end of file diff --git a/lib/misc.zsh b/lib/misc.zsh index 607ee8649..b1a14140c 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -37,3 +37,11 @@ alias serve_this='python -m SimpleHTTPServer' ## Highlight-aware less command alias hl='less -R' + +## Show history +alias history='fc -l 1' + +## Color grep results +## Examples: http://rubyurl.com/ZXv +export GREP_OPTIONS='--color=auto' +export GREP_COLOR='1;32' diff --git a/lib/rvm.zsh b/lib/rvm.zsh deleted file mode 100644 index 597be1b33..000000000 --- a/lib/rvm.zsh +++ /dev/null @@ -1,7 +0,0 @@ -# get the name of the branch we are on -function rvm_prompt_info() { - ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return - echo "($ruby_version)" -} - - From edda7793d535e9e25f4a5067252f6f6c6cac571b Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 18 Aug 2010 03:54:35 -0400 Subject: [PATCH 37/60] Add Vim undo files to the .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e173dab09..67262f05b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ projects.zsh custom custom/*.zsh !custom/example.zsh +*.un~ .DS_Store From c279e2af8f0a0d2e3791012b526b7b6b09c97b86 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 18 Aug 2010 03:54:54 -0400 Subject: [PATCH 38/60] themes/prose: remove the battery charge prompt --- themes/prose.zsh-theme | 6 ------ 1 file changed, 6 deletions(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index cab930f87..74c59c071 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -4,10 +4,6 @@ function prompt_char { echo '○' } -function battery_charge { - echo `$BAT_CHARGE` 2>/dev/null -} - function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } @@ -24,8 +20,6 @@ PROMPT=' %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) $(virtualenv_info)$(prompt_char) ' -RPROMPT='$(battery_charge)' - ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" From 8f292a08a97b77142b85a98633ce9c1a5101ace4 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 18 Aug 2010 03:59:36 -0400 Subject: [PATCH 39/60] themes/prose: add .box-name support --- themes/prose.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 74c59c071..d64a7ab67 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -16,8 +16,12 @@ function hg_prompt_info { patches: >" 2>/dev/null } +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) +%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) $(virtualenv_info)$(prompt_char) ' ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" From 036ab9aa0854b5446aa702a517dc876c60f5be25 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 24 Aug 2010 14:30:31 -0400 Subject: [PATCH 40/60] lib/misc: add cj function --- lib/misc.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index b1a14140c..6641ca4ea 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -23,6 +23,11 @@ function pj() { python -mjson.tool } +## curl JSON +function cj() { + curl -sS $@ | pj +} + ## Open current directory alias oo='open .' From cd4d2c8163632d2bbb530a131b64a20027ea9d50 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 24 Sep 2010 10:56:31 -0400 Subject: [PATCH 41/60] themes/prose: Remove prompt_char to make the prompt faster. --- themes/prose.zsh-theme | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index d64a7ab67..9ade9e573 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -1,9 +1,3 @@ -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - hg root >/dev/null 2>/dev/null && echo '☿' && return - echo '○' -} - function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } @@ -22,7 +16,7 @@ function box_name { PROMPT=' %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) -$(virtualenv_info)$(prompt_char) ' +$(virtualenv_info)$ ' ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From f2f09f0ae6ed10a7e6e16c9bc111e4d4bd9d5258 Mon Sep 17 00:00:00 2001 From: webflo Date: Tue, 28 Sep 2010 13:58:58 +0200 Subject: [PATCH 42/60] fix path to github repository and installation instructions --- README.textile | 6 +++--- tools/install.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.textile b/README.textile index 8b1b6875a..7d7ac4bc2 100644 --- a/README.textile +++ b/README.textile @@ -8,14 +8,14 @@ h2. Setup h3. The automatic installer... (do you trust me?) -@wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ +@wget http://github.com/sjl/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ h3. The manual way 1. Clone the repository - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ + @git clone git://github.com/sjl/oh-my-zsh.git ~/.oh-my-zsh@ 2. Create a new zsh config by copying the zsh template we've provided. @@ -38,7 +38,7 @@ h2. Usage * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) ** example: @plugins=(git osx ruby)@ * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. +** Take a look at the "current themes":http://wiki.github.com/sjl/oh-my-zsh/themes that come bundled with _Oh My Zsh_. * much much more... take a look at @lib/@ what _Oh My Zsh_ offers... h2. Useful diff --git a/tools/install.sh b/tools/install.sh index 004b252f4..f441674d4 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,7 @@ then fi echo "Cloning Oh My Zsh..." -/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +/usr/bin/env git clone git://github.com/sjl/oh-my-zsh.git ~/.oh-my-zsh echo "Looking for an existing zsh config..." if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] From d631d8ab5ac2f6bb0820bf4d7e7b5c59f7e26bcc Mon Sep 17 00:00:00 2001 From: till Date: Sun, 3 Oct 2010 23:38:02 +0200 Subject: [PATCH 43/60] * test if 'custom' exists before we try to read from it * this is to avoid an error message when we enter zsh ;) --- oh-my-zsh.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index bb45c71eb..84ad483ce 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -8,7 +8,9 @@ fpath=($ZSH/functions $fpath) for config_file ($ZSH/lib/*.zsh) source $config_file # Load all of your custom configurations from custom/ -for config_file ($ZSH/custom/*.zsh) source $config_file +if [ -d "$ZSH/custom" ]; then + for config_file ($ZSH/custom/*.zsh) source $config_file +fi # Load all of the plugins that were defined in ~/.zshrc plugin=${plugin:=()} @@ -22,4 +24,4 @@ else /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh fi -unset config_file \ No newline at end of file +unset config_file From ee28db27fca924501bef66ef8d23d955743775d2 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 6 Oct 2010 18:24:00 -0400 Subject: [PATCH 44/60] Remove terminal title junk. --- lib/functions.zsh | 27 +++++---------------------- lib/termsupport.zsh | 21 --------------------- 2 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 lib/termsupport.zsh diff --git a/lib/functions.zsh b/lib/functions.zsh index 96f7e26a7..558955b23 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -1,25 +1,8 @@ -## fixme, i duplicated this in xterms - oops -function title { - if [[ $TERM == "screen" ]]; then - # Use these two for GNU Screen: - print -nR $'\033k'$1$'\033'\\\ - - print -nR $'\033]0;'$2$'\a' - elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then - # Use this one instead for XTerms: - print -nR $'\033]0;'$*$'\a' - fi -} - -function precmd { - title zsh "$PWD" -} - -function preexec { - emulate -L zsh - local -a cmd; cmd=(${(z)1}) - title $cmd[1]:t "$cmd[2,-1]" -} +#function preexec { + #emulate -L zsh + #local -a cmd; cmd=(${(z)1}) + #title $cmd[1]:t "$cmd[2,-1]" +#} function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh deleted file mode 100644 index fef978748..000000000 --- a/lib/termsupport.zsh +++ /dev/null @@ -1,21 +0,0 @@ -case "$TERM" in - xterm*|rxvt*) - preexec () { - print -Pn "\e]0;%n@%m: $1\a" # xterm - } - precmd () { - print -Pn "\e]0;%n@%m: %~\a" # xterm - } - ;; - screen*) - preexec () { - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} - echo -ne "\ek$CMD\e\\" - print -Pn "\e]0;%n@%m: $1\a" # xterm - } - precmd () { - echo -ne "\ekzsh\e\\" - print -Pn "\e]0;%n@%m: %~\a" # xterm - } - ;; -esac \ No newline at end of file From 95d695f6958a2b80ef2591aa20b102d6f7ee227e Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Sat, 20 Nov 2010 16:10:27 +0100 Subject: [PATCH 45/60] Add a plugin that emulates Fish style live command coloring. --- .../command-coloring.plugin.zsh | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 plugins/command-coloring/command-coloring.plugin.zsh diff --git a/plugins/command-coloring/command-coloring.plugin.zsh b/plugins/command-coloring/command-coloring.plugin.zsh new file mode 100644 index 000000000..677f5fdec --- /dev/null +++ b/plugins/command-coloring/command-coloring.plugin.zsh @@ -0,0 +1,53 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------ +# Fish style live command coloring. +# From: http://www.zsh.org/mla/users/2010/msg00692.html +# ------------------------------------------------------------------------------ + +# Required options. +setopt extendedglob + +# Token types styles. +# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135 +ZLE_RESERVED_WORD_STYLE='bold' +ZLE_ALIAS_STYLE='bold' +ZLE_BUILTIN_STYLE='bold' +ZLE_FUNCTION_STYLE='bold' +ZLE_COMMAND_STYLE='bold' +ZLE_COMMAND_UNKNOWN_TOKEN_STYLE='fg=red,bold' +ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace') + +# Recolorize the current ZLE buffer. +colorize-zle-buffer() { + region_highlight=() + colorize=true + start_pos=0 + for arg in ${(z)BUFFER}; do + ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]## #}})) + ((end_pos=$start_pos+${#arg})) + if $colorize; then + colorize=false + res=$(LC_ALL=C builtin type $arg 2>/dev/null) + case $res in + *'reserved word'*) style=$ZLE_RESERVED_WORD_STYLE;; + *'an alias'*) style=$ZLE_ALIAS_STYLE;; + *'shell builtin'*) style=$ZLE_BUILTIN_STYLE;; + *'shell function'*) style=$ZLE_FUNCTION_STYLE;; + *"$cmd is"*) style=$ZLE_COMMAND_STYLE;; + *) style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE;; + esac + region_highlight+=("$start_pos $end_pos $style") + fi + [[ ${${ZLE_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]}:+yes} = 'yes' ]] && colorize=true + start_pos=$end_pos + done +} + +# Bind the function to ZLE events. +colorize-hook-self-insert() { builtin zle .self-insert && colorize-zle-buffer } +colorize-hook-backward-delete-char() { builtin zle .backward-delete-char && colorize-zle-buffer } +colorize-hook-vi-backward-delete-char() { builtin zle .vi-backward-delete-char && colorize-zle-buffer } + +zle -N self-insert colorize-hook-self-insert +zle -N backward-delete-char colorize-hook-backward-delete-char +zle -N vi-backward-delete-char colorize-hook-vi-backward-delete-char From d1136186c79b9dc2767ef0147a6556ec09f2b477 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 23 Nov 2010 10:52:11 -0500 Subject: [PATCH 46/60] lib/django: add South aliases --- lib/django.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/django.zsh b/lib/django.zsh index b72160adc..4075a5150 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -8,6 +8,15 @@ alias pmsp='python manage.py shell_plus' alias pmlf='python manage.py loaddata fixtures/*' alias pmt='python -W ignore::DeprecationWarning manage.py test' +alias pmdm='python manage.py datamigration' +alias pmsm='python manage.py schemamigration --auto' +alias pmsi='python manage.py schemamigration --initial' +alias pmm='python manage.py migrate' +alias pmma='python manage.py migrate --all' +alias pmml='python manage.py migrate --list' +alias pmmf='python manage.py migrate --fake' +alias pmcats='python manage.py convert_to_south' + alias gs='gunicorn_django' alias gk='kill `cat .gunicorn.pid`' alias gl='tail -f .gunicorn.log' From 9bedf2977a3358441ce01665983798cc69dc353f Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 23 Nov 2010 10:59:11 -0500 Subject: [PATCH 47/60] lib/misc: add the "What the hell did I do the other day?" function --- lib/misc.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index 6641ca4ea..a6a07c73c 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -50,3 +50,13 @@ alias history='fc -l 1' ## Examples: http://rubyurl.com/ZXv export GREP_OPTIONS='--color=auto' export GREP_COLOR='1;32' + +# What the hell did I do the other day? +function whatthehelldididoon() { + for repo in `find . -name '.hg'` + do + echo $repo + hg .. -R $repo/.. -d "$1" -u 'Steve Losh' + done +} + From 5aa37062a57d5535f9f39abe882b03014f20ad5b Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 23 Dec 2010 11:23:50 -0500 Subject: [PATCH 48/60] Add kennethreitz' Fabric tab completion as a plugin. --- plugins/fabric/fabric.plugin.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/fabric/fabric.plugin.zsh diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh new file mode 100644 index 000000000..119be9e67 --- /dev/null +++ b/plugins/fabric/fabric.plugin.zsh @@ -0,0 +1,19 @@ +#!zsh +# +# Installation +# ------------ +# +# To achieve fabfile completion nirvana: +# +# Copy this file somewhere (e.g. ~/.fab-comletion.zsh) and put the following line in your .zshrc: +# +# source ~/.fab-comletion.zsh +# +# Or, use this file as a oh-my-zsh plugin. +# + +_fab_list() { + reply=(`fab --shortlist`) +} +compctl -K _fab_list fab + From ef5e8b18f5dfb9593622b6686257befd7ad110b5 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 27 Dec 2010 14:36:21 -0500 Subject: [PATCH 49/60] Better syntax highlighting. --- .../command-coloring.plugin.zsh | 114 +++++++++++++----- 1 file changed, 85 insertions(+), 29 deletions(-) diff --git a/plugins/command-coloring/command-coloring.plugin.zsh b/plugins/command-coloring/command-coloring.plugin.zsh index 677f5fdec..1a9fe9594 100644 --- a/plugins/command-coloring/command-coloring.plugin.zsh +++ b/plugins/command-coloring/command-coloring.plugin.zsh @@ -1,53 +1,109 @@ #!/usr/bin/env zsh -# ------------------------------------------------------------------------------ -# Fish style live command coloring. -# From: http://www.zsh.org/mla/users/2010/msg00692.html -# ------------------------------------------------------------------------------ - -# Required options. -setopt extendedglob +# Copyleft 2010 zsh-syntax-highlighting contributors +# http://github.com/nicoulaj/zsh-syntax-highlighting +# All wrongs reserved. # Token types styles. # See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135 -ZLE_RESERVED_WORD_STYLE='bold' -ZLE_ALIAS_STYLE='bold' -ZLE_BUILTIN_STYLE='bold' -ZLE_FUNCTION_STYLE='bold' -ZLE_COMMAND_STYLE='bold' +ZLE_RESERVED_WORD_STYLE='fg=yellow,bold' +ZLE_ALIAS_STYLE='fg=green,bold' +ZLE_BUILTIN_STYLE='fg=green,bold' +ZLE_FUNCTION_STYLE='fg=green,bold' +ZLE_COMMAND_STYLE='fg=green,bold' +ZLE_PATH_STYLE='fg=white,underline' ZLE_COMMAND_UNKNOWN_TOKEN_STYLE='fg=red,bold' -ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace') + +ZLE_HYPHEN_CLI_OPTION='fg=yellow,bold' +ZLE_DOUBLE_HYPHEN_CLI_OPTION='fg=green,bold' +ZLE_SINGLE_QUOTED='fg=magenta,bold' +ZLE_DOUBLE_QUOTED='fg=red,bold' +ZLE_BACK_QUOTED='fg=cyan,bold' +ZLE_GLOBING='fg=blue,bold' + +ZLE_DEFAULT='fg=white,normal' + +ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace' 'noglob' 'command' 'builtin') + +_check_path() { + [[ -z $arg ]] && return 1 + [[ -e $arg ]] && return 0 + [[ ! -e ${arg:h} ]] && return 1 + [[ ${#BUFFER} == $end_pos && -n $(print $arg*(N)) ]] && return 0 + return 1 +} # Recolorize the current ZLE buffer. colorize-zle-buffer() { + setopt localoptions extendedglob region_highlight=() colorize=true start_pos=0 for arg in ${(z)BUFFER}; do - ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]## #}})) + ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]##[[:space:]]#}})) ((end_pos=$start_pos+${#arg})) if $colorize; then colorize=false - res=$(LC_ALL=C builtin type $arg 2>/dev/null) + res=$(LC_ALL=C builtin type -w $arg 2>/dev/null) case $res in - *'reserved word'*) style=$ZLE_RESERVED_WORD_STYLE;; - *'an alias'*) style=$ZLE_ALIAS_STYLE;; - *'shell builtin'*) style=$ZLE_BUILTIN_STYLE;; - *'shell function'*) style=$ZLE_FUNCTION_STYLE;; - *"$cmd is"*) style=$ZLE_COMMAND_STYLE;; - *) style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE;; + *': reserved') style=$ZLE_RESERVED_WORD_STYLE;; + *': alias') style=$ZLE_ALIAS_STYLE;; + *': builtin') style=$ZLE_BUILTIN_STYLE;; + *': function') style=$ZLE_FUNCTION_STYLE;; + *': command') style=$ZLE_COMMAND_STYLE;; + *) + if _check_path; then + style=$ZLE_PATH_STYLE + else + style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE + fi + ;; esac - region_highlight+=("$start_pos $end_pos $style") + else + case $arg in + '--'*) style=$ZLE_DOUBLE_HYPHEN_CLI_OPTION;; + '-'*) style=$ZLE_HYPHEN_CLI_OPTION;; + "'"*"'") style=$ZLE_SINGLE_QUOTED;; + '"'*'"') style=$ZLE_DOUBLE_QUOTED;; + '`'*'`') style=$ZLE_BACK_QUOTED;; + *"*"*) style=$ZLE_GLOBING;; + *) + style=$ZLE_DEFAULT + _check_path && style=$ZLE_PATH_STYLE + ;; + esac fi - [[ ${${ZLE_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]}:+yes} = 'yes' ]] && colorize=true + region_highlight+=("$start_pos $end_pos $style") + [[ ${${ZLE_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]:-}:+yes} = 'yes' ]] && colorize=true start_pos=$end_pos done } # Bind the function to ZLE events. -colorize-hook-self-insert() { builtin zle .self-insert && colorize-zle-buffer } -colorize-hook-backward-delete-char() { builtin zle .backward-delete-char && colorize-zle-buffer } -colorize-hook-vi-backward-delete-char() { builtin zle .vi-backward-delete-char && colorize-zle-buffer } +ZLE_COLORED_FUNCTIONS=( + self-insert + delete-char + backward-delete-char + kill-word + backward-kill-word + up-line-or-history + down-line-or-history + beginning-of-history + end-of-history + undo + redo + yank +) + +for f in $ZLE_COLORED_FUNCTIONS; do + eval "$f() { zle .$f && colorize-zle-buffer } ; zle -N $f" +done + +# Expand or complete hack + +# create an expansion widget which mimics the original "expand-or-complete" (you can see the default setup using "zle -l -L") +zle -C orig-expand-or-complete .expand-or-complete _main_complete + +# use the orig-expand-or-complete inside the colorize function (for some reason, using the ".expand-or-complete" widget doesn't work the same) +expand-or-complete() { builtin zle orig-expand-or-complete && colorize-zle-buffer } +zle -N expand-or-complete -zle -N self-insert colorize-hook-self-insert -zle -N backward-delete-char colorize-hook-backward-delete-char -zle -N vi-backward-delete-char colorize-hook-vi-backward-delete-char From fee5b95415abfe5ef89d02388115f62ff92425a4 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Mon, 27 Dec 2010 14:52:50 -0500 Subject: [PATCH 50/60] Syntax highlighting colors. --- plugins/command-coloring/command-coloring.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/command-coloring/command-coloring.plugin.zsh b/plugins/command-coloring/command-coloring.plugin.zsh index 1a9fe9594..c0d2ce6bc 100644 --- a/plugins/command-coloring/command-coloring.plugin.zsh +++ b/plugins/command-coloring/command-coloring.plugin.zsh @@ -14,9 +14,9 @@ ZLE_PATH_STYLE='fg=white,underline' ZLE_COMMAND_UNKNOWN_TOKEN_STYLE='fg=red,bold' ZLE_HYPHEN_CLI_OPTION='fg=yellow,bold' -ZLE_DOUBLE_HYPHEN_CLI_OPTION='fg=green,bold' +ZLE_DOUBLE_HYPHEN_CLI_OPTION='fg=yellow,bold' ZLE_SINGLE_QUOTED='fg=magenta,bold' -ZLE_DOUBLE_QUOTED='fg=red,bold' +ZLE_DOUBLE_QUOTED='fg=magenta,bold' ZLE_BACK_QUOTED='fg=cyan,bold' ZLE_GLOBING='fg=blue,bold' From 0503e60d9a9e99dfb6550fbb2a6cd8173c23e8c9 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 6 Jan 2011 18:19:21 -0500 Subject: [PATCH 51/60] lib/directories: remove the useless . alias --- lib/directories.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 0070ad882..a97cf9c67 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -4,7 +4,6 @@ setopt auto_pushd setopt pushd_ignore_dups alias -- -='cd -' -alias .='pwd' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' From 57af129fc70a4ef6a736b5be20c64e606dbda457 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 24 Mar 2011 15:04:35 -0400 Subject: [PATCH 52/60] Add encrypt/decrypt. --- lib/misc.zsh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index a6a07c73c..0b5acdd9a 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -17,16 +17,14 @@ export LC_CTYPE=en_US.UTF-8 function pman() { man $1 -t | open -f -a Preview } - +# ## pretty JSON function pj() { python -mjson.tool } -## curl JSON -function cj() { - curl -sS $@ | pj -} + + ## Open current directory alias oo='open .' @@ -51,12 +49,10 @@ alias history='fc -l 1' export GREP_OPTIONS='--color=auto' export GREP_COLOR='1;32' -# What the hell did I do the other day? -function whatthehelldididoon() { - for repo in `find . -name '.hg'` - do - echo $repo - hg .. -R $repo/.. -d "$1" -u 'Steve Losh' - done +# Quick and dirty encryption +function encrypt() { + openssl des3 -a -in $1 -out $1.des3 +} +function decrypt() { + openssl des3 -d -a -in $1 -out ${1%.des3} } - From 9f202fc05f85755ab8beeb7f276aea47ad49bb07 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 7 Apr 2011 10:21:43 -0400 Subject: [PATCH 53/60] themes/prose: make the Mercurial binary configurable --- themes/prose.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 9ade9e573..8f7f75943 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -1,9 +1,13 @@ +if [ "x$OH_MY_ZSH_HG" = "x" ]; then + OH_MY_ZSH_HG="hg" +fi + function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } function hg_prompt_info { - hg prompt --angle-brackets "\ + $OH_MY_ZSH_HG prompt --angle-brackets "\ < on %{$fg[magenta]%}%{$reset_color%}>\ < at %{$fg[yellow]%}%{$reset_color%}>\ %{$fg[green]%}%{$reset_color%}< From 2833427020c1516e2a5a4ccb0c5c4c1e9ef1c9a7 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 3 Jun 2011 16:09:51 -0400 Subject: [PATCH 54/60] Add the rprompt with the retval indicator. --- themes/prose.zsh-theme | 3 +++ 1 file changed, 3 insertions(+) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 8f7f75943..51c1967d8 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -27,3 +27,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="" + +local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" +RPROMPT='${return_status}%{$reset_color%}' From d1602643a444303621097843e6a6d4bbe2a996aa Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 22 Jul 2011 13:49:02 -0400 Subject: [PATCH 55/60] Map Ctrl+N/P too. --- lib/key-bindings.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index dbb54086e..5d6d8041a 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -11,6 +11,8 @@ bindkey "^[[6~" down-line-or-history # make search up and down work, so partially type and hit up/down to find relevant stuff bindkey '^[[A' up-line-or-search bindkey '^[[B' down-line-or-search +bindkey '^p' up-line-or-search +bindkey '^n' down-line-or-search bindkey "^[[H" beginning-of-line bindkey "^[[1~" beginning-of-line From f378bff3afaae0cb4e195238756d4aebe32a968b Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 22 Jul 2011 13:49:39 -0400 Subject: [PATCH 56/60] A few tweaks for my prompt. --- themes/prose.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme index 51c1967d8..1a637037a 100644 --- a/themes/prose.zsh-theme +++ b/themes/prose.zsh-theme @@ -20,7 +20,7 @@ function box_name { PROMPT=' %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) -$(virtualenv_info)$ ' +$(virtualenv_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" @@ -28,5 +28,5 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="" -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" +local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" RPROMPT='${return_status}%{$reset_color%}' From 18211c7b5a4284f5393e911f2a91230cd8383cb4 Mon Sep 17 00:00:00 2001 From: Yevgeniy Viktorov Date: Wed, 27 Jul 2011 13:44:06 +0300 Subject: [PATCH 57/60] minor update regexp to fit to the new git status output --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 1deca8715..6f17cae48 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -11,7 +11,7 @@ parse_git_dirty () { echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY" fi - if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\)$") > 0 ]]; then + if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\|# Changes not staged for commit:\)$") > 0 ]]; then echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED" fi From b35ad06fa7b959f1f3e82f2cbdb6b3311a913002 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 12 Aug 2011 12:12:49 -0400 Subject: [PATCH 58/60] Switch to static directory for pmrpg. --- lib/django.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/django.zsh b/lib/django.zsh index 4075a5150..e1dd132aa 100644 --- a/lib/django.zsh +++ b/lib/django.zsh @@ -1,7 +1,7 @@ alias pm='python manage.py' alias pmr='python manage.py runserver' alias pmrp='python manage.py runserver_plus' -alias pmrpg='pmrp --adminmedia=`pwd`/media/admin' +alias pmrpg='pmrp --adminmedia=`pwd`/static/admin' alias pmsdb='python manage.py syncdb' alias pms='python manage.py shell' alias pmsp='python manage.py shell_plus' From 8b572a010d016705fc1047854cd30465152ada98 Mon Sep 17 00:00:00 2001 From: SimonGreenhill Date: Sat, 14 Jan 2012 23:06:08 +1300 Subject: [PATCH 59/60] Revert "merge" This reverts commit 5e8734bfd6e5164a0d98b7e38770bf1562bf34a2, reversing changes made to 7a41498b0d4f68c537d494b5f849913361315fde. --- .gitignore | 8 +- README.textile | 4 +- custom/example.zsh | 5 + custom/example/example.plugin.zsh | 2 + functions/_hg | 951 ------------------ lib/completion.zsh | 8 +- lib/correction.zsh | 4 + lib/directories.zsh | 28 +- lib/django.zsh | 30 - lib/functions.zsh | 37 +- lib/git.zsh | 28 +- lib/grep.zsh | 6 + lib/key-bindings.zsh | 17 +- lib/misc.zsh | 44 +- lib/python.zsh | 13 - lib/redis.zsh | 2 - lib/rvm.zsh | 7 + lib/supervisord.zsh | 2 - lib/theme-and-appearance.zsh | 1 + oh-my-zsh.sh | 4 +- .../command-coloring.plugin.zsh | 109 -- plugins/fabric/fabric.plugin.zsh | 19 - templates/zshrc.zsh-template | 2 +- themes/mattcable.zsh-theme | 9 - themes/prose.zsh-theme | 32 - tools/install.sh | 2 +- 26 files changed, 74 insertions(+), 1300 deletions(-) create mode 100644 custom/example.zsh create mode 100644 custom/example/example.plugin.zsh delete mode 100644 functions/_hg delete mode 100644 lib/django.zsh create mode 100644 lib/grep.zsh delete mode 100644 lib/python.zsh delete mode 100644 lib/redis.zsh create mode 100644 lib/rvm.zsh delete mode 100644 lib/supervisord.zsh delete mode 100644 plugins/command-coloring/command-coloring.plugin.zsh delete mode 100644 plugins/fabric/fabric.plugin.zsh delete mode 100644 themes/mattcable.zsh-theme delete mode 100644 themes/prose.zsh-theme diff --git a/.gitignore b/.gitignore index a88f751a2..2e8db7341 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ locals.zsh log/.zsh_history projects.zsh -custom -custom/*.zsh -*.un~ +custom/* +!custom/example +!custom/example.zsh cache *.swp - -.DS_Store diff --git a/README.textile b/README.textile index 3d5cccac0..eca968089 100644 --- a/README.textile +++ b/README.textile @@ -23,7 +23,7 @@ h3. The manual way 1. Clone the repository - @git clone git://github.com/sjl/oh-my-zsh.git ~/.oh-my-zsh@ + @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ 2. Create a new zsh config by copying the zsh template we've provided. @@ -46,7 +46,7 @@ h2. Usage * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) ** example: @plugins=(git osx ruby)@ * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":http://wiki.github.com/sjl/oh-my-zsh/themes that come bundled with _Oh My Zsh_. +** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. * much much more... take a look at @lib/@ what _Oh My Zsh_ offers... h2. Useful diff --git a/custom/example.zsh b/custom/example.zsh new file mode 100644 index 000000000..28ffcae25 --- /dev/null +++ b/custom/example.zsh @@ -0,0 +1,5 @@ +# Add yourself some shortcuts to projects you often work on +# Example: +# +# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr +# \ No newline at end of file diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh new file mode 100644 index 000000000..406f27445 --- /dev/null +++ b/custom/example/example.plugin.zsh @@ -0,0 +1,2 @@ +# Add your own custom plugins in the custom/plugins directory. Plugins placed +# here will override ones with the same name in the main plugins directory. diff --git a/functions/_hg b/functions/_hg deleted file mode 100644 index 9f9863690..000000000 --- a/functions/_hg +++ /dev/null @@ -1,951 +0,0 @@ -#compdef hg - -# Zsh completion script for mercurial. Rename this file to _hg and copy -# it into your zsh function path (/usr/share/zsh/site-functions for -# instance) -# -# If you do not want to install it globally, you can copy it somewhere -# else and add that directory to $fpath. This must be done before -# compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc -# file could look like this: -# -# fpath=("$HOME/.zsh.d" $fpath) -# autoload -U compinit -# compinit -# -# Copyright (C) 2005, 2006 Steve Borho -# Copyright (C) 2006-9 Brendan Cully -# -# Permission is hereby granted, without written agreement and without -# licence or royalty fees, to use, copy, modify, and distribute this -# software and to distribute modified versions of this software for any -# purpose, provided that the above copyright notice and the following -# two paragraphs appear in all copies of this software. -# -# In no event shall the authors be liable to any party for direct, -# indirect, special, incidental, or consequential damages arising out of -# the use of this software and its documentation, even if the authors -# have been advised of the possibility of such damage. -# -# The authors specifically disclaim any warranties, including, but not -# limited to, the implied warranties of merchantability and fitness for -# a particular purpose. The software provided hereunder is on an "as -# is" basis, and the authors have no obligation to provide maintenance, -# support, updates, enhancements, or modifications. - -emulate -LR zsh -setopt extendedglob - -local curcontext="$curcontext" state line -typeset -A _hg_cmd_globals - -_hg() { - local cmd _hg_root - integer i=2 - _hg_cmd_globals=() - - while (( i < $#words )) - do - case "$words[$i]" in - -R|--repository) - eval _hg_root="$words[$i+1]" - _hg_cmd_globals+=("$words[$i]" "$_hg_root") - (( i += 2 )) - continue - ;; - -R*) - _hg_cmd_globals+="$words[$i]" - eval _hg_root="${words[$i]#-R}" - (( i++ )) - continue - ;; - --cwd|--config) - # pass along arguments to hg completer - _hg_cmd_globals+=("$words[$i]" "$words[$i+1]") - (( i += 2 )) - continue - ;; - -*) - # skip option - (( i++ )) - continue - ;; - esac - if [[ -z "$cmd" ]] - then - cmd="$words[$i]" - words[$i]=() - (( CURRENT-- )) - fi - (( i++ )) - done - - if [[ -z "$cmd" ]] - then - _arguments -s -w : $_hg_global_opts \ - ':mercurial command:_hg_commands' - return - fi - - # resolve abbreviations and aliases - if ! (( $+functions[_hg_cmd_${cmd}] )) - then - local cmdexp - (( $#_hg_cmd_list )) || _hg_get_commands - - cmdexp=$_hg_cmd_list[(r)${cmd}*] - if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]] - then - # might be nice to rewrite the command line with the expansion - cmd="$cmdexp" - fi - if [[ -n $_hg_alias_list[$cmd] ]] - then - cmd=$_hg_alias_list[$cmd] - fi - fi - - curcontext="${curcontext%:*:*}:hg-${cmd}:" - - zstyle -s ":completion:$curcontext:" cache-policy update_policy - - if [[ -z "$update_policy" ]] - then - zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy - fi - - if (( $+functions[_hg_cmd_${cmd}] )) - then - _hg_cmd_${cmd} - else - # complete unknown commands normally - _arguments -s -w : $_hg_global_opts \ - '*:files:_hg_files' - fi -} - -_hg_cache_policy() { - typeset -a old - - # cache for a minute - old=( "$1"(mm+10) ) - (( $#old )) && return 0 - - return 1 -} - -_hg_get_commands() { - typeset -ga _hg_cmd_list - typeset -gA _hg_alias_list - local hline cmd cmdalias - - _call_program hg hg debugcomplete -v | while read -A hline - do - cmd=$hline[1] - _hg_cmd_list+=($cmd) - - for cmdalias in $hline[2,-1] - do - _hg_cmd_list+=($cmdalias) - _hg_alias_list+=($cmdalias $cmd) - done - done -} - -_hg_commands() { - (( $#_hg_cmd_list )) || _hg_get_commands - _describe -t commands 'mercurial command' _hg_cmd_list -} - -_hg_revrange() { - compset -P 1 '*:' - _hg_tags "$@" -} - -_hg_tags() { - typeset -a tags - local tag rev - - _hg_cmd tags | while read tag - do - tags+=(${tag/ # [0-9]#:*}) - done - (( $#tags )) && _describe -t tags 'tags' tags -} - -# likely merge candidates -_hg_mergerevs() { - typeset -a heads - local myrev - - heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) - # exclude own revision - myrev=$(_hg_cmd log -r . --template '{rev}\\n') - heads=(${heads:#$myrev}) - - (( $#heads )) && _describe -t heads 'heads' heads -} - -_hg_files() { - if [[ -n "$_hg_root" ]] - then - [[ -d "$_hg_root/.hg" ]] || return - case "$_hg_root" in - /*) - _files -W $_hg_root - ;; - *) - _files -W $PWD/$_hg_root - ;; - esac - else - _files - fi -} - -_hg_status() { - [[ -d $PREFIX ]] || PREFIX=$PREFIX:h - status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) -} - -_hg_unknown() { - typeset -a status_files - _hg_status u - _wanted files expl 'unknown files' _multi_parts / status_files -} - -_hg_missing() { - typeset -a status_files - _hg_status d - _wanted files expl 'missing files' _multi_parts / status_files -} - -_hg_modified() { - typeset -a status_files - _hg_status m - _wanted files expl 'modified files' _multi_parts / status_files -} - -_hg_resolve() { - local rstate rpath - - [[ -d $PREFIX ]] || PREFIX=$PREFIX:h - - _hg_cmd resolve -l ./$PREFIX | while read rstate rpath - do - [[ $rstate == 'R' ]] && resolved_files+=($rpath) - [[ $rstate == 'U' ]] && unresolved_files+=($rpath) - done -} - -_hg_resolved() { - typeset -a resolved_files unresolved_files - _hg_resolve - _wanted files expl 'resolved files' _multi_parts / resolved_files -} - -_hg_unresolved() { - typeset -a resolved_files unresolved_files - _hg_resolve - _wanted files expl 'unresolved files' _multi_parts / unresolved_files -} - -_hg_config() { - typeset -a items - items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) - (( $#items )) && _describe -t config 'config item' items -} - -_hg_addremove() { - _alternative 'files:unknown files:_hg_unknown' \ - 'files:missing files:_hg_missing' -} - -_hg_ssh_urls() { - if [[ -prefix */ ]] - then - if zstyle -T ":completion:${curcontext}:files" remote-access - then - local host=${PREFIX%%/*} - typeset -a remdirs - compset -p $(( $#host + 1 )) - local rempath=${(M)PREFIX##*/} - local cacheid="hg:${host}-${rempath//\//_}" - cacheid=${cacheid%[-_]} - compset -P '*/' - if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" - then - remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) - _store_cache "$cacheid" remdirs - fi - _describe -t directories 'remote directory' remdirs -S/ - else - _message 'remote directory' - fi - else - if compset -P '*@' - then - _hosts -S/ - else - _alternative 'hosts:remote host name:_hosts -S/' \ - 'users:user:_users -S@' - fi - fi -} - -_hg_urls() { - if compset -P bundle:// - then - _files - elif compset -P ssh:// - then - _hg_ssh_urls - elif [[ -prefix *: ]] - then - _urls - else - local expl - compset -S '[^:]*' - _wanted url-schemas expl 'URL schema' compadd -S '' - \ - http:// https:// ssh:// bundle:// - fi -} - -_hg_paths() { - typeset -a paths pnames - _hg_cmd paths | while read -A pnames - do - paths+=($pnames[1]) - done - (( $#paths )) && _describe -t path-aliases 'repository alias' paths -} - -_hg_remote() { - _alternative 'path-aliases:repository alias:_hg_paths' \ - 'directories:directory:_files -/' \ - 'urls:URL:_hg_urls' -} - -_hg_clone_dest() { - _alternative 'directories:directory:_files -/' \ - 'urls:URL:_hg_urls' -} - -# Common options -_hg_global_opts=( - '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' - '--cwd[change working directory]:new working directory:_files -/' - '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' - '(--verbose -v)'{-v,--verbose}'[enable additional output]' - '*--config[set/override config option]:defined config items:_hg_config' - '(--quiet -q)'{-q,--quiet}'[suppress output]' - '(--help -h)'{-h,--help}'[display help and exit]' - '--debug[debug mode]' - '--debugger[start debugger]' - '--encoding[set the charset encoding (default: UTF8)]' - '--encodingmode[set the charset encoding mode (default: strict)]' - '--lsprof[print improved command execution profile]' - '--traceback[print traceback on exception]' - '--time[time how long the command takes]' - '--profile[profile]' - '--version[output version information and exit]' -) - -_hg_pat_opts=( - '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' - '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') - -_hg_diff_opts=( - '(--text -a)'{-a,--text}'[treat all files as text]' - '(--git -g)'{-g,--git}'[use git extended diff format]' - "--nodates[omit dates from diff headers]") - -_hg_dryrun_opts=( - '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') - -_hg_style_opts=( - '--style[display using template map file]:' - '--template[display with template]:') - -_hg_commit_opts=( - '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' - '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use as commit message]:message:' - '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from ]:log file:_files') - -_hg_remote_opts=( - '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' - '--remotecmd[specify hg command to run on the remote side]:') - -_hg_cmd() { - _call_program hg hg --config ui.verbose=0 --config defaults."$1"= \ - "$_hg_cmd_globals[@]" "$@" 2> /dev/null -} - -_hg_cmd_add() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '*:unknown files:_hg_unknown' -} - -_hg_cmd_addremove() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ - '*:unknown or missing files:_hg_addremove' -} - -_hg_cmd_annotate() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ - '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ - '(--text -a)'{-a,--text}'[treat all files as text]' \ - '(--user -u)'{-u,--user}'[list the author]' \ - '(--date -d)'{-d,--date}'[list the date]' \ - '(--number -n)'{-n,--number}'[list the revision number (default)]' \ - '(--changeset -c)'{-c,--changeset}'[list the changeset]' \ - '*:files:_hg_files' -} - -_hg_cmd_archive() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '--no-decode[do not pass files through decoders]' \ - '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ - '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \ - '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ - '*:destination:_files' -} - -_hg_cmd_backout() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '--merge[merge with old dirstate parent after backout]' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '--parent[parent to choose when backing out merge]' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - '(--message -m)'{-m+,--message}'[use as commit message]:text:' \ - '(--logfile -l)'{-l+,--logfile}'[read commit message from ]:log file:_files -g \*.txt' -} - -_hg_cmd_bisect() { - _arguments -s -w : $_hg_global_opts \ - '(-)'{-r,--reset}'[reset bisect state]' \ - '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_tags \ - '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_tags \ - '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ - '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ - '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' -} - -_hg_cmd_branch() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ - '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' -} - -_hg_cmd_branches() { - _arguments -s -w : $_hg_global_opts \ - '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' -} - -_hg_cmd_bundle() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ - '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ - ':output file:_files' \ - ':destination repository:_files -/' -} - -_hg_cmd_cat() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - '*:file:_hg_files' -} - -_hg_cmd_clone() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ - '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ - '--uncompressed[use uncompressed transfer (fast over LAN)]' \ - ':source repository:_hg_remote' \ - ':destination:_hg_clone_dest' -} - -_hg_cmd_commit() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ - '(--message -m)'{-m+,--message}'[use as commit message]:text:' \ - '(--logfile -l)'{-l+,--logfile}'[read commit message from ]:log file:_files -g \*.txt' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '*:file:_hg_files' -} - -_hg_cmd_copy() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ - '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ - '*:file:_hg_files' -} - -_hg_cmd_diff() { - typeset -A opt_args - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ - '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ - '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ - '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ - '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ - '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ - '*:file:->diff_files' - - if [[ $state == 'diff_files' ]] - then - if [[ -n $opt_args[-r] ]] - then - _hg_files - else - _hg_modified - fi - fi -} - -_hg_cmd_export() { - _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ - '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ - '--switch-parent[diff against the second parent]' \ - '*:revision:_hg_tags' -} - -_hg_cmd_grep() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ - '--all[print all revisions with matches]' \ - '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ - '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ - '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ - '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ - '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ - '(--user -u)'{-u,--user}'[print user who committed change]' \ - '1:search pattern:' \ - '*:files:_hg_files' -} - -_hg_cmd_heads() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' -} - -_hg_cmd_help() { - _arguments -s -w : $_hg_global_opts \ - '*:mercurial command:_hg_commands' -} - -_hg_cmd_identify() { - _arguments -s -w : $_hg_global_opts \ - '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \ - '(--num -n)'{-n+,--num}'[show local revision number]' \ - '(--id -i)'{-i+,--id}'[show global revision id]' \ - '(--branch -b)'{-b+,--branch}'[show branch]' \ - '(--tags -t)'{-t+,--tags}'[show tags]' -} - -_hg_cmd_import() { - _arguments -s -w : $_hg_global_opts \ - '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ - '(--message -m)'{-m+,--message}'[use as commit message]:text:' \ - '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ - '*:patch:_files' -} - -_hg_cmd_incoming() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ - '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ - '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ - '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ - '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ - '--bundle[file to store the bundles into]:bundle file:_files' \ - ':source:_hg_remote' -} - -_hg_cmd_init() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - ':dir:_files -/' -} - -_hg_cmd_locate() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \ - '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ - '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ - '*:search pattern:_hg_files' -} - -_hg_cmd_log() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ - '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ - '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ - '(--copies -C)'{-C,--copies}'[show copied files]' \ - '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ - '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ - '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ - '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ - '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ - '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ - '*:files:_hg_files' -} - -_hg_cmd_manifest() { - _arguments -s -w : $_hg_global_opts \ - ':revision:_hg_tags' -} - -_hg_cmd_merge() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ - '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ - '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ - ':revision:_hg_mergerevs' -} - -_hg_cmd_outgoing() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ - '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ - '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ - '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ - '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ - ':destination:_hg_remote' -} - -_hg_cmd_parents() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ - ':last modified file:_hg_files' -} - -_hg_cmd_paths() { - _arguments -s -w : $_hg_global_opts \ - ':path:_hg_paths' -} - -_hg_cmd_pull() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ - '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ - ':source:_hg_remote' -} - -_hg_cmd_push() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - '(--force -f)'{-f,--force}'[force push]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ - ':destination:_hg_remote' -} - -_hg_cmd_remove() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ - '(--force -f)'{-f,--force}'[remove file even if modified]' \ - '*:file:_hg_files' -} - -_hg_cmd_rename() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ - '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ - '*:file:_hg_files' -} - -_hg_cmd_resolve() { - local context state line - typeset -A opt_args - - _arguments -s -w : $_hg_global_opts \ - '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ - '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ - '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ - '*:file:_hg_unresolved' - - if [[ $state == 'resolve_files' ]] - then - _alternative 'files:resolved files:_hg_resolved' \ - 'files:unresolved files:_hg_unresolved' - fi -} - -_hg_cmd_revert() { - local context state line - typeset -A opt_args - - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ - '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ - '--no-backup[do not save backup copies of files]' \ - '*:file:->diff_files' - - if [[ $state == 'diff_files' ]] - then - if [[ -n $opt_args[-r] ]] - then - _hg_files - else - typeset -a status_files - _hg_status mard - _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files - fi - fi -} - -_hg_cmd_serve() { - _arguments -s -w : $_hg_global_opts \ - '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ - '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ - '(--daemon -d)'{-d,--daemon}'[run server in background]' \ - '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ - '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ - '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ - '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ - '--style[web template style]:style' \ - '--stdio[for remote clients]' \ - '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' -} - -_hg_cmd_showconfig() { - _arguments -s -w : $_hg_global_opts \ - '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ - ':config item:_hg_config' -} - -_hg_cmd_status() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--all -A)'{-A,--all}'[show status of all files]' \ - '(--modified -m)'{-m,--modified}'[show only modified files]' \ - '(--added -a)'{-a,--added}'[show only added files]' \ - '(--removed -r)'{-r,--removed}'[show only removed files]' \ - '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ - '(--clean -c)'{-c,--clean}'[show only files without changes]' \ - '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ - '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ - '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ - '(--copies -C)'{-C,--copies}'[show source of copied files]' \ - '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ - '--rev[show difference from revision]:revision:_hg_tags' \ - '*:files:_files' -} - -_hg_cmd_summary() { - _arguments -s -w : $_hg_global_opts \ - '--remote[check for push and pull]' -} - -_hg_cmd_tag() { - _arguments -s -w : $_hg_global_opts \ - '(--local -l)'{-l,--local}'[make the tag local]' \ - '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ - ':tag name:' -} - -_hg_cmd_tip() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--patch -p)'{-p,--patch}'[show patch]' -} - -_hg_cmd_unbundle() { - _arguments -s -w : $_hg_global_opts \ - '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ - ':files:_files' -} - -_hg_cmd_update() { - _arguments -s -w : $_hg_global_opts \ - '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - ':revision:_hg_tags' -} - -# HGK -_hg_cmd_view() { - _arguments -s -w : $_hg_global_opts \ - '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ - ':revision range:_hg_tags' -} - -# MQ -_hg_qseries() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qseries)"}) - (( $#patches )) && _describe -t hg-patches 'patches' patches -} - -_hg_qapplied() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qapplied)"}) - if (( $#patches )) - then - patches+=(qbase qtip) - _describe -t hg-applied-patches 'applied patches' patches - fi -} - -_hg_qunapplied() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qunapplied)"}) - (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches -} - -# unapplied, including guarded patches -_hg_qdeletable() { - typeset -a unapplied - unapplied=(${(f)"$(_hg_cmd qseries)"}) - for p in $(_hg_cmd qapplied) - do - unapplied=(${unapplied:#$p}) - done - - (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied -} - -_hg_qguards() { - typeset -a guards - local guard - compset -P "+|-" - _hg_cmd qselect -s | while read guard - do - guards+=(${guard#(+|-)}) - done - (( $#guards )) && _describe -t hg-guards 'guards' guards -} - -_hg_qseries_opts=( - '(--summary -s)'{-s,--summary}'[print first line of patch header]') - -_hg_cmd_qapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qdelete() { - _arguments -s -w : $_hg_global_opts \ - '(--keep -k)'{-k,--keep}'[keep patch file]' \ - '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ - '*:unapplied patch:_hg_qdeletable' -} - -_hg_cmd_qdiff() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '*:pattern:_hg_files' -} - -_hg_cmd_qfold() { - _arguments -s -w : $_hg_global_opts $_h_commit_opts \ - '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ - '*:unapplied patch:_hg_qunapplied' -} - -_hg_cmd_qgoto() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[overwrite any local changes]' \ - ':patch:_hg_qseries' -} - -_hg_cmd_qguard() { - _arguments -s -w : $_hg_global_opts \ - '(--list -l)'{-l,--list}'[list all patches and guards]' \ - '(--none -n)'{-n,--none}'[drop all guards]' \ - ':patch:_hg_qseries' \ - '*:guards:_hg_qguards' -} - -_hg_cmd_qheader() { - _arguments -s -w : $_hg_global_opts \ - ':patch:_hg_qseries' -} - -_hg_cmd_qimport() { - _arguments -s -w : $_hg_global_opts \ - '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ - '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ - '(--force -f)'{-f,--force}'[overwrite existing files]' \ - '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ - '*:patch:_files' -} - -_hg_cmd_qnew() { - _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ - '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ - ':patch:' -} - -_hg_cmd_qnext() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qpop() { - _arguments -s -w : $_hg_global_opts \ - '(--all -a :)'{-a,--all}'[pop all patches]' \ - '(--name -n)'{-n+,--name}'[queue name to pop]:' \ - '(--force -f)'{-f,--force}'[forget any local changes]' \ - ':patch:_hg_qapplied' -} - -_hg_cmd_qprev() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qpush() { - _arguments -s -w : $_hg_global_opts \ - '(--all -a :)'{-a,--all}'[apply all patches]' \ - '(--list -l)'{-l,--list}'[list patch name in commit text]' \ - '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ - '(--name -n)'{-n+,--name}'[merge queue name]:' \ - '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ - ':patch:_hg_qunapplied' -} - -_hg_cmd_qrefresh() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ - '(--git -g)'{-g,--git}'[use git extended diff format]' \ - '(--short -s)'{-s,--short}'[short refresh]' \ - '*:files:_hg_files' -} - -_hg_cmd_qrename() { - _arguments -s -w : $_hg_global_opts \ - ':patch:_hg_qseries' \ - ':destination:' -} - -_hg_cmd_qselect() { - _arguments -s -w : $_hg_global_opts \ - '(--none -n :)'{-n,--none}'[disable all guards]' \ - '(--series -s :)'{-s,--series}'[list all guards in series file]' \ - '--pop[pop to before first guarded applied patch]' \ - '--reapply[pop and reapply patches]' \ - '*:guards:_hg_qguards' -} - -_hg_cmd_qseries() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ - '(--missing -m)'{-m,--missing}'[print patches not in series]' -} - -_hg_cmd_qunapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qtop() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_strip() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[force multi-head removal]' \ - '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ - '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ - ':revision:_hg_tags' -} - -_hg "$@" diff --git a/lib/completion.zsh b/lib/completion.zsh index c9b205f9c..b964595ed 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,14 +1,16 @@ # fixme - the load process here seems a bit bizarre -unsetopt 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 -unsetopt always_to_end +setopt always_to_end WORDCHARS='' zmodload -i zsh/complist -# case-insensitive (all), partial-word and then substring completion +## case-insensitive (all),partial-word and then substring completion if [ "x$CASE_SENSITIVE" = "xtrue" ]; then zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' unset CASE_SENSITIVE diff --git a/lib/correction.zsh b/lib/correction.zsh index 0ad789881..fc60dcdbd 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -4,3 +4,7 @@ alias man='nocorrect man' alias mv='nocorrect mv' alias mysql='nocorrect mysql' alias mkdir='nocorrect mkdir' +alias gist='nocorrect gist' +alias heroku='nocorrect heroku' +alias ebuild='nocorrect ebuild' +alias hpodder='nocorrect hpodder' diff --git a/lib/directories.zsh b/lib/directories.zsh index 5ff701c7d..bb114f615 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -3,17 +3,23 @@ setopt auto_name_dirs setopt auto_pushd setopt pushd_ignore_dups -alias -- -='cd -' alias ..='cd ..' -alias ...='cd ../..' -alias ....='cd ../../..' -alias .....='cd ../../../..' alias cd..='cd ..' alias cd...='cd ../..' alias cd....='cd ../../..' alias cd.....='cd ../../../..' alias cd/='cd /' +alias 1='cd -' +alias 2='cd +2' +alias 3='cd +3' +alias 4='cd +4' +alias 5='cd +5' +alias 6='cd +6' +alias 7='cd +7' +alias 8='cd +8' +alias 9='cd +9' + cd () { if [[ "x$*" == "x..." ]]; then cd ../.. @@ -32,19 +38,7 @@ alias md='mkdir -p' alias rd=rmdir alias d='dirs -v' -# List direcory contents -alias l1='tree --dirsfirst -ChFL 1' -alias l2='tree --dirsfirst -ChFL 2' -alias l3='tree --dirsfirst -ChFL 3' - -alias ll1='tree --dirsfirst -ChFupDaL 1' -alias ll2='tree --dirsfirst -ChFupDaL 2' -alias ll3='tree --dirsfirst -ChFupDaL 3' - -alias l='l1' -alias ll='ll1' - # mkdir & cd to it function mcd() { mkdir -p "$1" && cd "$1"; -} +} \ No newline at end of file diff --git a/lib/django.zsh b/lib/django.zsh deleted file mode 100644 index e1dd132aa..000000000 --- a/lib/django.zsh +++ /dev/null @@ -1,30 +0,0 @@ -alias pm='python manage.py' -alias pmr='python manage.py runserver' -alias pmrp='python manage.py runserver_plus' -alias pmrpg='pmrp --adminmedia=`pwd`/static/admin' -alias pmsdb='python manage.py syncdb' -alias pms='python manage.py shell' -alias pmsp='python manage.py shell_plus' -alias pmlf='python manage.py loaddata fixtures/*' -alias pmt='python -W ignore::DeprecationWarning manage.py test' - -alias pmdm='python manage.py datamigration' -alias pmsm='python manage.py schemamigration --auto' -alias pmsi='python manage.py schemamigration --initial' -alias pmm='python manage.py migrate' -alias pmma='python manage.py migrate --all' -alias pmml='python manage.py migrate --list' -alias pmmf='python manage.py migrate --fake' -alias pmcats='python manage.py convert_to_south' - -alias gs='gunicorn_django' -alias gk='kill `cat .gunicorn.pid`' -alias gl='tail -f .gunicorn.log' - -function djapp() { - mkdir -p $1/templates/$1 - touch $1/__init__.py - echo "from django.db import models\n\n" > $1/models.py - echo "from django.contrib import admin\nfrom $1.models import *\n\n" > $1/admin.py - echo "from django.conf.urls.defaults import *\n\n" > $1/urls.py -} diff --git a/lib/functions.zsh b/lib/functions.zsh index d78b51809..d2dcadd0c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -10,39 +10,8 @@ function upgrade_oh_my_zsh() { /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh } -function extract() { - unset REMOVE_ARCHIVE - - if test "$1" = "-r"; then - REMOVE=1 - shift - fi - if [[ -f $1 ]]; then - case $1 in - *.tar.bz2) tar xvjf $1;; - *.tar.gz) tar xvzf $1;; - *.tar.xz) tar xvJf $1;; - *.tar.lzma) tar --lzma -xvf $1;; - *.bz2) bunzip $1;; - *.rar) unrar x $1;; - *.gz) gunzip $1;; - *.tar) tar xvf $1;; - *.tbz2) tar xvjf $1;; - *.tgz) tar xvzf $1;; - *.zip) unzip $1;; - *.Z) uncompress $1;; - *.7z) 7z x $1;; - *) echo "'$1' cannot be extracted via >extract<";; - esac - - if [[ $REMOVE_ARCHIVE -eq 1 ]]; then - echo removing "$1"; - /bin/rm "$1"; - fi - - else - echo "'$1' is not a valid file" - fi +function take() { + mkdir -p $1 + cd $1 } - diff --git a/lib/git.zsh b/lib/git.zsh index 8e6ee8106..defa062c6 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -4,19 +4,12 @@ function git_prompt_info() { echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" } -parse_git_dirty () { - gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)') - - if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then - echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY" - fi - - if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\|# Changes not staged for commit:\)$") > 0 ]]; then - echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED" - fi - - if [[ $(echo ${gitstat} | grep -v '^$' | wc -l | tr -d ' ') == 0 ]]; then - echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN" +# Checks if working tree is dirty +parse_git_dirty() { + if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then + echo "$ZSH_THEME_GIT_PROMPT_DIRTY" + else + echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } @@ -27,15 +20,6 @@ function git_prompt_ahead() { fi } -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} - # Formats prompt string for current git commit short SHA function git_prompt_short_sha() { SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" diff --git a/lib/grep.zsh b/lib/grep.zsh new file mode 100644 index 000000000..93c4270b6 --- /dev/null +++ b/lib/grep.zsh @@ -0,0 +1,6 @@ +# +# Color grep results +# Examples: http://rubyurl.com/ZXv +# +export GREP_OPTIONS='--color=auto' +export GREP_COLOR='1;32' \ No newline at end of file diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 86f3966c0..5c1b90bfa 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -11,8 +11,6 @@ bindkey "^[[6~" down-line-or-history # make search up and down work, so partially type and hit up/down to find relevant stuff bindkey '^[[A' up-line-or-search bindkey '^[[B' down-line-or-search -bindkey '^p' up-line-or-search -bindkey '^n' down-line-or-search bindkey "^[[H" beginning-of-line bindkey "^[[1~" beginning-of-line @@ -33,6 +31,21 @@ bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char bindkey "\e[3~" delete-char +# consider emacs keybindings: + +#bindkey -e ## emacs key bindings +# +#bindkey '^[[A' up-line-or-search +#bindkey '^[[B' down-line-or-search +#bindkey '^[^[[C' emacs-forward-word +#bindkey '^[^[[D' emacs-backward-word +# +#bindkey -s '^X^Z' '%-^M' +#bindkey '^[e' expand-cmd-path +#bindkey '^[^I' reverse-menu-complete +#bindkey '^X^N' accept-and-infer-next-history +#bindkey '^W' kill-region +#bindkey '^I' complete-word ## Fix weird sequence that rxvt produces #bindkey -s '^[[Z' '\t' # diff --git a/lib/misc.zsh b/lib/misc.zsh index 482fd1492..88732e664 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -3,53 +3,11 @@ autoload -U url-quote-magic zle -N self-insert url-quote-magic ## file rename magick -autoload -U zmv bindkey "^[m" copy-prev-shell-word ## jobs setopt long_list_jobs ## pager -export PAGER='less -R' +export PAGER=less export LC_CTYPE=$LANG - -## pretty man pages -function pman() { - man $1 -t | open -f -a Preview -} -# -## pretty JSON -function pj() { - python -mjson.tool -} - -## Open current directory -alias oo='open .' - -## Quick-look a file (^C to close) -alias ql='qlmanage -p 2>/dev/null' - -## Start a local SMTP server and dump emails sent to it to the console -alias smtpconsole='python -m smtpd -n -c DebuggingServer localhost:1025' - -## Serve the current folder on port 80 -alias serve_this='python -m SimpleHTTPServer' - -## Highlight-aware less command -alias hl='less -R' - -## Show history -alias history='fc -l 1' - -## Color grep results -## Examples: http://rubyurl.com/ZXv -export GREP_OPTIONS='--color=auto' -export GREP_COLOR='1;32' - -# Quick and dirty encryption -function encrypt() { - openssl des3 -a -in $1 -out $1.des3 -} -function decrypt() { - openssl des3 -d -a -in $1 -out ${1%.des3} -} diff --git a/lib/python.zsh b/lib/python.zsh deleted file mode 100644 index 3f740b4c9..000000000 --- a/lib/python.zsh +++ /dev/null @@ -1,13 +0,0 @@ -function wo() { - [ "$VEW_SOURCED" ] || source "$VEW_PATH" - [ -f './.venv' ] && workon `cat ./.venv` || workon $1 - export VEW_SOURCED=1 -} -alias deact='deactivate' -alias cdv='cd $WORKON_HOME' - -function cdp () { - cd "$(python -c "import os.path as _, ${1}; \ - print _.dirname(_.realpath(${1}.__file__[:-1]))" - )" -} diff --git a/lib/redis.zsh b/lib/redis.zsh deleted file mode 100644 index 751a01a84..000000000 --- a/lib/redis.zsh +++ /dev/null @@ -1,2 +0,0 @@ -alias res='./redis-server' -alias rec='./redis-cli' diff --git a/lib/rvm.zsh b/lib/rvm.zsh new file mode 100644 index 000000000..597be1b33 --- /dev/null +++ b/lib/rvm.zsh @@ -0,0 +1,7 @@ +# get the name of the branch we are on +function rvm_prompt_info() { + ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return + echo "($ruby_version)" +} + + diff --git a/lib/supervisord.zsh b/lib/supervisord.zsh deleted file mode 100644 index b09effb67..000000000 --- a/lib/supervisord.zsh +++ /dev/null @@ -1,2 +0,0 @@ -alias ssd='sudo supervisord' -alias ssc='sudo supervisorctl' \ No newline at end of file diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index bbd0dae9c..aec67721a 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -1,6 +1,7 @@ # ls colors autoload colors; colors; export LSCOLORS="Gxfxcxdxbxegedabagacad" +#export LS_COLORS # Enable ls colors if [ "$DISABLE_LS_COLORS" != "true" ] diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 39fe17825..aeeaa3daf 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -45,9 +45,7 @@ for plugin ($plugins); do done # Load all of your custom configurations from custom/ -if [ -d "$ZSH/custom" ]; then - for config_file ($ZSH/custom/*.zsh) source $config_file -fi +for config_file ($ZSH_CUSTOM/*.zsh) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] diff --git a/plugins/command-coloring/command-coloring.plugin.zsh b/plugins/command-coloring/command-coloring.plugin.zsh deleted file mode 100644 index c0d2ce6bc..000000000 --- a/plugins/command-coloring/command-coloring.plugin.zsh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env zsh -# Copyleft 2010 zsh-syntax-highlighting contributors -# http://github.com/nicoulaj/zsh-syntax-highlighting -# All wrongs reserved. - -# Token types styles. -# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135 -ZLE_RESERVED_WORD_STYLE='fg=yellow,bold' -ZLE_ALIAS_STYLE='fg=green,bold' -ZLE_BUILTIN_STYLE='fg=green,bold' -ZLE_FUNCTION_STYLE='fg=green,bold' -ZLE_COMMAND_STYLE='fg=green,bold' -ZLE_PATH_STYLE='fg=white,underline' -ZLE_COMMAND_UNKNOWN_TOKEN_STYLE='fg=red,bold' - -ZLE_HYPHEN_CLI_OPTION='fg=yellow,bold' -ZLE_DOUBLE_HYPHEN_CLI_OPTION='fg=yellow,bold' -ZLE_SINGLE_QUOTED='fg=magenta,bold' -ZLE_DOUBLE_QUOTED='fg=magenta,bold' -ZLE_BACK_QUOTED='fg=cyan,bold' -ZLE_GLOBING='fg=blue,bold' - -ZLE_DEFAULT='fg=white,normal' - -ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace' 'noglob' 'command' 'builtin') - -_check_path() { - [[ -z $arg ]] && return 1 - [[ -e $arg ]] && return 0 - [[ ! -e ${arg:h} ]] && return 1 - [[ ${#BUFFER} == $end_pos && -n $(print $arg*(N)) ]] && return 0 - return 1 -} - -# Recolorize the current ZLE buffer. -colorize-zle-buffer() { - setopt localoptions extendedglob - region_highlight=() - colorize=true - start_pos=0 - for arg in ${(z)BUFFER}; do - ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]##[[:space:]]#}})) - ((end_pos=$start_pos+${#arg})) - if $colorize; then - colorize=false - res=$(LC_ALL=C builtin type -w $arg 2>/dev/null) - case $res in - *': reserved') style=$ZLE_RESERVED_WORD_STYLE;; - *': alias') style=$ZLE_ALIAS_STYLE;; - *': builtin') style=$ZLE_BUILTIN_STYLE;; - *': function') style=$ZLE_FUNCTION_STYLE;; - *': command') style=$ZLE_COMMAND_STYLE;; - *) - if _check_path; then - style=$ZLE_PATH_STYLE - else - style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE - fi - ;; - esac - else - case $arg in - '--'*) style=$ZLE_DOUBLE_HYPHEN_CLI_OPTION;; - '-'*) style=$ZLE_HYPHEN_CLI_OPTION;; - "'"*"'") style=$ZLE_SINGLE_QUOTED;; - '"'*'"') style=$ZLE_DOUBLE_QUOTED;; - '`'*'`') style=$ZLE_BACK_QUOTED;; - *"*"*) style=$ZLE_GLOBING;; - *) - style=$ZLE_DEFAULT - _check_path && style=$ZLE_PATH_STYLE - ;; - esac - fi - region_highlight+=("$start_pos $end_pos $style") - [[ ${${ZLE_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]:-}:+yes} = 'yes' ]] && colorize=true - start_pos=$end_pos - done -} - -# Bind the function to ZLE events. -ZLE_COLORED_FUNCTIONS=( - self-insert - delete-char - backward-delete-char - kill-word - backward-kill-word - up-line-or-history - down-line-or-history - beginning-of-history - end-of-history - undo - redo - yank -) - -for f in $ZLE_COLORED_FUNCTIONS; do - eval "$f() { zle .$f && colorize-zle-buffer } ; zle -N $f" -done - -# Expand or complete hack - -# create an expansion widget which mimics the original "expand-or-complete" (you can see the default setup using "zle -l -L") -zle -C orig-expand-or-complete .expand-or-complete _main_complete - -# use the orig-expand-or-complete inside the colorize function (for some reason, using the ".expand-or-complete" widget doesn't work the same) -expand-or-complete() { builtin zle orig-expand-or-complete && colorize-zle-buffer } -zle -N expand-or-complete - diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh deleted file mode 100644 index 119be9e67..000000000 --- a/plugins/fabric/fabric.plugin.zsh +++ /dev/null @@ -1,19 +0,0 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve fabfile completion nirvana: -# -# Copy this file somewhere (e.g. ~/.fab-comletion.zsh) and put the following line in your .zshrc: -# -# source ~/.fab-comletion.zsh -# -# Or, use this file as a oh-my-zsh plugin. -# - -_fab_list() { - reply=(`fab --shortlist`) -} -compctl -K _fab_list fab - diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index a5ab3b2d5..e52553241 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each # time that oh-my-zsh is loaded. -export ZSH_THEME="random" +ZSH_THEME="robbyrussell" # Example aliases # alias zshconfig="mate ~/.zshrc" diff --git a/themes/mattcable.zsh-theme b/themes/mattcable.zsh-theme deleted file mode 100644 index 29ef6a22b..000000000 --- a/themes/mattcable.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -# based on robbyrussel.zsh-theme - -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -RPROMPT="%{$fg_bold[red]%}(%D{%m-%d %H:%M})%{$reset_color%}" - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/prose.zsh-theme b/themes/prose.zsh-theme deleted file mode 100644 index 1a637037a..000000000 --- a/themes/prose.zsh-theme +++ /dev/null @@ -1,32 +0,0 @@ -if [ "x$OH_MY_ZSH_HG" = "x" ]; then - OH_MY_ZSH_HG="hg" -fi - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function hg_prompt_info { - $OH_MY_ZSH_HG prompt --angle-brackets "\ -< on %{$fg[magenta]%}%{$reset_color%}>\ -< at %{$fg[yellow]%}%{$reset_color%}>\ -%{$fg[green]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - -PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) -$(virtualenv_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" -RPROMPT='${return_status}%{$reset_color%}' diff --git a/tools/install.sh b/tools/install.sh index fbac8bf54..aedb706da 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,7 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -/usr/bin/env git clone git://github.com/sjl/oh-my-zsh.git ~/.oh-my-zsh +/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] From 5ff8e09f6b4ff908e659ad487ffd2c5d26b954f6 Mon Sep 17 00:00:00 2001 From: SimonGreenhill Date: Fri, 24 Feb 2012 10:46:33 +1300 Subject: [PATCH 60/60] theme-chooser should warn in env variable /Users/simon/.oh-my-zsh is not set --- tools/theme_chooser.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 4d7047444..a36e76e5b 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -9,6 +9,12 @@ THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" + +if [ -z "$ZSH" ]; then + echo "You probably need to set the environment value $ZSH, e.g. 'export ZSH; $0'" + exit +fi + source $ZSH/oh-my-zsh.sh function noyes() {