Skip to content

Instantly share code, notes, and snippets.

@un33k
Forked from davemo/.gitconfig
Last active December 30, 2015 15:19
Show Gist options
  • Save un33k/7847639 to your computer and use it in GitHub Desktop.
Save un33k/7847639 to your computer and use it in GitHub Desktop.
Macbook Prefs
[alias]
co = checkout
ci = commit
st = status
br = branch
ln = log --name-status
df = diff
dc = diff --cached
lg = log -p
pl = log --pretty='format:"%h %s" --graph'
who = shortlog -s --
unstage = reset HEAD --
type = cat-file -t
dump = cat-file -p
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
last = log -1 HEAD
next = !bash -c 'git checkout $(git rev-list HEAD..master | tail -1)'
prev = checkout HEAD^1
[core]
autocrlf = input
safecrlf = false
editor = vim
excludesfile = /Users/val/.gitignore_global
[github]
user = un33k
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[user]
name = Val Neekman
email = [email protected]
[push]
default = current
# snag theme: http://noahfrederick.com/blog/2011/lion-terminal-theme-peppermint/
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
LOCAL_BIN=~/.bin
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
YELLOW="\[\033[0;33m\]"
PS_LINE=`printf -- '- %.0s' {1..200}`
function parse_git_branch {
update_terminal_cwd;
PS_GIT_BRANCH=''
PS_FILL=${PS_LINE:0:$COLUMNS}
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
PS_GIT_BRANCH="(${ref#refs/heads/}) "
}
PROMPT_COMMAND=parse_git_branch
PS_INFO="$GREEN\u@\h$RESET:$BLUE\w"
PS_GIT="$YELLOW\$PS_GIT_BRANCH"
PS_TIME="\[\033[\$((COLUMNS-10))G\] $RED[\t]"
export PS1="\${PS_FILL}\[\033[0G\]${PS_INFO} ${PS_GIT}${PS_TIME}\n${RESET}\$ "
# cd into whatever is the forefront Finder window.
cdf() { # short for cdfinder
cd "`osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)'`"
}
# Start an HTTP server from a directory, optionally specifying the port
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
}
alias e="subl"
alias be="bundle exec"
alias gg="git grep"
alias ls="ls -GFh"
alias gitflush='git branch --merged master | grep -v master | xargs git branch -d && git remote prune origin'
# HOMEBREW_GITHUB_API_TOKEN is to remove the limit on github search. git it from https://github.com/settings/applications
export HOMEBREW_GITHUB_API_TOKEN=put_your_token_here
export EDITOR=subl
export PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$LOCAL_BIN:/Applications/p4merge.app/Contents/MacOS
export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
export LINEMAN_AUTO_START=false
export LINEMAN_AUTO_WATCH=true
# Git Bash Autocomplete
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# Initialize rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
eval "$(rbenv init - --no-rehash)"
{
"auto_complete_commit_on_tab": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache",
"tmp",
"generated",
"dist"
],
"font_face": "Menlo",
"font_size": 15.0,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
120
],
"save_on_focus_lost": true,
"spell_check": true,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"show_full_path": true,
}
VERSION=1.9.3-p448
brew update
brew install rbenv ruby-build rbenv-vars readline ctags
if [ -n "${ZSH_VERSION:-}" ]; then
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc
else
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
fi
eval "$(rbenv init - --no-rehash)" # load rbenv in the current shell
CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline)" rbenv install $VERSION
rbenv global $VERSION
gem install --no-ri --no-rdoc bundler rbenv-rehash git-up hitch gem-browse gem-ctags cheat awesome_print pry
gem ctags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment