From 6049787510e20d350b3ddb1acea584cbc5e427fc Mon Sep 17 00:00:00 2001 From: Brandon Siegel Date: Wed, 18 Jul 2012 04:11:12 -0400 Subject: [PATCH 1/2] Commit tmux plugin. Currently only contains tmux pane autocomplete. --- plugins/tmux/tmux.plugin.zsh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/tmux/tmux.plugin.zsh diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh new file mode 100644 index 000000000..19e8aca3d --- /dev/null +++ b/plugins/tmux/tmux.plugin.zsh @@ -0,0 +1,23 @@ +# tmux pane word completion by Julius Plenz +# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html + +# C-x t to initiate prefix search completions +# C-x C-x to initiate global search for completions +_tmux_pane_words() { + local expl + local -a w + if [[ -z "$TMUX_PANE" ]]; then + _message "not running inside tmux!" + return 1 + fi + w=( ${(u)=$(tmux capture-pane \; show-buffer \; delete-buffer)} ) + _wanted values expl 'words from current tmux pane' compadd -a w +} + +zle -C tmux-pane-words-prefix complete-word _generic +zle -C tmux-pane-words-anywhere complete-word _generic +bindkey '^Xt' tmux-pane-words-prefix +bindkey '^X^X' tmux-pane-words-anywhere +zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words +zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current +zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}' From 20303b825d4689edba09fef8eb2fed4dc19a2e01 Mon Sep 17 00:00:00 2001 From: Brandon Siegel Date: Wed, 18 Jul 2012 04:22:32 -0400 Subject: [PATCH 2/2] Merge pull request #1230 from origin --- plugins/git/git.plugin.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d3d3f702a..c6d7fd790 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -5,10 +5,14 @@ alias gst='git status' compdef _git gst=git-status alias gl='git pull' compdef _git gl=git-pull +alias gf='git fetch' +compdef _git gf=git-fetch alias gup='git fetch && git rebase' compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push +alias gd='git diff --color' +compdef _git gd=git-diff gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' @@ -26,9 +30,11 @@ alias gcount='git shortlog -sn' compdef gcount=git alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick -alias glg='git log --stat --max-count=5' +alias glg='git log --stat --color' compdef _git glg=git-log -alias glgg='git log --graph --max-count=5' +alias glgp='git log --stat --color -p' +compdef _git glgp=git-log +alias glgg='git log --graph --color' compdef _git glgg=git-log alias gss='git status -s' compdef _git gss=git-status