From 128cd3f5661d42f10ef3bae742ae3416f401c7ad Mon Sep 17 00:00:00 2001 From: Justin Aiken <60tonangel@gmail.com> Date: Thu, 5 Sep 2013 09:39:22 -0600 Subject: [PATCH 1/9] Filter out missing links with jump autocomplete --- plugins/jump/jump.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 349d3e01f..8f1468206 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -7,13 +7,13 @@ # marks: lists all marks # export MARKPATH=$HOME/.marks -function jump { +function jump { cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" } -function mark { +function mark { mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1 } -function unmark { +function unmark { rm -i "$MARKPATH/$1" } function marks { @@ -21,7 +21,7 @@ function marks { } function _completemarks { - reply=($(ls $MARKPATH)) + reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([a-z]*):$/\2/g')) } compctl -K _completemarks jump From a265acee4f991dfd96fb3a9057309e9c1a345a2c Mon Sep 17 00:00:00 2001 From: Justin Aiken <60tonangel@gmail.com> Date: Thu, 5 Sep 2013 10:00:14 -0600 Subject: [PATCH 2/9] Better filename matching --- plugins/jump/jump.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 8f1468206..60eae85ad 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -21,7 +21,7 @@ function marks { } function _completemarks { - reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([a-z]*):$/\2/g')) + reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) } compctl -K _completemarks jump From 4517db6acc6e4217a25aa353da37fb8de617bfc4 Mon Sep 17 00:00:00 2001 From: Jeroen Janssens Date: Fri, 6 Sep 2013 09:34:27 -0400 Subject: [PATCH 3/9] Add _completemarks function as suggested by pielgrzym in https://github.com/robbyrussell/oh-my-zsh/pull/2045#issuecomment-22826540 --- plugins/jump/jump.plugin.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 60eae85ad..1035191ac 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -7,15 +7,19 @@ # marks: lists all marks # export MARKPATH=$HOME/.marks + function jump { cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" } + function mark { mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1 } + function unmark { rm -i "$MARKPATH/$1" } + function marks { ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo } @@ -23,6 +27,13 @@ function marks { function _completemarks { reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) } - compctl -K _completemarks jump compctl -K _completemarks unmark + +_mark_expansion() { + setopt extendedglob + autoload -U modify-current-argument + modify-current-argument '$(readlink "$MARKPATH/$ARG")' +} +zle -N _mark_expansion +bindkey "^g" _mark_expansion From 55d4873f91b8cebbb2e6df5f3a405022e76e0c2c Mon Sep 17 00:00:00 2001 From: Jeroen Janssens Date: Fri, 6 Sep 2013 09:40:44 -0400 Subject: [PATCH 4/9] Change marks function and remove 'function' keyword as suggested by pielgrzym in https://github.com/robbyrussell/oh-my-zsh/pull/2045#issuecomment-22820224 --- plugins/jump/jump.plugin.zsh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 1035191ac..c6f266ae5 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -8,24 +8,30 @@ # export MARKPATH=$HOME/.marks -function jump { +jump() { cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" } -function mark { +mark() { mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1 } -function unmark { +unmark() { rm -i "$MARKPATH/$1" } -function marks { - ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo +autoload colors +marks() { + for link in $MARKPATH/*(@); do + local markname="$fg[cyan]${link:t}$reset_color" + local markpath="$fg[blue]$(readlink $link)$reset_color" + printf "%s\t" $markname + printf "-> %s \t\n" $markpath + done } -function _completemarks { - reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) +_completemarks() { + reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) } compctl -K _completemarks jump compctl -K _completemarks unmark From 255b0c4f5e16465ace326ddf1884ea2e7c1f3df1 Mon Sep 17 00:00:00 2001 From: Jeroen Janssens Date: Fri, 6 Sep 2013 09:55:43 -0400 Subject: [PATCH 5/9] Mark function asks for confirmation and uses basename of directory when no argument is given --- plugins/jump/jump.plugin.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index c6f266ae5..e32a5a0b4 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -13,7 +13,15 @@ jump() { } mark() { - mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1 + DIR="$(pwd)" + if (( $# == 0 )); then + MARK=$(basename $DIR) + else + MARK=$1 + fi + if read -q \?"Mark ${DIR} as ${MARK}? (y/n) "; then + mkdir -p "$MARKPATH"; ln -s "${DIR}" "$MARKPATH/$MARK" + fi } unmark() { From d3e005d6b42995021ad6f1009734a55cb65be6ce Mon Sep 17 00:00:00 2001 From: Jeroen Janssens Date: Fri, 6 Sep 2013 15:29:14 -0400 Subject: [PATCH 6/9] Fix aliasing pwd --- plugins/jump/jump.plugin.zsh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index e32a5a0b4..a3c5cf8c3 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -13,14 +13,13 @@ jump() { } mark() { - DIR="$(pwd)" if (( $# == 0 )); then - MARK=$(basename $DIR) + MARK=$(basename "$(pwd)") else - MARK=$1 + MARK="$1" fi - if read -q \?"Mark ${DIR} as ${MARK}? (y/n) "; then - mkdir -p "$MARKPATH"; ln -s "${DIR}" "$MARKPATH/$MARK" + if read -q \?"Mark $(pwd) as ${MARK}? (y/n) "; then + mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$MARK" fi } From dff966afad231f66f6e7345383412682992f9e84 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Fri, 6 Sep 2013 16:00:24 -0700 Subject: [PATCH 7/9] Logo draft 1... --- README.textile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.textile b/README.textile index 1916d9f4e..86dd5da22 100644 --- a/README.textile +++ b/README.textile @@ -1,3 +1,5 @@ +!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png! + oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout... bq. "OH MY ZSHELL!" From f0d2ec537e9c91cc7e1f8d98aa303f43a7ca8da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Cauwelier?= Date: Tue, 8 Jan 2013 11:04:11 +0100 Subject: [PATCH 8/9] plugins/git: missing compdefs and new aliases --- plugins/git/git.plugin.zsh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 6b91b4a72..9691067e9 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -12,14 +12,17 @@ compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push alias gd='git diff' +compdef _git gd=git-diff gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff +alias gdc='git diff --cached' +compdef _git gdc=git-diff alias gc='git commit -v' compdef _git gc=git-commit alias gc!='git commit -v --amend' compdef _git gc!=git-commit alias gca='git commit -v -a' -compdef _git gc=git-commit +compdef _git gca=git-commit alias gca!='git commit -v -a --amend' compdef _git gca!=git-commit alias gcmsg='git commit -m' @@ -27,6 +30,9 @@ compdef _git gcmsg=git-commit alias gco='git checkout' compdef _git gco=git-checkout alias gcm='git checkout master' +compdef _git gcm=git-checkout +alias grm='git rebase master' +compdef _git grm=git-rebase alias gr='git remote' compdef _git gr=git-remote alias grv='git remote -v' @@ -52,6 +58,7 @@ compdef _git gba=git-branch alias gcount='git shortlog -sn' compdef gcount=git alias gcl='git config --list' +compdef _git gcl=git-config alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5' @@ -69,11 +76,15 @@ compdef _git ga=git-add alias gm='git merge' compdef _git gm=git-merge alias grh='git reset HEAD' +compdef _git grh=git-reset alias grhh='git reset HEAD --hard' -alias gclean='git reset --hard && git clean -dfx' +compdef _git grhh=git-reset alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' +compdef _git gwc=git-whatchanged alias gf='git ls-files | grep' +compdef _git gf=git-ls-files alias gpoat='git push origin --all && git push origin --tags' +compdef _git gpoat=git-push alias gmt='git mergetool --no-prompt' compdef _git gm=git-mergetool From b592f9aac31e95539cf072959b524148113e181f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Cauwelier?= Date: Thu, 25 Apr 2013 23:14:38 +0200 Subject: [PATCH 9/9] activate virtualenvwrapper by default --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 670c287bd..32d783f52 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,4 +1,4 @@ -virtualenvwrapper='virtualenvwrapper_lazy.sh' +virtualenvwrapper='virtualenvwrapper.sh' if (( $+commands[$virtualenvwrapper] )); then source ${${virtualenvwrapper}:c}