Skip to content

Instantly share code, notes, and snippets.

@pid
Forked from victorporof/config.fish.sh
Created April 19, 2016 11:26
Show Gist options
  • Save pid/ac2b1d52a3e0d76aba23ca4c4cf04e5f to your computer and use it in GitHub Desktop.
Save pid/ac2b1d52a3e0d76aba23ca4c4cf04e5f to your computer and use it in GitHub Desktop.

Revisions

  1. @victorporof victorporof revised this gist Apr 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,7 @@ set DOWNLOADS $HOME/Downloads
    # Git

    alias gs "git status --short"
    alias gd "git diff"
    alias gd "git diff --color-words"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(normal bold)%w(0,4,4)%s%n%n%C(normal)%w(0,4,4)%b%C(reset)%n"
  2. @victorporof victorporof revised this gist Apr 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(normal bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(normal bold)%w(0,4,4)%s%n%n%C(normal)%w(0,4,4)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --pretty=format:'$pretty_oneline'"

  3. @victorporof victorporof revised this gist Apr 17, 2016. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ alias gd "git diff"
    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(normal bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"
    alias glgg "git log --graph --pretty=format:'$pretty_oneline'"

    alias gl "git pull --rebase"
    alias glup "git pull upstream master --rebase"
    @@ -55,7 +55,9 @@ alias gc "git commit --signoff --message"
    alias gca "git commit --signoff --amend --no-edit"
    alias gcam "git commit --signoff --amend --message"

    alias gst "git stash save --include-untracked"
    alias gst "git stash save"
    alias gsta "git stash save --include-untracked"
    alias gsti "git stash save --patch"
    alias gsl "git stash list"
    alias gss "git stash show --patch"
    alias gsp "git stash pop"
  4. @victorporof victorporof revised this gist Apr 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ alias gpur "git clean --force"
    # Unstage all files from the index.
    alias gr "git reset --mixed"
    # Reset to commit, leaving staged files and working tree intact.
    alias grc "git reset --soft"
    alias grs "git reset --soft"
    # Unstage all files from the index and reset uncommitted changes.
    alias gra "git reset --hard; git status --short"
    # Unstage all files, reset uncommitted changes and purge untracked files.
  5. @victorporof victorporof revised this gist Apr 17, 2016. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -83,10 +83,16 @@ alias gcm "git checkout master"
    alias gnew "git checkout -b"

    alias gm "git merge"
    alias grb "git rebase --interactive"
    alias grb "git rebase"
    alias grc "git rebase --continue"
    alias grab "git rebase --abort"

    function grbi --description "Interactive rebase branch from the base"
    set branch (git symbolic-ref --quiet HEAD | cut -d "/" -f 3)
    set base (git merge-base $branch master)
    git rebase --interactive $base
    end

    function gbd --description "Deletes a branch locally and at origin"
    git branch --delete --force $argv[1]
    git push origin --delete $argv[1]
    @@ -467,7 +473,7 @@ function __prompt_set_hg_git

    if [ $__is_git_wdir ]
    set -g __git_branch (git symbolic-ref --quiet HEAD | cut -d "/" -f 3)
    set -g __git_head (git rev-parse --short HEAD)
    set -g __git_tip_cset (git rev-parse --short HEAD)

    if not [ $__git_branch ]
    set -g __git_is_detached "(detached)"
    @@ -476,9 +482,9 @@ function __prompt_set_hg_git
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_blue $__git_branch " " $_red $__git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_blue $__git_branch " " $_red $__git_tip_cset $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_red $__git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_red $__git_tip_cset $_normal " ]"
    end
    end
    end
    @@ -498,9 +504,9 @@ function fish_prompt
    set git_status (git status --porcelain)

    if [ $__git_is_detached ]
    set untrk "[ " $_cyan $__git_head $_yellow " detached " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_head $_yellow " detached " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_head $_yellow " detached " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set untrk "[ " $_cyan $__git_tip_cset $_yellow " detached " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_tip_cset $_yellow " detached " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_tip_cset $_yellow " detached " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    else
    set untrk "[ " $_cyan $__git_branch " " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_branch " " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
  6. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -457,7 +457,7 @@ function __prompt_set_hg_git
    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_magenta $_black_bkg "hg" $_normal_bkg " on " $_blue $hg_branch " " $_red $hg_tip_cset " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_magenta $_black_bkg "hg" $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_magenta $_black_bkg "hg" $_normal_bkg " on " $_red $hg_tip_cset " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end
    end
    @@ -478,7 +478,7 @@ function __prompt_set_hg_git
    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_blue $__git_branch " " $_red $__git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " " $_cyan $__git_branch $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_red $__git_head $_normal " ]"
    end
    end
    end
  7. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -65,10 +65,10 @@ alias gsda "git stash clear"

    # Remove untracked files from the working tree.
    alias gpur "git clean --force"
    # Reset to commit, leaving staged files and working tree intact.
    alias gr "git reset --soft"
    # Unstage all files from the index.
    alias gri "git reset --mixed"
    alias gr "git reset --mixed"
    # Reset to commit, leaving staged files and working tree intact.
    alias grc "git reset --soft"
    # Unstage all files from the index and reset uncommitted changes.
    alias gra "git reset --hard; git status --short"
    # Unstage all files, reset uncommitted changes and purge untracked files.
  8. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -57,7 +57,7 @@ alias gcam "git commit --signoff --amend --message"

    alias gst "git stash save --include-untracked"
    alias gsl "git stash list"
    alias gsi "git stash show --patch"
    alias gss "git stash show --patch"
    alias gsp "git stash pop"
    alias gsa "git stash apply"
    alias gsd "git stash drop"
  9. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,8 @@ alias gsl "git stash list"
    alias gsi "git stash show --patch"
    alias gsp "git stash pop"
    alias gsa "git stash apply"
    alias gsd "git stash clear"
    alias gsd "git stash drop"
    alias gsda "git stash clear"

    # Remove untracked files from the working tree.
    alias gpur "git clean --force"
  10. @victorporof victorporof revised this gist Apr 16, 2016. No changes.
  11. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -425,7 +425,7 @@ function __prompt_set_self_addr_wdir
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __self_addr_wdir $_blue $__self $_normal " at " $_blue $__addr $_normal " in " $_bold $_green (prompt_pwd) $_normal
    set -g __self_addr_wdir $_brown $__self $_normal " at " $_green $__addr $_normal " in " $_bold $_green (prompt_pwd) $_normal
    else
    set -g __self_addr_wdir $_bold $_green (prompt_pwd) $_normal
    end
    @@ -454,9 +454,9 @@ function __prompt_set_hg_git
    set hg_mq (@ $hg_qseries | grep -o " [AU] " | wc -l | tr -d " ")

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_red $_black_bkg "hg" $_normal_bkg " on " $_brown $hg_branch " " $_green $hg_tip_cset " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_magenta $_black_bkg "hg" $_normal_bkg " on " $_blue $hg_branch " " $_red $hg_tip_cset " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_red $_black_bkg "hg" $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_magenta $_black_bkg "hg" $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end
    end
    @@ -475,9 +475,9 @@ function __prompt_set_hg_git
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_normal_bkg " on " $_brown $__git_branch " " $_green $__git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " on " $_blue $__git_branch " " $_red $__git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_normal_bkg " " $_cyan $__git_branch $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_magenta $_black_bkg "git" $_normal_bkg " " $_cyan $__git_branch $_normal " ]"
    end
    end
    end
  12. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(normal bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"

  13. @victorporof victorporof revised this gist Apr 16, 2016. No changes.
  14. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ set DOWNLOADS $HOME/Downloads
    alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)"
    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"
  15. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow) %s%n%n %C(reset)%b%C(reset)%n"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow bold) %s%n%n %C(normal dim)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"

  16. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ set DOWNLOADS $HOME/Downloads
    alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green dim)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow) %s%n%n %C(reset)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"
  17. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -40,8 +40,8 @@ alias gs "git status --short"
    alias gd "git diff"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green dim)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "* %C(yellow)commit %C(red)%H%C(auto)%d%n%C(red)| %C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(red)| %C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%C(red)| %n%C(red)| %C(reset) %s%n%C(red)| %n%C(red)| %C(white dim)%b%C(reset)"
    alias glg "git log --stat --max-count=1 --pretty=format:'$pretty_full'"
    set pretty_full "%C(yellow)commit %C(red)%H%C(auto)%d%n%C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%n%C(yellow) %s%n%n %C(reset)%b%C(reset)%n"
    alias glg "git log --graph --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"

    alias gl "git pull --rebase"
  18. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,11 @@ set DOWNLOADS $HOME/Downloads

    alias gs "git status --short"
    alias gd "git diff"
    alias glg "git log --graph --decorate --stat --max-count=1"
    alias glgg "git log --graph --decorate --max-count=20"

    set pretty_oneline "%C(red)%h%C(auto)%d%C(reset) %s %C(green dim)(%cr) %C(blue dim)<%an>%C(reset)"
    set pretty_full "* %C(yellow)commit %C(red)%H%C(auto)%d%n%C(red)| %C(reset)Author: %C(blue)%an %C(blue dim)<%ae>%n%C(red)| %C(reset)Date: %C(green)%ad %C(green dim)(%cr)%n%C(red)| %n%C(red)| %C(reset) %s%n%C(red)| %n%C(red)| %C(white dim)%b%C(reset)"
    alias glg "git log --stat --max-count=1 --pretty=format:'$pretty_full'"
    alias glgg "git log --graph --max-count=20 --pretty=format:'$pretty_oneline'"

    alias gl "git pull --rebase"
    alias glup "git pull upstream master --rebase"
  19. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -109,7 +109,7 @@ alias hgpf "hg push --force"
    alias hga "hg add"
    alias hgar "hg addremove"
    alias hgc "hg commit"
    alias hgcm "hg qimport --rev tip; hg qrefresh --edit; hg qfinish tip"
    alias hgca "hg qimport --rev tip; hg qrefresh --edit; hg qfinish tip"

    # Remove untracked files from the working tree.
    alias hgpur "hg purge"
  20. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -49,8 +49,8 @@ alias gpf "git push --force"

    alias ga "git add"
    alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gcmm "git commit --signoff --amend --message"
    alias gca "git commit --signoff --amend --no-edit"
    alias gcam "git commit --signoff --amend --message"

    alias gst "git stash save --include-untracked"
    alias gsl "git stash list"
    @@ -75,7 +75,7 @@ alias grapp "git reset --hard; git clean --force; git checkout master; git statu
    alias gb "git branch"
    alias gba "git branch --all"
    alias gco "git checkout"
    alias gcom "git checkout master"
    alias gcm "git checkout master"
    alias gnew "git checkout -b"

    alias gm "git merge"
  21. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ set DOWNLOADS $HOME/Downloads

    # Git

    alias gs "git status --short --branch"
    alias gs "git status --short"
    alias gd "git diff"
    alias glg "git log --graph --decorate --stat --max-count=1"
    alias glgg "git log --graph --decorate --max-count=20"
  22. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,8 @@ set DOWNLOADS $HOME/Downloads

    alias gs "git status --short --branch"
    alias gd "git diff"
    alias glg "git log --decorate --stat --max-count=1"
    alias glgg "git log --decorate --graph --max-count=20"
    alias glg "git log --graph --decorate --stat --max-count=1"
    alias glgg "git log --graph --decorate --max-count=20"

    alias gl "git pull --rebase"
    alias glup "git pull upstream master --rebase"
  23. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,8 @@ set DOWNLOADS $HOME/Downloads

    alias gs "git status --short --branch"
    alias gd "git diff"
    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=20"
    alias glg "git log --decorate --stat --max-count=1"
    alias glgg "git log --decorate --graph --max-count=20"

    alias gl "git pull --rebase"
    alias glup "git pull upstream master --rebase"
    @@ -52,7 +52,7 @@ alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gcmm "git commit --signoff --amend --message"

    alias gs "git stash save --include-untracked"
    alias gst "git stash save --include-untracked"
    alias gsl "git stash list"
    alias gsi "git stash show --patch"
    alias gsp "git stash pop"
    @@ -532,3 +532,5 @@ function fish_right_prompt
    @ " " $__git_repo_info
    end
    end

    test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish
  24. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -88,10 +88,7 @@ function gbd --description "Deletes a branch locally and at origin"
    git push origin --delete $argv[1]
    end

    function gmerge --description "Merge a pull request"
    set branch "TEMP_MERGE_BRANCH"
    set url $argv[1]

    function gmpr --description "Merge a pull request"
    # TODO
    end

  25. @victorporof victorporof revised this gist Apr 16, 2016. 1 changed file with 58 additions and 27 deletions.
    85 changes: 58 additions & 27 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -37,42 +37,72 @@ set DOWNLOADS $HOME/Downloads
    # Git

    alias gs "git status --short --branch"
    alias gd "git diff"
    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=20"

    alias gl "git pull --rebase"
    alias glum "git pull upstream master --rebase"
    alias glup "git pull upstream master --rebase"

    alias gp "git push"
    alias gpf "git push --force"

    alias ga "git add"
    alias gm "git merge"
    alias gd "git diff"

    alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gco "git checkout"
    alias gnew "git checkout -b"

    alias gb "git branch"
    alias gba "git branch --all"
    alias gbd "git branch --delete --force"
    alias gbdo "git push origin --delete"
    alias gcmm "git commit --signoff --amend --message"

    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=20"
    alias gs "git stash save --include-untracked"
    alias gsl "git stash list"
    alias gsi "git stash show --patch"
    alias gsp "git stash pop"
    alias gsa "git stash apply"
    alias gsd "git stash clear"

    # Remove untracked files from the working tree.
    alias gpur "git clean --force"
    alias gra "git reset; git status --short"
    alias grap "git reset --hard; git status --short; git clean --force"
    alias grapp "git reset --hard; git status --short; git clean --force; git checkout master"
    # Reset to commit, leaving staged files and working tree intact.
    alias gr "git reset --soft"
    # Unstage all files from the index.
    alias gri "git reset --mixed"
    # Unstage all files from the index and reset uncommitted changes.
    alias gra "git reset --hard; git status --short"
    # Unstage all files, reset uncommitted changes and purge untracked files.
    alias grap "git reset --hard; git clean --force; git status --short"
    # Unstage all files, reset uncommitted changes, purge untracked files and checkout to master.
    alias grapp "git reset --hard; git clean --force; git checkout master; git status --short"

    alias grab "git rebase --abort"
    alias gb "git branch"
    alias gba "git branch --all"
    alias gco "git checkout"
    alias gcom "git checkout master"
    alias gnew "git checkout -b"

    alias gm "git merge"
    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"
    alias grab "git rebase --abort"

    function gbd --description "Deletes a branch locally and at origin"
    git branch --delete --force $argv[1]
    git push origin --delete $argv[1]
    end

    function gmerge --description "Merge a pull request"
    set branch "TEMP_MERGE_BRANCH"
    set url $argv[1]

    # TODO
    end

    # Mercurial

    alias hgs "hg status"
    alias hgsq "hg status -m -a -r -d"
    alias hgd "hg diff"
    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 20"

    alias hgu "hg update"
    alias hgl "hg pull --update"

    @@ -81,24 +111,25 @@ alias hgpf "hg push --force"

    alias hga "hg add"
    alias hgar "hg addremove"
    alias hgm "hg merge"
    alias hgd "hg diff"

    alias hgc "hg commit"
    alias hgcm "hg qimport --rev tip; hg qrefresh --edit; hg qfinish tip"
    alias hgco "hg checkout"

    alias hgb "hg branch"
    alias hgba "hg branches"

    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 20"

    # Remove untracked files from the working tree.
    alias hgpur "hg purge"
    # Reset uncommitted changes.
    alias hgra "hg revert --all"
    # Reset uncommitted changes and purge untracked files.
    alias hgrap "hg revert --all; hg purge"
    # Reset uncommitted changes, purge untracked files and pop all the queue.
    alias hgrapp "hg revert --all; hg purge; hg qpop --all"

    alias hgb "hg branch"
    alias hgba "hg branches"
    alias hgco "hg checkout"

    alias hgm "hg merge"
    alias hgrb "hg rebase"

    # Mercurial queues

    alias qnew "hg qnew --force"
  26. @victorporof victorporof revised this gist Apr 15, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,7 @@ alias gra "git reset; git status --short"
    alias grap "git reset --hard; git status --short; git clean --force"
    alias grapp "git reset --hard; git status --short; git clean --force; git checkout master"

    alias grab "git rebase --abort"
    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"

  27. @victorporof victorporof revised this gist Apr 15, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,6 @@ alias gp "git push"
    alias gpf "git push --force"

    alias ga "git add"
    alias gr "git reset"
    alias gm "git merge"
    alias gd "git diff"

    @@ -214,7 +213,6 @@ end
    function sman --description "Open a man page in Sublime Text"
    man $argv[1] | col -b | subl
    end
    end

    function sman --description "Open a man page in Atom"
    man $argv[1] | col -b | atom
  28. @victorporof victorporof revised this gist Apr 14, 2016. 1 changed file with 187 additions and 188 deletions.
    375 changes: 187 additions & 188 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,7 @@
    clear

    set -x NODE_PATH /usr/local/lib/node_modules
    set -x ADT_BUNDLE /Applications/adt-bundle-mac-x86_64-20131030
    set -x EMSCRIPTEN_BUNDLE /Users/victorporof/Work/Mozilla/emscripten
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH $ADT_BUNDLE/sdk/tools $ADT_BUNDLE/sdk/platform-tools $EMSCRIPTEN_BUNDLE
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH
    set -e fish_greeting

    alias @ "printf '%s'"
    @@ -30,6 +28,158 @@ set _normal_bkg (set_color --background normal)
    set _bold (set_color --bold)
    set _underline (set_color --underline)

    # Directories

    set DESKTOP $HOME/Desktop
    set DROPBOX $HOME/Dropbox
    set DOWNLOADS $HOME/Downloads

    # Git

    alias gs "git status --short --branch"
    alias gl "git pull --rebase"
    alias glum "git pull upstream master --rebase"

    alias gp "git push"
    alias gpf "git push --force"

    alias ga "git add"
    alias gr "git reset"
    alias gm "git merge"
    alias gd "git diff"

    alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gco "git checkout"
    alias gnew "git checkout -b"

    alias gb "git branch"
    alias gba "git branch --all"
    alias gbd "git branch --delete --force"
    alias gbdo "git push origin --delete"

    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=20"

    alias gpur "git clean --force"
    alias gra "git reset; git status --short"
    alias grap "git reset --hard; git status --short; git clean --force"
    alias grapp "git reset --hard; git status --short; git clean --force; git checkout master"

    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"

    # Mercurial

    alias hgs "hg status"
    alias hgsq "hg status -m -a -r -d"
    alias hgu "hg update"
    alias hgl "hg pull --update"

    alias hgp "hg push"
    alias hgpf "hg push --force"

    alias hga "hg add"
    alias hgar "hg addremove"
    alias hgm "hg merge"
    alias hgd "hg diff"

    alias hgc "hg commit"
    alias hgcm "hg qimport --rev tip; hg qrefresh --edit; hg qfinish tip"
    alias hgco "hg checkout"

    alias hgb "hg branch"
    alias hgba "hg branches"

    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 20"

    alias hgpur "hg purge"
    alias hgra "hg revert --all"
    alias hgrap "hg revert --all; hg purge"
    alias hgrapp "hg revert --all; hg purge; hg qpop --all"

    # Mercurial queues

    alias qnew "hg qnew --force"
    alias qimp "hg qimport"
    alias qfol "hg qfold"
    alias qfin "hg qfinish --applied"
    alias qrm "hg qremove"
    alias qrn "hg qrename"
    alias qref "hg diff; hg qref"
    alias qrefm "hg qref --message"
    alias qrefe "hg qref --edit"
    alias qrefu "hg qref --user"
    alias qpu "hg qpush"
    alias qpm "hg qpush --move"
    alias qpo "hg phase --force --draft qbase:tip; hg qpop"
    alias qpa "hg phase --force --draft qbase:tip; hg qpop --all"
    alias qgo "hg qgoto"
    alias qcref "hg qcrefresh"
    alias qdiff "hg qdiff"
    alias qser "hg qseries --summary --verbose"
    alias qa "hg qa --summary --verbose"
    alias qu "hg qu --summary --verbose"

    function qexp --description "Export the current qtip as a patch on the desktop"
    hgg
    set qtip (hg qa | tail -1)
    if [ $qtip ]
    set file $DESKTOP/$qtip
    hg export qtip > $file
    ls -lah $file | awk '{ print $5 }'
    end
    end

    function hgqpl --description "Pop all the queue, pull, update and restore queue"
    if [ (: hgsq) ]
    hgs
    return
    end

    set qtip (hg qa | tail -1)
    if [ $qtip ]
    qpa
    end

    hgl
    hg pushlogsync
    hggg

    if [ $qtip ]
    qpu $qtip
    end
    end

    function hgback --description "Perform a mercurial backout without a merge"
    if [ (count $argv) = 0 ]
    set tip (hg tip --template "{rev}")
    hgback $tip
    return
    end

    if [ (count $argv) = 1 ]
    set cset $argv[1]
    set parent (hg parent --rev $cset --template "{rev}")
    hgback $cset $parent
    return
    end

    set newest $argv[1]
    set oldest $argv[2]
    set file "backout-$newest.patch"

    hgd --rev $newest:$oldest > $file
    qimp --force --push $file

    set node (hg log --rev $newest --template "{node|short}")
    qrefm "Backed out changeset $node"
    hgg

    rm $file
    end

    # Utility functions

    function :ip --description "What is my IP?"
    @@ -40,7 +190,7 @@ function ftp --description "Start a ftp server"
    sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
    end

    function ftpstop --description "Start a ftp server"
    function ftpstop --description "Stop a ftp server"
    sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
    end

    @@ -53,7 +203,7 @@ function sser --description "Starts a SimpleHTTPServer in the current directory"
    python -m SimpleHTTPServer $argv[1]
    end

    function sserutf8
    function sser_utf8 --description "Starts a SimpleHTTPServer in the current directory serving utf-8 encoded files"
    python -c "import SimpleHTTPServer; m = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map; m[''] = 'text/plain'; m.update(dict([(k, v + ';charset=UTF-8') for k, v in m.items()])); SimpleHTTPServer.test();"
    end

    @@ -64,6 +214,11 @@ end
    function sman --description "Open a man page in Sublime Text"
    man $argv[1] | col -b | subl
    end
    end

    function sman --description "Open a man page in Atom"
    man $argv[1] | col -b | atom
    end

    function :mem --description "Quickly check what is eating all your memory"
    top -o vsize
    @@ -73,52 +228,42 @@ function :cpu --description "Quickly check what is eating all your cpu"
    top -o cpu
    end

    function jsrun --description "Compiles ES6 code into ES3 and runs it"
    set out out.js
    traceur --script $argv[1] --out $out --block-binding true
    node $out
    end

    function : --description "Checks if a statement executes cleanly, and prints the result if so"
    @ (eval $argv ^/dev/null)
    end

    set DESKTOP $HOME/Desktop
    set DROPBOX $HOME/Dropbox
    set DOWNLOADS $HOME/Downloads

    # Firefox dev

    set MOZCONFIG $HOME/.mozconfig-firefox
    set CCACHE_DIR $HOME/.ccache

    set HG_FX ssh://hg.mozilla.org/integration/fx-team
    set HG_MI ssh://hg.mozilla.org/integration/mozilla-inbound
    set HG_MC ssh://hg.mozilla.org/mozilla-central
    set HG_MA ssh://hg.mozilla.org/releases/mozilla-aurora
    set HG_MB ssh://hg.mozilla.org/releases/mozilla-beta
    set HG_MR ssh://hg.mozilla.org/releases/mozilla-release
    set HG_TRY ssh://hg.mozilla.org/try

    set MOZDEV ~/Work/Mozilla
    set FXTEAM ~/Work/Mozilla/fx-team
    set GUM ~/Work/Mozilla/gum
    set M_INBOUND ~/Work/Mozilla/mozilla-inbound
    set M_CENTRAL ~/Work/Mozilla/mozilla-central
    set M_AURORA ~/Work/Mozilla/mozilla-aurora
    set M_BETA ~/Work/Mozilla/mozilla-beta
    set M_RELEASE ~/Work/Mozilla/mozilla-release
    set TOFINO ~/Work/Mozilla/tofino

    alias mozdev "cd $MOZDEV"
    alias fxteam "cd $FXTEAM"
    alias m-gum "cd $GUM"
    alias m-inbound "cd $M_INBOUND"
    alias m-central "cd $M_CENTRAL"
    alias m-aurora "cd $M_AURORA"
    alias m-beta "cd $M_BETA"
    alias m-release "cd $M_RELEASE"
    alias tofino "cd $TOFINO"
    set HG_FX ssh://hg.mozilla.org/integration/fx-team
    set HG_MI ssh://hg.mozilla.org/integration/mozilla-inbound
    set HG_MC ssh://hg.mozilla.org/mozilla-central
    set HG_MA ssh://hg.mozilla.org/releases/mozilla-aurora
    set HG_MB ssh://hg.mozilla.org/releases/mozilla-beta
    set HG_MR ssh://hg.mozilla.org/releases/mozilla-release
    set HG_TRY ssh://hg.mozilla.org/try

    set MOZDEV ~/Work/Mozilla
    set FXTEAM ~/Work/Mozilla/fx-team
    set GUM ~/Work/Mozilla/gum
    set M_INBOUND ~/Work/Mozilla/mozilla-inbound
    set M_CENTRAL ~/Work/Mozilla/mozilla-central
    set M_AURORA ~/Work/Mozilla/mozilla-aurora
    set M_BETA ~/Work/Mozilla/mozilla-beta
    set M_RELEASE ~/Work/Mozilla/mozilla-release
    set TOFINO ~/Work/Mozilla/tofino

    alias mozdev "cd $MOZDEV"
    alias fxteam "cd $FXTEAM"
    alias m-gum "cd $GUM"
    alias m-inbound "cd $M_INBOUND"
    alias m-central "cd $M_CENTRAL"
    alias m-aurora "cd $M_AURORA"
    alias m-beta "cd $M_BETA"
    alias m-release "cd $M_RELEASE"
    alias tofino "cd $TOFINO"

    function fxbuild --description "Build firefox from source"
    set -gx MOZCONFIG $MOZCONFIG
    @@ -237,152 +382,6 @@ function fxtry --description "Pushes to try"
    qrm _
    end

    # Git

    alias gs "git status --short --branch"
    alias gl "git pull --rebase"
    alias glum "git pull upstream master --rebase"

    alias gp "git push"
    alias gpf "git push --force"

    alias ga "git add"
    alias gr "git reset"
    alias gm "git merge"
    alias gd "git diff"

    alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gco "git checkout"
    alias gnew "git checkout -b"

    alias gb "git branch"
    alias gba "git branch --all"
    alias gbd "git branch --delete --force"
    alias gbdo "git push origin --delete"

    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=20"

    alias gpur "git clean --force"
    alias gra "git reset; git status --short"
    alias grap "git reset --hard; git status --short; git clean --force"
    alias grapp "git reset --hard; git status --short; git clean --force; git checkout master"

    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"

    # Mercurial

    alias hgs "hg status"
    alias hgsq "hg status -m -a -r -d"
    alias hgu "hg update"
    alias hgl "hg pull --update"

    alias hgp "hg push"
    alias hgpf "hg push --force"

    alias hga "hg add"
    alias hgar "hg addremove"
    alias hgm "hg merge"
    alias hgd "hg diff"

    alias hgc "hg commit"
    alias hgcm "hg qimport --rev tip; hg qrefresh --edit; hg qfinish tip"
    alias hgco "hg checkout"

    alias hgb "hg branch"
    alias hgba "hg branches"

    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 20"

    alias hgpur "hg purge"
    alias hgra "hg revert --all"
    alias hgrap "hg revert --all; hg purge"
    alias hgrapp "hg revert --all; hg purge; hg qpop --all"

    # Mercurial queues

    alias qnew "hg qnew --force"
    alias qimp "hg qimport"
    alias qfol "hg qfold"
    alias qfin "hg qfinish --applied"
    alias qrm "hg qremove"
    alias qrn "hg qrename"
    alias qref "hg diff; hg qref"
    alias qrefm "hg qref --message"
    alias qrefe "hg qref --edit"
    alias qrefu "hg qref --user"
    alias qpu "hg qpush"
    alias qpm "hg qpush --move"
    alias qpo "hg phase --force --draft qbase:tip; hg qpop"
    alias qpa "hg phase --force --draft qbase:tip; hg qpop --all"
    alias qgo "hg qgoto"
    alias qcref "hg qcrefresh"
    alias qdiff "hg qdiff"
    alias qser "hg qseries --summary --verbose"
    alias qa "hg qa --summary --verbose"
    alias qu "hg qu --summary --verbose"

    function qexp --description "Export the current qtip as a patch on the desktop"
    hgg
    set qtip (hg qa | tail -1)
    if [ $qtip ]
    set file $DESKTOP/$qtip
    hg export qtip > $file
    ls -lah $file | awk '{ print $5 }'
    end
    end

    function hgqpl --description "Pop all the queue, pull, update and restore queue"
    if [ (: hgsq) ]
    hgs
    return
    end

    set qtip (hg qa | tail -1)
    if [ $qtip ]
    qpa
    end

    hgl
    hg pushlogsync
    hggg

    if [ $qtip ]
    qpu $qtip
    end
    end

    function hgback --description "Perform a mercurial backout without a merge"
    if [ (count $argv) = 0 ]
    set tip (hg tip --template "{rev}")
    hgback $tip
    return
    end

    if [ (count $argv) = 1 ]
    set cset $argv[1]
    set parent (hg parent --rev $cset --template "{rev}")
    hgback $cset $parent
    return
    end

    set newest $argv[1]
    set oldest $argv[2]
    set file "backout-$newest.patch"

    hgd --rev $newest:$oldest > $file
    qimp --force --push $file

    set node (hg log --rev $newest --template "{node|short}")
    qrefm "Backed out changeset $node"
    hgg

    rm $file
    end

    # Shell prompt

    set -g RESPONSIVE_PROMPT_COLUMNS 110
  29. @victorporof victorporof revised this gist Apr 14, 2016. 1 changed file with 39 additions and 38 deletions.
    77 changes: 39 additions & 38 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,35 @@
    # Fish 2.0 config

    # Enviroment setup

    clear

    set -x NODE_PATH /usr/local/lib/node_modules
    set -x ADT_BUNDLE /Applications/adt-bundle-mac-x86_64-20131030
    set -x EMSCRIPTEN_BUNDLE /Users/victorporof/Work/Mozilla/emscripten
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH $ADT_BUNDLE/sdk/tools $ADT_BUNDLE/sdk/platform-tools $EMSCRIPTEN_BUNDLE
    set -e fish_greeting

    alias @ "printf '%s'"
    alias @@ "xargs printf '%s'"
    alias @% "xargs printf"

    set _black (set_color black)
    set _black_bkg (set_color --background black)
    set _green (set_color green)
    set _brown (set_color brown)
    set _yellow (set_color yellow)
    set _blue (set_color blue)
    set _magenta (set_color magenta)
    set _purple (set_color purple)
    set _red (set_color red)
    set _cyan (set_color cyan)
    set _white (set_color white)
    set _normal (set_color normal)
    set _normal_bkg (set_color --background normal)
    set _bold (set_color --bold)
    set _underline (set_color --underline)

    # Utility functions

    function :ip --description "What is my IP?"
    @@ -53,37 +83,6 @@ function : --description "Checks if a statement executes cleanly, and prints the
    @ (eval $argv ^/dev/null)
    end

    # Enviroment setup

    clear

    set -x SB_SERVER_PATH /Users/victorporof/Library/Application\ Support/Steam/steamapps/common/Starbound/giraffe_storage
    set -x NODE_PATH /usr/local/lib/node_modules
    set -x ADT_BUNDLE /Applications/adt-bundle-mac-x86_64-20131030
    set -x EMSCRIPTEN_BUNDLE /Users/victorporof/Work/Mozilla/emscripten
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH $ADT_BUNDLE/sdk/tools $ADT_BUNDLE/sdk/platform-tools $EMSCRIPTEN_BUNDLE
    set -e fish_greeting

    alias @ "printf '%s'"
    alias @@ "xargs printf '%s'"
    alias @% "xargs printf"

    set _black (set_color black)
    set _black_bkg (set_color --background black)
    set _green (set_color green)
    set _brown (set_color brown)
    set _yellow (set_color yellow)
    set _blue (set_color blue)
    set _magenta (set_color magenta)
    set _purple (set_color purple)
    set _red (set_color red)
    set _cyan (set_color cyan)
    set _white (set_color white)
    set _normal (set_color normal)
    set _normal_bkg (set_color --background normal)
    set _bold (set_color --bold)
    set _underline (set_color --underline)

    set DESKTOP $HOME/Desktop
    set DROPBOX $HOME/Dropbox
    set DOWNLOADS $HOME/Downloads
    @@ -259,16 +258,16 @@ alias gnew "git checkout -b"

    alias gb "git branch"
    alias gba "git branch --all"
    alias gbr "git branch --delete --force"
    alias gbro "git push origin --delete"
    alias gbd "git branch --delete --force"
    alias gbdo "git push origin --delete"

    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=10"
    alias glgg "git log --graph --max-count=20"

    alias gpur "git clean --force"
    alias gra "git reset; git status --short"
    alias grap "git reset; git status --short; git clean --force"
    alias grapp "git reset; git status --short; git clean --force; git checkout master"
    alias grap "git reset --hard; git status --short; git clean --force"
    alias grapp "git reset --hard; git status --short; git clean --force; git checkout master"

    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"
    @@ -296,7 +295,7 @@ alias hgb "hg branch"
    alias hgba "hg branches"

    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 10"
    alias hggg "hg log --graph --limit 20"

    alias hgpur "hg purge"
    alias hgra "hg revert --all"
    @@ -442,6 +441,8 @@ function __prompt_set_hg_git

    if not [ $__git_branch ]
    set -g __git_is_detached "(detached)"
    else
    set -e __git_is_detached
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    @@ -466,7 +467,7 @@ function fish_prompt
    else if [ $__is_git_wdir ]
    set git_status (git status --porcelain)

    if [ __git_is_detached ]
    if [ $__git_is_detached ]
    set untrk "[ " $_cyan $__git_head $_yellow " detached " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_head $_yellow " detached " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_head $_yellow " detached " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
  30. @victorporof victorporof revised this gist Apr 13, 2016. 1 changed file with 27 additions and 10 deletions.
    37 changes: 27 additions & 10 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -248,25 +248,31 @@ alias gp "git push"
    alias gpf "git push --force"

    alias ga "git add"
    alias gr "git reset"
    alias gm "git merge"
    alias gd "git diff"

    alias gc "git commit --signoff"
    alias gcm "git commit --signoff --amend"
    alias gc "git commit --signoff --message"
    alias gcm "git commit --signoff --amend --no-edit"
    alias gco "git checkout"
    alias gnew "git checkout -b"

    alias gb "git branch"
    alias gba "git branch --all"
    alias gbr "git branch --delete --force"
    alias gbro "git push origin --delete"

    alias glg "git log --stat --max-count=1"
    alias glgg "git log --graph --max-count=10 --follow"
    alias glgg "git log --graph --max-count=10"

    alias gpur "git clean --force"
    alias gra "git reset; git status --short"
    alias grap "git reset; git status --short; git clean --force"
    alias grapp "git reset; git status --short; git clean --force; git checkout master"

    alias grb "git rebase --interactive"
    alias grc "git rebase --continue"

    # Mercurial

    alias hgs "hg status"
    @@ -290,7 +296,7 @@ alias hgb "hg branch"
    alias hgba "hg branches"

    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggg "hg log --graph --limit 10 --follow"
    alias hggg "hg log --graph --limit 10"

    alias hgpur "hg purge"
    alias hgra "hg revert --all"
    @@ -431,11 +437,15 @@ function __prompt_set_hg_git
    set -g __is_git_wdir (: git rev-parse --show-toplevel)

    if [ $__is_git_wdir ]
    set -g __git_branch (git symbolic-ref HEAD | cut -d "/" -f 3)
    set git_head (git rev-parse --short HEAD)
    set -g __git_branch (git symbolic-ref --quiet HEAD | cut -d "/" -f 3)
    set -g __git_head (git rev-parse --short HEAD)

    if not [ $__git_branch ]
    set -g __git_is_detached "(detached)"
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_normal_bkg " on " $_brown $__git_branch " " $_green $git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_normal_bkg " on " $_brown $__git_branch " " $_green $__git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_normal_bkg " " $_cyan $__git_branch $_normal " ]"
    end
    @@ -455,9 +465,16 @@ function fish_prompt
    end
    else if [ $__is_git_wdir ]
    set git_status (git status --porcelain)
    set untrk "[ " $_cyan $__git_branch " " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_branch " " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_branch " " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal

    if [ __git_is_detached ]
    set untrk "[ " $_cyan $__git_head $_yellow " detached " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_head $_yellow " detached " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_head $_yellow " detached " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    else
    set untrk "[ " $_cyan $__git_branch " " $_yellow $_bold "?" $_normal " ] " $_blue $_bold "λ " $_normal
    set dirty "[ " $_cyan $__git_branch " " $_red $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    set clean "[ " $_cyan $__git_branch " " $_green $_bold "" $_normal " ] " $_blue $_bold "λ " $_normal
    end

    if [ (@ $git_status | grep -c "?? ") -gt 0 ]
    @ $untrk