From 3021cc7e29826fced1042bfa75b4dcc72e70b8dc Mon Sep 17 00:00:00 2001 From: Ashley Dev Date: Mon, 12 Nov 2012 15:41:24 -0800 Subject: [PATCH] Updating git aliases --- lib/aliases.zsh | 12 ++++++- plugins/git/git-aliases.plugin.zsh | 53 ++++++++++++++++-------------- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 345fdfee5..3513a04a9 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -106,11 +106,21 @@ if [[ "$TERM" == 'xterm-256color' ]]; then fi fi +if [[ "$TMUX" != "" ]]; then + # For some reason tmux does a `cd -P $PWD` for it's default-path. + # my homedir is /u/$USER, but /u is a symlink to /usr/home/nfs, but I want + # my PROMPT to show '~' instead of '/usr/home/nfs'. This accomplishes that. + if [[ "${PWD#*$USER}" != "" ]] && [[ "${PWD#*$USER}" != "${PWD}" ]]; then + cd ~/${PWD#*$USER/} + fi +fi + + alias screen="screen $screenrc" alias sl="screen $screenrc -list" alias sr="screen $screenrc -a -A -U -D -R" alias S="screen $screenrc -U -S" alias tmux="tmux $tmuxconf" -alias tls="tmux list-sessions" +alias tl="tmux list-sessions" diff --git a/plugins/git/git-aliases.plugin.zsh b/plugins/git/git-aliases.plugin.zsh index a8f85c4d7..66c8ec977 100644 --- a/plugins/git/git-aliases.plugin.zsh +++ b/plugins/git/git-aliases.plugin.zsh @@ -1,31 +1,34 @@ # Aliases # alias g='git' ; compdef g=git -alias ga='git add' ; compdef _git ga=git-add -alias gaa='git add --all' ; compdef _git gaa=git-add -alias gs='git status' ; compdef _git gs=git-status -alias gst='git status' ; compdef _git gst=git-status +alias ga='git add' ; compdef _git ga=git-add +alias gaa='git add --all' ; compdef _git gaa=git-add +alias gs='git status' ; compdef _git gs=git-status +alias gst='git status' ; compdef _git gst=git-status # for `gsts ""` -alias gsts='git stash save' ; compdef _git gsts=git-stash -alias gstp='git stash pop' ; compdef _git gstp=git-stash -alias gstl='git stash list' ; compdef _git gstl=git-stash -alias gstll='git stash show -p --stat' ; compdef _git gstll=git-stash -alias gl='git pull' ; compdef _git gl=git-pull -alias gup='git fetch && git rebase' ; compdef _git gup=git-fetch -alias gf='git fetch' ; compdef _git gf=git-fetch -alias gp='git push' ; compdef _git gp=git-push -alias gd='git diff --no-ext-diff -b' ; compdef _git gd=git-diff -alias gdd='git diff --no-ext-diff' ; compdef _git gdd=git-diff -gdv() { git-diff -w "$@" | view - } ; compdef _git gdv=git-diff -alias gc='git commit -v' ; compdef _git gc=git-commit -alias gca='git commit -v -a' ; compdef _git gca=git-commit -alias gco='git checkout' ; compdef _git gco=git-checkout -alias gb='git branch' ; compdef _git gb=git-branch -alias gba='git branch -a' ; compdef _git gba=git-branch -alias gcount='git shortlog -sn' ; compdef gcount=git -alias gcp='git cherry-pick' ; compdef _git gcp=git-cherry-pick -alias gm='git merge' ; compdef _git gm=git-merge -alias glg='git log --stat --max-count=5'; compdef _git glg=git-log -alias gls='git shortlog' ; compdef _git gls=shortlog +alias gsts='git stash save' ; compdef _git gsts=git-stash +alias gstp='git stash pop' ; compdef _git gstp=git-stash +alias gstl='git stash list' ; compdef _git gstl=git-stash +alias gstll='git stash show -p --stat' ; compdef _git gstll=git-stash +alias gl='git pull' ; compdef _git gl=git-pull +alias gup='git fetch && git rebase' ; compdef _git gup=git-fetch +alias gf='git fetch' ; compdef _git gf=git-fetch +alias gp='git push' ; compdef _git gp=git-push +alias gd='git diff --no-ext-diff -b' ; compdef _git gd=git-diff +alias gD='git diff --no-ext-diff -b --cached' ; compdef _git gD=git-diff +alias gdw='git diff --no-ext-diff' ; compdef _git gdw=git-diff +alias gDw='git diff --no-ext-diff --cached' ; compdef _git gDw=git-diff +gdv() { git diff -w "$@" | view - } ; compdef _git gdv=git-diff +gDv() { git diff --cache -w "$@" | view - } ; compdef _git gDv=git-diff +alias gc='git commit -v' ; compdef _git gc=git-commit +alias gca='git commit -v -a' ; compdef _git gca=git-commit +alias gco='git checkout' ; compdef _git gco=git-checkout +alias gb='git branch' ; compdef _git gb=git-branch +alias gba='git branch -a' ; compdef _git gba=git-branch +alias gcount='git shortlog -sn' ; compdef gcount=git +alias gcp='git cherry-pick' ; compdef _git gcp=git-cherry-pick +alias gm='git merge' ; compdef _git gm=git-merge +alias glg='git log --stat --max-count=5' ; compdef _git glg=git-log +alias gls='git shortlog' ; compdef _git gls=shortlog # Git history (pretty) local pretty_format_oneline='--pretty=format:"%C(yellow)%h %C(green)%cd %C(cyan)%an %C(bold cyan)%d%C(reset) %s" --date=short'