commit 23177d71b5a772eb4d6fff4deaefb44cc853a21d Author: Henrik Lissner Date: Fri Mar 1 04:47:00 2013 -0500 Initial commit diff --git a/.brew b/.brew new file mode 100644 index 00000000..a8eca325 --- /dev/null +++ b/.brew @@ -0,0 +1,37 @@ +#!/bin/bash + +# Make sure we’re using the latest Homebrew +brew update + +# Upgrade any already-installed formulae +brew upgrade + +# Install GNU core utilities (those that come with OS X are outdated) +brew install coreutils +echo "Don’t forget to add $(brew --prefix coreutils)/libexec/gnubin to \$PATH." +# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed +brew install findutils +# Install Bash 4 +brew install bash + +# Install wget with IRI support +brew install wget --enable-iri + +# Install more recent versions of some OS X tools +brew tap homebrew/dupes +brew install homebrew/dupes/grep +brew tap josegonzalez/homebrew-php + +# Install everything else +brew install ack +brew install git +brew install rename +brew install tree + +# vim +brew install macvim +brew install php54 php54-imagick php54-mcrypt php54-xdebug readline +brew install node nginx ctags + +# Remove outdated versions from the cellar +brew cleanup diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 00000000..7ca2c131 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,80 @@ +[user] + name = Henrik Lissner + email = henrik@lissner.net + +[alias] + # common commands + a = add + s = status -s + c = commit + ca = commit --amend + br = branch + cl = clone + co = checkout + co- = checkout -- + + # reset commands + r = reset + r1 = reset HEAD^ --soft + r2 = reset HEAD^^ --soft + rh = reset --hard + rh1 = reset HEAD^ --hard + rh2 = reset HEAD^^ --hard + + # search commadns + f = "!git ls-files | grep -i" + grep = grep -Ii + lasttag = describe --tags --abbrev=0 + + # Diff commands + d = difftool + dl = "!git ll -1" + + # Ways to show the log + l = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate + ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat + lnc = log --pretty=format:"%h\\ %s\\ [%cn]" + lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short + ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative + le = log --oneline --decorate + + # Ignoring files the elegant way + assume = update-index --assume-unchanged + unassume = update-index --no-assume-unchanged + assumed = "!git ls-files -v | grep ^h | cut -c 3-" + unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged" + assumeall = "!git st -s | awk {'print $2'} | xargs git assume" + +[core] + excludesfile = ~/.gitignore + quotepath = false + whitespace = trailing-space + +[color] + ui = auto + +[diff] + tool = gvimdiff + +[difftool] + prompt = false + +[merge] + # Include summaries of merged commits in newly created merge commit messages + log = true + +[push] + default = simple + +[url "git@github.com:"] + insteadOf = "gh:" + pushInsteadOf = "github:" + pushInsteadOf = "git://github.com/" +[url "git://github.com/"] + insteadOf = "github:" +[url "git@gist.github.com:"] + insteadOf = "gst:" + pushInsteadOf = "gist:" + pushInsteadOf = "git://gist.github.com/" +[url "git://gist.github.com/"] + insteadOf = "gist:" diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5cf8a662 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs and databases # +###################### +*.log +*.cache + +# OS generated files # +###################### +.DS_Store? +.DS_Store +thumbs.db +Icon? +Thumbs.db + +# Code stuffs # +############## +.svn +.git +.swp +.*.swp +*~ +.tags +tags +.sass-cache +tmp diff --git a/.osx b/.osx new file mode 100644 index 00000000..0666ec94 --- /dev/null +++ b/.osx @@ -0,0 +1,84 @@ +#!/bin/bash + +# ~/.osx — http://mths.be/osx + +# Ask for the administrator password upfront +sudo -v + +# Keep-alive: update existing `sudo` time stamp until `.osx` has finished +while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + + +############################################################################### +# General UI/UX # +############################################################################### + +# Save to disk (not to iCloud) by default +defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + +# Set Help Viewer windows to non-floating mode +defaults write com.apple.helpviewer DevMode -bool true + +# Restart automatically if the computer freezes +systemsetup -setrestartfreeze on + + +############################################################################### +# Trackpad, mouse, keyboard, Bluetooth accessories, and input # +############################################################################### + +# Trackpad: enable tap to click for this user and for the login screen +defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true +defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 +defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + +# 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 + +# Use scroll gesture with the Ctrl (^) modifier key to zoom +defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true +defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144 +# Follow the keyboard focus while zoomed in +defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true + +# Disable auto-correct +defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false + + +############################################################################### +# Screen # +############################################################################### + +# Enable subpixel font rendering on non-Apple LCDs +defaults write NSGlobalDomain AppleFontSmoothing -int 2 + +# Enable HiDPI display modes (requires restart) +sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true + + +############################################################################### +# Finder # +############################################################################### + +# Finder: show status bar +defaults write com.apple.finder ShowStatusBar -bool true + +# Finder: allow text selection in Quick Look +defaults write com.apple.finder QLEnableTextSelection -bool true + +# Disable the warning when changing a file extension +defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false + +# Avoid creating .DS_Store files on network volumes +defaults write com.apple.desktopservices DSDontWriteNetworkStores -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 + +# Show the ~/Library folder +chflags nohidden ~/Library diff --git a/.zshrc b/.zshrc new file mode 100644 index 00000000..ef528265 --- /dev/null +++ b/.zshrc @@ -0,0 +1,58 @@ +# Init ZSH +ZSH=$HOME/.oh-my-zsh + +plugins=(git osx ruby python iterm brew vundle syntax-highlighting) + + +####################### +# Options + +COMPLETION_WAITING_DOTS="true" + +export PATH=~/Dropbox/dev/bin:/usr/local/bin:/usr/local/sbin:`brew --prefix coreutils`/libexec/gnubin:$PATH + +# Load RVM into a shell session *as a function* +[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" +PATH=$PATH:$HOME/.rvm/bin + +export EDITOR='vim' +export RUBYOPT=rubygems +# export CC=gcc-4.2 +export CPPFLAGS=-I/opt/X11/include + +source $ZSH/oh-my-zsh.sh + +# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards +[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh + +####################### +# Aliases + +alias zrc='vim ~/.zshrc' + +# Directories +alias dev='cd /usr/local/dev' +alias w='cd ~/Work/' +alias wd='cd ~/Work/Dev' +alias wp='cd ~/Work/Projects/' + +# Apps +alias g='git' +alias v='mvim' + +# Git aliases +alias ga='g a' +alias gc='g c' +alias gs='g s' +alias gd='g d' + + +####################### +# Prompt + +PROMPT=" +%{$FX[bold]%}%{$fg[cyan]%}%{$BG[234]%}> " +RPROMPT="%~$(git_prompt_info) : $(hostname)%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]" diff --git a/README.md b/README.md new file mode 100644 index 00000000..a76ab55a --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Dotfiles of a spaghetti code warrior + +The magicks! + + ./install-deps.sh + ./.osx + ./.brew diff --git a/install-deps.sh b/install-deps.sh new file mode 100644 index 00000000..959b902e --- /dev/null +++ b/install-deps.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# https://github.com/jamiew/git-friendly +bash < <( curl https://raw.github.com/jamiew/git-friendly/master/install.sh) + +# https://rvm.io +curl -L https://get.rvm.io | bash -s stable --ruby + +# http://mxcl.github.com/homebrew/ +ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) + +# https://github.com/robbyrussell/oh-my-zsh +curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh + +# Create links +src=$(cd "$(dirname "$0")"; pwd) + +ln -sf $src/.zshrc ~/.zshrc +ln -sf $src/.gitignore ~/.gitignore +ln -sf $src/.gitconfig ~/.gitconfig