Skip to content

Instantly share code, notes, and snippets.

@wkocmann
Forked from davemo/.gitconfig
Last active August 29, 2015 14:21
Show Gist options
  • Save wkocmann/f1297c69de6317400cd6 to your computer and use it in GitHub Desktop.
Save wkocmann/f1297c69de6317400cd6 to your computer and use it in GitHub Desktop.
# 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
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 {
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}\$ "
# 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="/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe"
alias c="clear"
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'
export EDITOR=subl
[user]
name = David Mosher
email = [email protected]
[core]
autocrlf = input
safecrlf = false
editor = vim
[github]
user = davemo
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
lo = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
ln = log --name-status
type = cat-file -t
dump = cat-file -p
[color]
ui = auto
[push]
default = current
[merge]
tool = p4merge
keepBackup = false
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[branch]
autosetuprebase = always
[rerere]
enabled = true
Flippin Tables - flippin - (╯°□°)╯︵ ┻━┻
Poltergeist Debug - pdb - page.driver.debug
Ruby Debug - rdb - require 'ruby-debug'; debugger; puts "debugger should stop here"
Ruby Debug Wrapper - rdbw - require 'ruby-debug-wrapper'; debugger; 2;
squash2 - git reset --soft HEAD^ && git commit --amend -C HEAD
# 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
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'
export EDITOR=subl
export HOMEBREW_GITHUB_API_TOKEN=091ccf70ff92f60b1485e0b7dabe44121175c390
export PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/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,
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache",
"tmp",
"generated",
"dist"
],
"font_face": "Panic Sans",
"font_size": 17.0,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
120
],
"save_on_focus_lost": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"highlight_line" : true,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 4,
"wide_caret": true,
"match_brackets": true,
"match_brackets_angle": true,
"match_brackets_braces": true,
"match_brackets_content": true,
"match_brackets_square": true,
"highlight_modified_tabs": true,
"line_padding_bottom": 1,
"line_padding_top": 1,
"bold_folder_labels": true,
"indent_guide_options": ["draw_normal", "draw_active"]
}
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