Skip to content

Instantly share code, notes, and snippets.

@jsantell
Forked from victorporof/config.fish.sh
Created November 27, 2013 07:16

Revisions

  1. @victorporof victorporof revised this gist Nov 5, 2013. 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
    @@ -148,7 +148,7 @@ function fxtry --description "Pushes to try"
    set platf "$platf all"
    set tests "$tests all"
    else
    set platf $platf"linux,linux64,macosx64,win32,win64"
    set platf $platf"linux,linux64,linux64-asan,macosx64,win32,win64"
    if contains "none" $argv
    set tests $tests"none,";
    end
    @@ -427,3 +427,4 @@ function fish_right_prompt
    end
    set -g __prev_prompt_value $__prompt_value
    end

  2. @victorporof victorporof revised this gist Aug 31, 2013. 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
    @@ -200,7 +200,7 @@ alias hgco "hg checkout"

    alias hgb "hg branch"
    alias hgba "hg branches"
    alias hgg "hg log -r (hg parent --template \"{node}\") --stat"
    alias hgg "hg log --rev (hg parent --template \"{node}\") --stat"
    alias hggt "hg log --rev tip --stat"
    alias hgqg "hg log --rev qtip:qbase --stat"
    alias hggg "hg log --graph --limit 5"
  3. @victorporof victorporof revised this gist Aug 31, 2013. 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
    @@ -27,7 +27,7 @@ clear

    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    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 $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 $ADT_BUNDLE/sdk/tools $ADT_BUNDLE/sdk/platform-tools $EMSCRIPTEN_BUNDLE
    set -e fish_greeting

    alias @ "printf '%s'"
    @@ -171,7 +171,6 @@ function fxtry --description "Pushes to try"
    end

    qnew _ -m "try: $build $platf $tests $talos"
    hg out
    qser

    if [ (uname) = "Darwin" ]
    @@ -201,7 +200,8 @@ alias hgco "hg checkout"

    alias hgb "hg branch"
    alias hgba "hg branches"
    alias hgg "hg log --rev tip --stat"
    alias hgg "hg log -r (hg parent --template \"{node}\") --stat"
    alias hggt "hg log --rev tip --stat"
    alias hgqg "hg log --rev qtip:qbase --stat"
    alias hggg "hg log --graph --limit 5"

    @@ -350,11 +350,11 @@ function __prompt_set_hg_git
    set -g __is_hg_wdir (: hg root)

    if [ $__is_hg_wdir ]
    set hg_info (hg parent --template "{branch},{rev},{tags}")
    set hg_info (hg parent --template "{branch},{node},{tags}")
    set hg_qseries (hg qseries --verbose)

    set hg_branch (@ $hg_info | cut -d "," -f 1)
    set hg_tip_cset (@ $hg_info | cut -d "," -f 2)
    set hg_tip_cset (@ $hg_info | cut -d "," -f 2 | cut -c 1-12)
    set hg_tip_tags (@ $hg_info | cut -d "," -f 3)
    set hg_tip_tag1 (@ $hg_tip_tags | cut -d " " -f 1 | @% "%s ")
    set hg_tip_tag2 (@ $hg_tip_tags | cut -d " " -s -f 2- | @% "%s ")
  4. @victorporof victorporof revised this gist Aug 21, 2013. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -170,8 +170,9 @@ function fxtry --description "Pushes to try"
    set talos $talos"none"
    end

    qnew try -m "try: $build $platf $tests $talos"
    hg out try
    qnew _ -m "try: $build $platf $tests $talos"
    hg out
    qser

    if [ (uname) = "Darwin" ]
    say "Pushing to try."
    @@ -184,7 +185,7 @@ function fxtry --description "Pushes to try"
    end

    qpo
    qrm try
    qrm _
    end

    # Mercurial
  5. @victorporof victorporof revised this gist Aug 21, 2013. 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
    @@ -184,7 +184,7 @@ function fxtry --description "Pushes to try"
    end

    qpo
    # qrm try
    qrm try
    end

    # Mercurial
  6. @victorporof victorporof revised this gist Aug 21, 2013. 1 changed file with 39 additions and 13 deletions.
    52 changes: 39 additions & 13 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -131,20 +131,46 @@ function fxtry --description "Pushes to try"
    return
    end

    if [ $argv[1] = "all" ]
    qnew try -m "try: -b do -p all -u all -t none";
    else if [ $argv[1] = "build" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u none -t none";
    else if [ $argv[1] = "xpc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell -t none";
    else if [ $argv[1] = "bc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-bc -t none";
    else if [ $argv[1] = "mo" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-o -t none";
    else if [ $argv[1] = "bc-xpc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell,mochitest-bc -t none";
    set build "-b "
    set platf "-p "
    set tests "-u "
    set talos "-t "

    if contains "debug" $argv
    set build $build"d"
    else if contains "opt" $argv
    set build $build"o"
    else
    set build $build"do"
    end

    if contains "all" $argv
    set platf "$platf all"
    set tests "$tests all"
    else
    set platf $platf"linux,linux64,macosx64,win32,win64"
    if contains "none" $argv
    set tests $tests"none,";
    end
    if contains "bc" $argv
    set tests $tests"mochitest-bc,";
    end
    if contains "oth" $argv
    set tests $tests"mochitest-o,";
    end
    if contains "X" $argv
    set tests $tests"xpcshell,";
    end
    set tests (@ $tests | sed '$s/.$//')
    end

    if contains "talos" $argv
    set talos $talos"all"
    else
    set talos $talos"none"
    end

    qnew try -m "try: $build $platf $tests $talos"
    hg out try

    if [ (uname) = "Darwin" ]
    @@ -158,7 +184,7 @@ function fxtry --description "Pushes to try"
    end

    qpo
    qrm try
    # qrm try
    end

    # Mercurial
  7. @victorporof victorporof revised this gist Aug 7, 2013. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -23,8 +23,11 @@ end

    # Enviroment setup

    clear

    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    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 $ADT_BUNDLE/sdk/platform-tools $EMSCRIPTEN_BUNDLE
    set -e fish_greeting

    alias @ "printf '%s'"
    @@ -199,6 +202,8 @@ 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"
    @@ -337,9 +342,9 @@ function __prompt_set_hg_git
    set hg_mq_len (@ $hg_mq | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " on " $_brown $hg_branch $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_red $_black_bkg "hg" $_normal $_normal_bkg " on " $_brown $hg_branch $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_red $_black_bkg "hg" $_normal $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end
    end
    @@ -364,16 +369,16 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str $_normal $_normal " on " $_brown $git_branch $_green " " $git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_magenta $_normal_bkg $git_status_str $_normal $_normal " on " $_brown $git_branch $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str " " $_white $git_branch $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_red $_black_bkg "git" $_magenta $_normal_bkg $git_status_str " " $_white $git_branch $_normal " ]"
    end
    end
    end
    end

    function fish_prompt
    @ $_blue "λ " $_normal
    @ $_blue "👻 " $_normal
    end

    function fish_right_prompt
  8. @victorporof victorporof revised this gist Jun 30, 2013. 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
    @@ -24,7 +24,7 @@ end
    # Enviroment setup

    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -e fish_greeting

    alias @ "printf '%s'"
  9. @victorporof victorporof revised this gist Jun 30, 2013. 1 changed file with 16 additions and 3 deletions.
    19 changes: 16 additions & 3 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -11,14 +11,20 @@ function sser --description "Starts a SimpleHTTPServer in the current directory"
    python -m SimpleHTTPServer $argv[1]
    end

    function jsrun --description "Compiles ES6 code into ES3 and runs it"
    set out out.js
    traceur $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

    # Enviroment setup

    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/lib /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -e fish_greeting

    alias @ "printf '%s'"
    @@ -301,7 +307,14 @@ function __prompt_set_self_addr_wdir
    end

    function __prompt_set_hg_git
    if [ (which hg) ]
    if not set -q __has_hg
    set -g __has_hg (which hg)
    end
    if not set -q __has_git
    set -g __has_git (which git)
    end

    if [ $__has_hg ]
    set -g __is_hg_wdir (: hg root)

    if [ $__is_hg_wdir ]
    @@ -331,7 +344,7 @@ function __prompt_set_hg_git
    end
    end

    if [ (which git) ]
    if [ $__has_git ]
    set -g __is_git_wdir (: git rev-parse --show-toplevel)

    if [ $__is_git_wdir ]
  10. @victorporof victorporof revised this gist Jun 30, 2013. 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
    @@ -18,7 +18,7 @@ end
    # Enviroment setup

    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/lib /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -e fish_greeting

    alias @ "printf '%s'"
  11. @victorporof victorporof revised this gist Jun 30, 2013. 1 changed file with 50 additions and 45 deletions.
    95 changes: 50 additions & 45 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -301,55 +301,60 @@ function __prompt_set_self_addr_wdir
    end

    function __prompt_set_hg_git
    set -g __is_hg_wdir (: hg root)
    set -g __is_git_wdir (: git rev-parse --show-toplevel)

    if [ $__is_hg_wdir ]
    set hg_info (hg parent --template "{branch},{rev},{tags}")
    set hg_qseries (hg qseries --verbose)

    set hg_branch (@ $hg_info | cut -d "," -f 1)
    set hg_tip_cset (@ $hg_info | cut -d "," -f 2)
    set hg_tip_tags (@ $hg_info | cut -d "," -f 3)
    set hg_tip_tag1 (@ $hg_tip_tags | cut -d " " -f 1 | @% "%s ")
    set hg_tip_tag2 (@ $hg_tip_tags | cut -d " " -s -f 2- | @% "%s ")
    set hg_qa (@ $hg_qseries | grep -o " A " | wc -l | tr -d " ")
    set hg_mq (@ $hg_qseries | grep -o " [AU] " | wc -l | tr -d " ")

    set hg_branch_len (@ $hg_branch | wc -m)
    set hg_tip_cset_len (@ $hg_tip_cset | wc -m)
    set hg_tip_tag1_len (@ $hg_tip_tag1 | wc -m)
    set hg_tip_tag2_len (@ $hg_tip_tag2 | wc -m)
    set hg_qa_len (@ $hg_qa | wc -m)
    set hg_mq_len (@ $hg_mq | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " on " $_brown $hg_branch $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end
    if [ (which hg) ]
    set -g __is_hg_wdir (: hg root)

    if [ $__is_git_wdir ]
    set git_branch (git symbolic-ref HEAD | cut -d "/" -f 3)
    set git_head (git rev-parse --short HEAD)
    set git_status (git status --porcelain)

    if [ (@ $git_status | grep -c "?? ") -gt 0 ]
    set git_status_str "?"
    end
    if [ (@ $git_status | grep -c " [AD] ") -gt 0 ]
    set git_status_str "$git_status_str!"
    if [ $__is_hg_wdir ]
    set hg_info (hg parent --template "{branch},{rev},{tags}")
    set hg_qseries (hg qseries --verbose)

    set hg_branch (@ $hg_info | cut -d "," -f 1)
    set hg_tip_cset (@ $hg_info | cut -d "," -f 2)
    set hg_tip_tags (@ $hg_info | cut -d "," -f 3)
    set hg_tip_tag1 (@ $hg_tip_tags | cut -d " " -f 1 | @% "%s ")
    set hg_tip_tag2 (@ $hg_tip_tags | cut -d " " -s -f 2- | @% "%s ")
    set hg_qa (@ $hg_qseries | grep -o " A " | wc -l | tr -d " ")
    set hg_mq (@ $hg_qseries | grep -o " [AU] " | wc -l | tr -d " ")

    set hg_branch_len (@ $hg_branch | wc -m)
    set hg_tip_cset_len (@ $hg_tip_cset | wc -m)
    set hg_tip_tag1_len (@ $hg_tip_tag1 | wc -m)
    set hg_tip_tag2_len (@ $hg_tip_tag2 | wc -m)
    set hg_qa_len (@ $hg_qa | wc -m)
    set hg_mq_len (@ $hg_mq | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " on " $_brown $hg_branch $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end
    end

    set git_status_str_len (@ $git_status_str | wc -m)
    set git_branch_len (@ $git_branch | wc -m)
    set git_head_len (@ $git_head | wc -m)
    if [ (which git) ]
    set -g __is_git_wdir (: git rev-parse --show-toplevel)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str $_normal $_normal " on " $_brown $git_branch $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str " " $_white $git_branch $_normal " ]"
    if [ $__is_git_wdir ]
    set git_branch (git symbolic-ref HEAD | cut -d "/" -f 3)
    set git_head (git rev-parse --short HEAD)
    set git_status (git status --porcelain)

    if [ (@ $git_status | grep -c "?? ") -gt 0 ]
    set git_status_str "?"
    end
    if [ (@ $git_status | grep -c " [AD] ") -gt 0 ]
    set git_status_str "$git_status_str!"
    end

    set git_status_str_len (@ $git_status_str | wc -m)
    set git_branch_len (@ $git_branch | wc -m)
    set git_head_len (@ $git_head | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str $_normal $_normal " on " $_brown $git_branch $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str " " $_white $git_branch $_normal " ]"
    end
    end
    end
    end
  12. @victorporof victorporof revised this gist Jun 25, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -324,9 +324,9 @@ function __prompt_set_hg_git
    set hg_mq_len (@ $hg_mq | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_normal " on " $_black_bkg $_brown $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " on " $_brown $hg_branch $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg " $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_red $_bold $_black_bkg "hg" $_normal $_normal_bkg " " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end

    @@ -347,9 +347,9 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_normal " on " $_black_bkg $_brown $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str $_normal $_normal " on " $_brown $git_branch $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str " " $_white $git_branch $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_red $_bold $_black_bkg "git" $_magenta $_normal_bkg $git_status_str " " $_white $git_branch $_normal " ]"
    end
    end
    end
  13. @victorporof victorporof revised this gist Jun 24, 2013. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -25,15 +25,17 @@ alias @ "printf '%s'"
    alias @@ "xargs printf '%s'"
    alias @% "xargs printf"

    set _white (set_color white)
    set _red (set_color red)
    set _black (set_color black)
    set _black_bkg (set_color --background black)
    set _green (set_color green)
    set _blue (set_color blue)
    set _brown (set_color brown)
    set _yellow (set_color yellow)
    set _cyan (set_color cyan)
    set _blue (set_color blue)
    set _magenta (set_color magenta)
    set _black (set_color black --bold)
    set _black_bkg (set_color --background black)
    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)
    @@ -134,7 +136,7 @@ function fxtry --description "Pushes to try"
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell,mochitest-bc -t none";
    end

    hg out
    hg out try

    if [ (uname) = "Darwin" ]
    say "Pushing to try."
    @@ -292,7 +294,7 @@ function __prompt_set_self_addr_wdir
    end

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __self_addr_wdir $_blue $__self $_black " at " $_blue $__addr $_black " in " $_bold $_green (prompt_pwd) $_normal
    set -g __self_addr_wdir $_blue $__self $_normal " at " $_blue $__addr $_normal " in " $_bold $_green (prompt_pwd) $_normal
    else
    set -g __self_addr_wdir $_bold $_green (prompt_pwd) $_normal
    end
    @@ -322,7 +324,7 @@ function __prompt_set_hg_git
    set hg_mq_len (@ $hg_mq | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_black " on " $_black_bkg $_white $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_black $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_normal " on " $_black_bkg $_brown $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_normal $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    @@ -345,7 +347,7 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_normal " on " $_black_bkg $_brown $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str " " $_white $git_branch $_normal " ]"
    end
  14. @victorporof victorporof revised this gist Jun 21, 2013. 1 changed file with 28 additions and 15 deletions.
    43 changes: 28 additions & 15 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -124,10 +124,14 @@ function fxtry --description "Pushes to try"
    qnew try -m "try: -b do -p all -u all -t none";
    else if [ $argv[1] = "build" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u none -t none";
    else if [ $argv[1] = "xpc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell -t none";
    else if [ $argv[1] = "bc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-bc -t none";
    else if [ $argv[1] = "mo" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-o -t none";
    else if [ $argv[1] = "bc-xpc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell,mochitest-bc -t none";
    end

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

    @@ -223,21 +228,29 @@ end
    function hgback --description "Perform a mercurial backout without a merge"
    if [ (count $argv) = 0 ]
    set tip (hg tip --template "{rev}")
    set parent (hg parent --rev tip --template "{rev}")
    hgback $tip $parent
    else
    set base $argv[1]
    set ancestor $argv[2]
    set file "backout$base.patch"
    hgd --rev $base:$ancestor > $file
    qimp --force --push $file

    set node (hg log --rev $base --template "{node|short}")
    qrefm "Backout $node"
    hgg
    hgback $tip
    return
    end

    rm $file
    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

    # Git
  15. @victorporof victorporof revised this gist May 22, 2013. 1 changed file with 54 additions and 10 deletions.
    64 changes: 54 additions & 10 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -45,13 +45,22 @@ set DOWNLOADS $HOME/Downloads

    # Firefox dev

    set MOZDEV ~/Work/Mozilla
    set FXTEAM ~/Work/Mozilla/fx-team
    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 OBJ_DIR obj
    set MOZCONFIG $HOME/.mozconfig-firefox
    set CCACHE_DIR $HOME/.ccache

    set MOZDEV ~/Work/Mozilla
    set FXTEAM ~/Work/Mozilla/fx-team
    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 HG_MI ssh://hg.mozilla.org/integration/mozilla-inbound
    set HG_FX ssh://hg.mozilla.org/integration/fx-team
    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_TRY ssh://hg.mozilla.org/try

    alias mozdev "cd $MOZDEV"
    alias fxteam "cd $FXTEAM"
    @@ -65,13 +74,17 @@ function fxbuild --description "Build firefox from source"
    cd $argv[1]
    end

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

    if [ (uname) = "Darwin" ]
    say -v V "Build started."
    end

    ./mach build

    if [ (uname) = "Darwin" ]
    say -v V "Build finished"
    say -v V "Build finished."
    end
    end

    @@ -102,6 +115,37 @@ function fxrun --description "Open firefox from the obj/dist directory using a s
    ./mach run -P $argv[1]
    end

    function fxtry --description "Pushes to try"
    if [ (count $argv) = 0 ]
    return
    end

    if [ $argv[1] = "all" ]
    qnew try -m "try: -b do -p all -u all -t none";
    else if [ $argv[1] = "build" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u none -t none";
    else if [ $argv[1] = "bc" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-bc -t none";
    else if [ $argv[1] = "mo" ]
    qnew try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u mochitest-o -t none";
    end

    hg out

    if [ (uname) = "Darwin" ]
    say "Pushing to try."
    end

    hgpf $HG_TRY

    if [ (uname) = "Darwin" ]
    say "Done"
    end

    qpo
    qrm try
    end

    # Mercurial

    alias hgs "hg status"
  16. @victorporof victorporof revised this gist May 21, 2013. 1 changed file with 26 additions and 11 deletions.
    37 changes: 26 additions & 11 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -17,11 +17,12 @@ end

    # Enviroment setup

    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin /Applications/adt-bundle-mac/sdk/platform-tools
    set -x fish_greeting ""
    set -x ADT_BUNDLE /Applications/adt-bundle-mac
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin $ADT_BUNDLE/sdk/platform-tools
    set -e fish_greeting

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

    set _white (set_color white)
    @@ -223,6 +224,8 @@ alias grhh "git reset HEAD --hard"

    # Shell prompt

    set -g RESPONSIVE_PROMPT_COLUMNS 110

    function __prompt_set_self_addr_wdir
    if not set -q __self
    set -g __self (whoami)
    @@ -231,7 +234,11 @@ function __prompt_set_self_addr_wdir
    set -g __addr_len (@ $__addr | wc -m)
    end

    set -g __self_addr_wdir $_blue $__self $_black " at " $_blue $__addr $_black " in " $_bold $_green (prompt_pwd) $_normal
    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __self_addr_wdir $_blue $__self $_black " at " $_blue $__addr $_black " in " $_bold $_green (prompt_pwd) $_normal
    else
    set -g __self_addr_wdir $_bold $_green (prompt_pwd) $_normal
    end
    end

    function __prompt_set_hg_git
    @@ -257,7 +264,11 @@ function __prompt_set_hg_git
    set hg_qa_len (@ $hg_qa | wc -m)
    set hg_mq_len (@ $hg_mq | wc -m)

    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_black " on " $_black_bkg $_white $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_black $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_black " on " $_black_bkg $_white $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_black $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    else
    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg " $_cyan $hg_qa/$hg_mq $_normal " ]"
    end
    end

    if [ $__is_git_wdir ]
    @@ -276,12 +287,16 @@ function __prompt_set_hg_git
    set git_branch_len (@ $git_branch | wc -m)
    set git_head_len (@ $git_head | wc -m)

    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    if [ $COLUMNS -gt $RESPONSIVE_PROMPT_COLUMNS ]
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    else
    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str " " $_white $git_branch $_normal " ]"
    end
    end
    end

    function fish_prompt
    printf "%s" $_blue "λ " $_normal
    @ $_blue "λ " $_normal
    end

    function fish_right_prompt
    @@ -293,12 +308,12 @@ function fish_right_prompt
    set -g __prev_prompt_value ""
    end
    if [ $__prompt_value != $__prev_prompt_value ]
    printf "%s" $__self_addr_wdir " "
    @ $__self_addr_wdir
    if [ $__is_hg_wdir ]
    printf "%s" $__hg_repo_info
    @ " " $__hg_repo_info
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info
    @ " " $__git_repo_info
    end
    end
    set -g __prev_prompt_value $__prompt_value
  17. @victorporof victorporof revised this gist May 21, 2013. 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
    @@ -226,7 +226,7 @@ alias grhh "git reset HEAD --hard"
    function __prompt_set_self_addr_wdir
    if not set -q __self
    set -g __self (whoami)
    set -g __addr (ipconfig getifaddr en1; or ipconfig getifaddr en0)
    set -g __addr (ifconfig | grep "inet " | grep -v "127.0.0.1" | head -n 1 | tr -d "addr:" | awk '{print $2}')
    set -g __self_len (@ $__self | wc -m)
    set -g __addr_len (@ $__addr | wc -m)
    end
    @@ -277,7 +277,7 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    end
    end
    end

    function fish_prompt
  18. @victorporof victorporof revised this gist May 21, 2013. 1 changed file with 12 additions and 32 deletions.
    44 changes: 12 additions & 32 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Fish 2.0 config

    # Utility functions

    function sser --description "Starts a SimpleHTTPServer in the current directory"
    @@ -224,25 +226,18 @@ alias grhh "git reset HEAD --hard"
    function __prompt_set_self_addr_wdir
    if not set -q __self
    set -g __self (whoami)
    set -g __addr (hostname | cut -d . -f 1)
    set -g __addr (ipconfig getifaddr en1; or ipconfig getifaddr en0)
    set -g __self_len (@ $__self | wc -m)
    set -g __addr_len (@ $__addr | wc -m)
    end

    set wdir (prompt_pwd)
    set wdir_len (@ $wdir | wc -m)

    set -g __self_addr_wdir $_blue $__self $_black " at " $_green $__addr $_black " in " $_bold $_green $wdir $_normal
    set -g __self_addr_wdir_padding (math $__self_len + $__addr_len + $wdir_len + 5)
    set -g __self_addr_wdir $_blue $__self $_black " at " $_blue $__addr $_black " in " $_bold $_green (prompt_pwd) $_normal
    end

    function __prompt_set_hg_git
    set -g __is_hg_wdir (: hg root)
    set -g __is_git_wdir (: git rev-parse --show-toplevel)

    set -g __hg_padding 0
    set -g __git_padding 0

    if [ $__is_hg_wdir ]
    set hg_info (hg parent --template "{branch},{rev},{tags}")
    set hg_qseries (hg qseries --verbose)
    @@ -263,7 +258,6 @@ function __prompt_set_hg_git
    set hg_mq_len (@ $hg_mq | wc -m)

    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_black " on " $_black_bkg $_white $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_black $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_padding (math $hg_branch_len + $hg_tip_cset_len + $hg_tip_tag1_len + $hg_tip_tag2_len + $hg_qa_len + $hg_mq_len + 7)
    end

    if [ $__is_git_wdir ]
    @@ -283,43 +277,29 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    set -g __git_padding (math $git_status_str_len + $git_branch_len + $git_head_len + 9)
    end
    end
    end

    function __prompt_set_spacing
    set spacing_len (math $COLUMNS - $__self_addr_wdir_padding - $__hg_padding - $__git_padding)

    if [ $spacing_len -gt 0 ]
    set spacing (yes " " | head -n $spacing_len | tr -d '\n')
    set -g __prompt_spacing $spacing
    else
    set -e __prompt_spacing
    end
    function fish_prompt
    printf "%s" $_blue "λ " $_normal
    end

    function fish_prompt --description "Write out the prompt"
    function fish_right_prompt
    __prompt_set_self_addr_wdir
    __prompt_set_hg_git
    __prompt_set_spacing

    set prompt_value "$__self_addr_wdir $__hg_repo_info $__git_repo_info"

    set -g __prompt_value "$__self_addr_wdir $__hg_repo_info $__git_repo_info"
    if not set -q __prev_prompt_value
    set -g __prev_prompt_value ""
    end
    if [ $prompt_value != $__prev_prompt_value ]
    printf "%s" $__self_addr_wdir $__prompt_spacing

    if [ $__prompt_value != $__prev_prompt_value ]
    printf "%s" $__self_addr_wdir " "
    if [ $__is_hg_wdir ]
    printf "%s" $__hg_repo_info
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info
    end
    @
    end
    set -g __prev_prompt_value $prompt_value

    printf "%s" $_blue "λ " $_normal
    set -g __prev_prompt_value $__prompt_value
    end
  19. @victorporof victorporof revised this gist May 12, 2013. 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
    @@ -166,6 +166,7 @@ function hgqpl --description "Pop all the queue, pull, update and restore queue"
    end

    hgl
    hggg

    if [ $qtip ]
    qpu $qtip
  20. @victorporof victorporof revised this gist May 9, 2013. 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
    @@ -15,7 +15,7 @@ end

    # Enviroment setup

    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/share/npm/bin /Applications/adt-bundle-mac/sdk/platform-tools
    set -x fish_greeting ""

    alias @ "echo"
    @@ -282,7 +282,7 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    set -g __git_padding (math $git_status_str_len + $git_branch_len + $git_head_len + 8)
    set -g __git_padding (math $git_status_str_len + $git_branch_len + $git_head_len + 9)
    end
    end

  21. @victorporof victorporof revised this gist May 8, 2013. 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
    @@ -92,11 +92,11 @@ end

    function fxrun --description "Open firefox from the obj/dist directory using a specified profile"
    if [ (count $argv) = 0 ]
    fxrun Nightly.app
    fxrun development
    return
    end

    ./mach run "-no-remote -P $argv[1]"
    ./mach run -P $argv[1]
    end

    # Mercurial
  22. @victorporof victorporof revised this gist May 7, 2013. 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
    @@ -96,7 +96,7 @@ function fxrun --description "Open firefox from the obj/dist directory using a s
    return
    end

    ./mach run -no-remote -P $argv[1]
    ./mach run "-no-remote -P $argv[1]"
    end

    # Mercurial
  23. @victorporof victorporof revised this gist May 7, 2013. 1 changed file with 3 additions and 16 deletions.
    19 changes: 3 additions & 16 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -62,8 +62,8 @@ function fxbuild --description "Build firefox from source"
    cd $argv[1]
    end

    set -x MOZCONFIG "$HOME/.mozconfig-firefox"
    set -x CCACHE_DIR "$HOME/.ccache"
    set -gx MOZCONFIG "$HOME/.mozconfig-firefox"
    set -gx CCACHE_DIR "$HOME/.ccache"

    ./mach build

    @@ -93,23 +93,10 @@ end
    function fxrun --description "Open firefox from the obj/dist directory using a specified profile"
    if [ (count $argv) = 0 ]
    fxrun Nightly.app
    return
    end
    if [ (count $argv) = 1 ]
    fxrun $argv[1] development
    return
    end

    set prevDir (pwd)
    cd $OBJ_DIR/dist
    if [ (uname) = "Darwin" ]
    cd $argv[1]/Contents/MacOS
    else
    cd bin
    end

    ./firefox -no-remote -P $argv[2]
    cd $prevDir
    ./mach run -no-remote -P $argv[1]
    end

    # Mercurial
  24. @victorporof victorporof revised this gist May 7, 2013. 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
    @@ -48,6 +48,7 @@ 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 OBJ_DIR obj

    alias mozdev "cd $MOZDEV"
    alias fxteam "cd $FXTEAM"
  25. @victorporof victorporof revised this gist May 7, 2013. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -91,11 +91,24 @@ end

    function fxrun --description "Open firefox from the obj/dist directory using a specified profile"
    if [ (count $argv) = 0 ]
    fxrun development
    fxrun Nightly.app
    return
    end
    if [ (count $argv) = 1 ]
    fxrun $argv[1] development
    return
    end

    ./mach run -no-remote -P $argv[1]
    set prevDir (pwd)
    cd $OBJ_DIR/dist
    if [ (uname) = "Darwin" ]
    cd $argv[1]/Contents/MacOS
    else
    cd bin
    end

    ./firefox -no-remote -P $argv[2]
    cd $prevDir
    end

    # Mercurial
  26. @victorporof victorporof revised this gist May 7, 2013. 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
    @@ -315,8 +315,9 @@ function fish_prompt --description "Write out the prompt"
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info
    end
    @
    end
    set -g __prev_prompt_value $prompt_value

    @; printf "%s" $_blue "λ " $_normal
    printf "%s" $_blue "λ " $_normal
    end
  27. @victorporof victorporof revised this gist May 7, 2013. 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
    @@ -310,13 +310,13 @@ function fish_prompt --description "Write out the prompt"
    printf "%s" $__self_addr_wdir $__prompt_spacing

    if [ $__is_hg_wdir ]
    printf "%s" $__hg_repo_info; @
    printf "%s" $__hg_repo_info
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info; @
    printf "%s" $__git_repo_info
    end
    end
    set -g __prev_prompt_value $prompt_value

    printf "%s" $_blue "λ " $_normal
    @; printf "%s" $_blue "λ " $_normal
    end
  28. @victorporof victorporof revised this gist May 7, 2013. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -64,9 +64,11 @@ function fxbuild --description "Build firefox from source"
    set -x MOZCONFIG "$HOME/.mozconfig-firefox"
    set -x CCACHE_DIR "$HOME/.ccache"

    say -v V "Build started"
    ./mach build
    say -v V "Build finished"

    if [ (uname) = "Darwin" ]
    say -v V "Build finished"
    end
    end

    function fxclobber --description "Clobber firefox build"
    @@ -308,13 +310,13 @@ function fish_prompt --description "Write out the prompt"
    printf "%s" $__self_addr_wdir $__prompt_spacing

    if [ $__is_hg_wdir ]
    printf "%s" $__hg_repo_info
    printf "%s" $__hg_repo_info; @
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info
    printf "%s" $__git_repo_info; @
    end
    end
    set -g __prev_prompt_value $prompt_value

    @; printf "%s" $_blue "λ " $_normal
    printf "%s" $_blue "λ " $_normal
    end
  29. @victorporof victorporof revised this gist May 7, 2013. 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
    @@ -308,13 +308,13 @@ function fish_prompt --description "Write out the prompt"
    printf "%s" $__self_addr_wdir $__prompt_spacing

    if [ $__is_hg_wdir ]
    printf "%s" $__hg_repo_info; @
    printf "%s" $__hg_repo_info
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info; @
    printf "%s" $__git_repo_info
    end
    end
    set -g __prev_prompt_value $prompt_value

    printf "%s" $_blue "λ " $_normal
    @; printf "%s" $_blue "λ " $_normal
    end
  30. @victorporof victorporof revised this gist May 7, 2013. 1 changed file with 13 additions and 15 deletions.
    28 changes: 13 additions & 15 deletions config.fish.sh
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,8 @@ end
    set -x PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin
    set -x fish_greeting ""

    alias @ "echo -s"
    alias @@ "xargs echo -s"
    alias @ "echo"
    alias @@ "xargs echo"
    alias @% "xargs printf"

    set _white (set_color white)
    @@ -229,7 +229,7 @@ function __prompt_set_self_addr_wdir
    set wdir_len (@ $wdir | wc -m)

    set -g __self_addr_wdir $_blue $__self $_black " at " $_green $__addr $_black " in " $_bold $_green $wdir $_normal
    set -g __self_addr_wdir_padding (math $__self_len + $__addr_len + $wdir_len + 6)
    set -g __self_addr_wdir_padding (math $__self_len + $__addr_len + $wdir_len + 5)
    end

    function __prompt_set_hg_git
    @@ -259,7 +259,7 @@ function __prompt_set_hg_git
    set hg_mq_len (@ $hg_mq | wc -m)

    set -g __hg_repo_info $_normal "[ " $_bold $_red "hg" $_normal $_black " on " $_black_bkg $_white $hg_branch $_normal_bkg $_green " " $hg_tip_cset " " $_bold $_blue $hg_tip_tag1 $_normal $_black $hg_tip_tag2 $_cyan $hg_qa/$hg_mq $_normal " ]"
    set -g __hg_padding (math $hg_branch_len + $hg_tip_cset_len + $hg_tip_tag1_len + $hg_tip_tag2_len + $hg_qa_len + $hg_mq_len + 8)
    set -g __hg_padding (math $hg_branch_len + $hg_tip_cset_len + $hg_tip_tag1_len + $hg_tip_tag2_len + $hg_qa_len + $hg_mq_len + 7)
    end

    if [ $__is_git_wdir ]
    @@ -279,16 +279,16 @@ function __prompt_set_hg_git
    set git_head_len (@ $git_head | wc -m)

    set -g __git_repo_info $_normal "[ " $_bold $_red "git" $_magenta $git_status_str $_normal $_black " on " $_black_bkg $_white $git_branch $_normal_bkg $_green " " $git_head $_normal " ]"
    set -g __git_padding (math $git_status_str_len + $git_branch_len + $git_head_len + 10)
    set -g __git_padding (math $git_status_str_len + $git_branch_len + $git_head_len + 8)
    end
    end

    function __prompt_set_spacing
    set spacing_len (math $COLUMNS - $__self_addr_wdir_padding - $__hg_padding - $__git_padding - 1)
    set spacing_len (math $COLUMNS - $__self_addr_wdir_padding - $__hg_padding - $__git_padding)

    if [ $spacing_len -gt 0 ]
    set spacing (yes " " | head -n $spacing_len | tr -d '\n')
    set -g __prompt_spacing "-n" $spacing
    set -g __prompt_spacing $spacing
    else
    set -e __prompt_spacing
    end
    @@ -305,18 +305,16 @@ function fish_prompt --description "Write out the prompt"
    set -g __prev_prompt_value ""
    end
    if [ $prompt_value != $__prev_prompt_value ]
    @ -n $__self_addr_wdir " "
    @ $__prompt_spacing
    printf "%s" $__self_addr_wdir $__prompt_spacing

    if [ $__is_hg_wdir ]
    @ " " $__hg_repo_info
    else; if [ $__is_git_wdir ]
    @ " " $__git_repo_info
    else
    @; end
    printf "%s" $__hg_repo_info; @
    end
    if [ $__is_git_wdir ]
    printf "%s" $__git_repo_info; @
    end
    end
    set -g __prev_prompt_value $prompt_value

    @ -n $_blue "λ " $_normal
    printf "%s" $_blue "λ " $_normal
    end