Skip to content

Commit

Permalink
Initial dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
eriwen committed Feb 26, 2012
0 parents commit 3e6f7b3
Show file tree
Hide file tree
Showing 21 changed files with 470 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .aliases
@@ -0,0 +1,57 @@
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ........='cd ../../../../../../..'
alias .........='cd ../../../../../../../..'

# Shortcuts
alias a='ant'
alias c='cd'
alias e='ps -ef | grep'
alias f='find . \! -path "*.git*"'
alias h='history'
alias l='ls --color=auto -F'
alias p='pushd'
alias o='popd'
alias ql='qlmanage -p 2>/dev/null'

# Git aliases
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'
alias gc='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'

# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"

# Flush Directory Service cache
alias flush="dscacheutil -flushcache"

# View HTTP traffic
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""

# OS X has no `md5sum`, so use `md5` as a fallback
type -t md5sum > /dev/null || alias md5sum="md5"

# URL-encode strings
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'

# One of @janmoesen’s ProTip™s
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
alias "$method"="lwp-request -m '$method'"
done

alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
35 changes: 35 additions & 0 deletions .bashrc
@@ -0,0 +1,35 @@
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
shopt -s histappend
shopt -s nocaseglob
shopt -s dotglob
shopt -s extglob
shopt -s cdspell

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# Set Prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[0;37m\]\u@\h\[\033[00m\]:\[\033[1;32m\]\w\[\033[00m\]\$ '

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh
26 changes: 26 additions & 0 deletions .functions
@@ -0,0 +1,26 @@
# Link first arg and move to directory given as second arg
function lmv() {
[ -e $1 -a -e $2 ] && mv $1 $2 && ln -s $2/$(basename $1) $(dirname $1)
}

# Create a new directory and enter it
function md() {
mkdir -p "$@" && cd "$@"
}

# Preview
function pman() {
man -t "${1}" | open -f -a /Applications/Preview.app
}

# Quit app the mac way
function quit() {
for app in $*; do
osascript -e 'quit app "'$app'"'
done
}

# Better man
function man() {
/usr/bin/man $@ || (help $@ 2> /dev/null && help $@ | less)
}
34 changes: 34 additions & 0 deletions .gitconfig
@@ -0,0 +1,34 @@
[alias]
br = branch
c = commit
ci = commit
co = checkout
lg = log --pretty=oneline --abbrev-commit --graph --decorate --all
pur = pull --rebase
ri = rebase --interactive --autosquash
rv = remote -v
st = status -s -u
who = shortlog -s --
[user]
name = Eric Wendelin
email = emwendelin@gmail.com
[core]
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab
editor = mate -w
quotepath = false
autocrlf = input
safecrlf = warn
[color]
ui = auto
[advice]
statusHints = false
[diff]
renames = copies
mnemonicprefix = true
[branch]
autosetupmerge = true
[push]
default = tracking
[merge]
stat = true
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
.DS_Store
Thumbs.db
Icon?
.private
35 changes: 35 additions & 0 deletions .inputrc
@@ -0,0 +1,35 @@
"\eOA": history-search-backward
"\e[A": history-search-backward
"\eOB": history-search-forward
"\e[B": history-search-forward
"\eOC": forward-char
"\e[C": forward-char
"\eOD": backward-char
"\e[D": backward-char
# Use Alt/Meta + Delete to delete the preceding word
"\e[3;3~": kill-word

# Make Tab autocomplete regardless of filename case
set completion-ignore-case on

# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
set match-hidden-files off

# Append a slash when autocompleting symbolic links to directories
set mark-symlinked-directories on

# Show all autocomplete results at once
set page-completions off

# Immediately show all possible completions
set show-all-if-ambiguous on

# If there are more than 200 possible completions for a word, ask to show them all
set completion-query-items 200

# Show extra file information when completing, like `ls -F` does
set visible-stats on

set skip-completed-text on


1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
jute:outputDir = target/
138 changes: 138 additions & 0 deletions .osx
@@ -0,0 +1,138 @@
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true

# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true

# Show remaining battery time; hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"

# Allow quitting Finder via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true

# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false

# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true

# Enable highlight hover effect for the grid view of a stack (Dock)
defaults write com.apple.dock mouse-over-hilte-stack -bool true

# Enable spring loading for all Dock items
defaults write enable-spring-load-actions-on-all-items -bool true

# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true

# Don’t animate opening applications from the Dock
defaults write com.apple.dock launchanim -bool false

# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true

# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0

# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true

# Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true

# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001

# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false

# Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true

# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false

# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"

# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4

# Disable the Ping sidebar in iTunes
defaults write com.apple.iTunes disablePingSidebar -bool true

# Disable all the other Ping stuff in iTunes
defaults write com.apple.iTunes disablePing -bool true

# Make ⌘ + F focus the search input in iTunes
defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"

# Disable send and reply animations in Mail.app
defaults write com.apple.Mail DisableReplyAnimations -bool true
defaults write com.apple.Mail DisableSendAnimations -bool true

# Disable Resume system-wide
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false

# Enable Dashboard dev mode (allows keeping widgets on the desktop)
defaults write com.apple.dashboard devmode -bool true

# Reset Launchpad
[ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db

# Show the ~/Library folder
chflags nohidden ~/Library

# Disable local Time Machine backups
hash tmutil &> /dev/null && sudo tmutil disablelocal

# Remove Dropbox’s green checkmark icons in Finder
file=/Applications/Dropbox.app/Contents/Resources/check.icns
[ -e "$file" ] && mv -f "$file" "$file.bak"
unset file

# Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo)
# Commented out, as this is known to cause problems when saving files in Adobe Illustrator CS5 :(
#echo "0x08000100:0" > ~/.CFUserTextEncoding

# Kill affected applications
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done
7 changes: 7 additions & 0 deletions .paths
@@ -0,0 +1,7 @@
export JAVA_HOME=/Library/Java/Home
export JAVAFX_HOME=/Applications/NetBeans/NetBeans\ 6.9.1.app/Contents/Resources/NetBeans/javafx2/javafx-sdk
export GRADLE_HOME=/usr/local/share/gradle
export GRAILS_HOME=/usr/local/share/grails
export GRIFFON_HOME=/usr/local/share/griffon
export NODE_PATH=/usr/local/lib/node_modules
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:.:${JAVA_HOME}/bin:${GRADLE_HOME}/bin:${JAVAFX_HOME}/bin:${GRIFFON_HOME}/bin:${GRIFFON_HOME}/ant/bin:${NODEJS_HOME}/bin:/home/eric/scripts
13 changes: 13 additions & 0 deletions .profile
@@ -0,0 +1,13 @@
# Load RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

#Set textmate as our default command line editor
export EDITOR='mate -w'

# RVM suggests using gcc instead of llvm (which Apple now symlinks gcc to)
export CC=gcc-4.2

for file in ~/.{private,vars,paths,aliases,zprofile,functions}; do
[ -r "$file" ] && source "$file"
done
unset file

0 comments on commit 3e6f7b3

Please sign in to comment.