Skip to content

Instantly share code, notes, and snippets.

@ihower
Created February 16, 2017 05:14
Show Gist options
  • Select an option

  • Save ihower/7c003373fa8db8fc8ee8a55a48a4b537 to your computer and use it in GitHub Desktop.

Select an option

Save ihower/7c003373fa8db8fc8ee8a55a48a4b537 to your computer and use it in GitHub Desktop.

Revisions

  1. ihower created this gist Feb 16, 2017.
    39 changes: 39 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # https://github.com/mrzool/bash-sensible
    source ~/.sensible.bash

    alias stree='/Applications/SourceTree.app/Contents/Resources/stree'

    alias x="exit"
    alias c="clear"

    export LC_ALL=en_US.UTF-8
    export LC_CTYPE=en_US.UTF-8
    export LANG=en-US

    export EDITOR="atom"

    function parse_git_dirty {
    if [[ $(git status 2> /dev/null | tail -n1) == "nothing to commit, working tree clean" ]]; then
    echo "βœ” "
    else
    echo "✘ "
    fi
    }

    function git_branch {
    ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
    echo "("$(parse_git_dirty)${ref#refs/heads/}")";
    }

    function ruby_version {
    # echo "$(rbenv version | sed -e 's/ .*//')";
    echo "$(~/.rvm/bin/rvm-prompt)"
    }
    # with ruby_version πŸš€
    PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\\[\033[0m\]\[\033[0;33m\]\$(ruby_version)\[\033[0m\]πŸ˜† "

    #PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\\[\033[0m\]πŸ˜† "

    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*