Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #241

Closed
wants to merge 25 commits into from
Closed

Merge #241

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c86299b
readme update for meee
paulirish Jan 24, 2012
6ed37b5
renaming
paulirish Jan 24, 2012
2df7609
bringing in my aliases/function to these dotfiles.
Jan 24, 2012
ff83ecc
adding my aliases to git
paulirish Jan 24, 2012
3a5495c
lets try to get iterm tab happiness.
paulirish Jan 24, 2012
8d23239
iterm title bar attempt #2
paulirish Jan 24, 2012
cd40d5e
iterm title tab stuff almost working
paulirish Jan 24, 2012
5f27494
add url
paulirish Jan 26, 2012
37b89e6
.bash_profile: Be sure to source `.bash_prompt` first, in case it set…
mathiasbynens Jan 26, 2012
65740ed
nerfing .vimrc's setrelativenumber and undodir options in case of old…
paulirish Jan 27, 2012
e0e0893
i have determined that i do not like pulling with rebase. no more reb…
paulirish Feb 6, 2012
efa3edd
init z
paulirish Feb 8, 2012
d38534f
f find shorthand
paulirish Feb 13, 2012
41b42d3
no hub alias.
paulirish Mar 28, 2012
315b10b
pygmentize alias from @gf3 . love so hard.
paulirish Apr 17, 2012
a0d5fb5
add gz() function for gzipped size
paulirish May 2, 2012
f189fa7
gitexport function for clean folder copy.
paulirish May 30, 2012
16fe2a7
start up rvm
paulirish May 31, 2012
42e2a52
bunyip shortcut. thx ryan. :)
paulirish May 31, 2012
e4ea88f
pretty git log
paulirish Jun 19, 2012
23ccf77
lg for log, paul.
paulirish Jun 19, 2012
4b7ffc6
more git alias fun.
paulirish Jun 19, 2012
9263775
git log with per-commit cmd-clickable GitHub URLs via @cowboy
paulirish Jun 19, 2012
20b4fbb
thanks steve streza. :)
paulirish Jun 21, 2012
553b861
subl
paulirish Jun 27, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 30 additions & 1 deletion .aliases
Expand Up @@ -4,6 +4,21 @@ alias ...="cd ../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"

# ssh!
alias shh='ssh aurgasm@aurgasm.us'
alias shhve='ssh paul@javascriptbattle.com'

# programs
alias slt='open -a "Sublime Text 2"'
alias subl='open -a "Sublime Text 2"'

# be nice
alias please=sudo

# handy things
alias bunyip='node ~/code/bunyip/cli.js'


# List all files colorized in long format, including dot files
alias la="ls -Gla"

Expand All @@ -18,9 +33,23 @@ else
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
fi


# `cat` with beautiful colors. requires Pygments installed.
# sudo easy_install Pygments
alias c='pygmentize -O style=monokai -f console256 -g'

# GIT STUFF

# Undo a `git push`
alias undopush="git push -f origin HEAD^:master"

# hub override.
# alias git=hub # not crazy about this..


# git root
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`'

# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
Expand Down Expand Up @@ -88,4 +117,4 @@ done
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume 10'"
alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
13 changes: 10 additions & 3 deletions .bash_profile
@@ -1,10 +1,17 @@
# Load ~/.bash_prompt, ~/.exports, ~/.aliases, ~/.functions and ~/.extra
# Load ~/.extra, ~/.bash_prompt, ~/.exports, ~/.aliases and ~/.functions
# ~/.extra can be used for settings you don’t want to commit
for file in ~/.{bash_prompt,exports,aliases,functions,extra}; do
for file in ~/.{extra,bash_prompt,exports,aliases,functions}; do
[ -r "$file" ] && source "$file"
done
unset file

# init z https://github.com/rupa/z
. ~/code/z/z.sh

# init rvm
source ~/.rvm/scripts/rvm


# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob

Expand All @@ -17,4 +24,4 @@ export LANG="en_US"

# Add tab completion for `defaults read|write NSGlobalDomain`
# You could just use `-g` instead, but I like being explicit
complete -W "NSGlobalDomain" defaults
complete -W "NSGlobalDomain" defaults
14 changes: 13 additions & 1 deletion .bash_prompt
Expand Up @@ -34,6 +34,7 @@ else
RESET="\033[m"
fi


function parse_git_dirty() {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
Expand All @@ -42,4 +43,15 @@ function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
}

PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
# iTerm Tab and Title Customization and prompt customization
# http://sage.ucsc.edu/xtal/iterm_tab_customization.html

# Put the string " [bash] hostname::/full/directory/path"
# in the title bar using the command sequence
# \[\e]2;[bash] \h::\]$PWD\[\a\]

# Put the penultimate and current directory
# in the iterm tab
# \[\e]1;\]$(basename $(dirname $PWD))/\W\[\a\]

PS1="\[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
47 changes: 46 additions & 1 deletion .functions
Expand Up @@ -3,6 +3,20 @@ function md() {
mkdir -p "$@" && cd "$@"
}


# find shorthand
function f() {
find . -name "$1"
}


# lets toss an image onto my server and pbcopy that bitch.
function scpp() {
scp "$1" aurgasm@aurgasm.us:~/paulirish.com/i;
echo "http://paulirish.com/i/$1" | pbcopy;
echo "Copied to clipboard: http://paulirish.com/i/$1"
}

# Start an HTTP server from a directory, optionally specifying the port
function server() {
local port="${1:-8000}"
Expand All @@ -12,6 +26,20 @@ function server() {
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"
}

# git log with per-commit cmd-clickable GitHub URLs (iTerm)
function gf() {
local remote="$(git remote -v | awk '/^origin.*\(push\)$/ {print $2}')"
[[ "$remote" ]] || return
local user_repo="$(echo "$remote" | perl -pe 's/.*://;s/\.git$//')"
git log $* --name-status --color | awk "$(cat <<AWK
/^.*commit [0-9a-f]{40}/ {sha=substr(\$2,1,7)}
/^[MA]\t/ {printf "%s\thttps://github.com/$user_repo/blob/%s/%s\n", \$1, sha, \$2; next}
/.*/ {print \$0}
AWK
)" | less -F
}


# Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL.
# Send a fake UA string for sites that sniff it instead of using the Accept-Encoding header. (Looking at you, ajax.googleapis.com!)
function httpcompression() {
Expand All @@ -29,6 +57,23 @@ function json() {
fi
}


# take this repo and copy it to somewhere else minus the .git stuff.
function gitexport(){
mkdir -p "$1"
git archive master | tar -x -C "$1"
}



# get gzipped size
function gz() {
echo "orig size (bytes): "
cat "$1" | wc -c
echo "gzipped size (bytes): "
gzip -c "$1" | wc -c
}

# All the dig info
function digga() {
dig +nocmd "$1" any +multiline +noall +answer
Expand All @@ -44,4 +89,4 @@ function escape() {
function unidecode() {
perl -e "binmode(STDOUT, ':utf8'); print \"$@\""
echo # newline
}
}
13 changes: 10 additions & 3 deletions .gitconfig
@@ -1,11 +1,18 @@
[alias]
c = commit -am
up = pull
p = push
s = status -s
df = diff --color --color-words --abbrev
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
[color]
ui = always
[apply]
whitespace = fix
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
whitespace = fix,space-before-tab,tab-in-indent,trailing-space
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
Expand All @@ -32,4 +39,4 @@
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
insteadOf = "gist:"
12 changes: 8 additions & 4 deletions .vimrc
Expand Up @@ -18,7 +18,9 @@ set noeol
" Centralize backups, swapfiles and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
set undodir=~/.vim/undo
if exists("&undodir")
set undodir=~/.vim/undo
endif

" Enable line numbers
set number
Expand Down Expand Up @@ -53,9 +55,11 @@ set shortmess=atI
set showmode
" Show the filename in the window titlebar
set title
" Use relative line numbers
set relativenumber
au BufReadPost * set relativenumber
if exists("&relativenumber")
" Use relative line numbers
set relativenumber
au BufReadPost * set relativenumber
endif
" Start scrolling three lines before the horizontal window border
set scrolloff=3

Expand Down
53 changes: 0 additions & 53 deletions README.md

This file was deleted.

30 changes: 30 additions & 0 deletions readme.md
@@ -0,0 +1,30 @@
# Paul's dotfiles.. a fork of mathias's..

## Installation

### Using Git and the bootstrap script

```bash
git clone https://github.com/paulirish/dotfiles.git && cd dotfiles && ./bootstrap.sh
```

### Git-free install

```bash
cd; curl -#L https://github.com/paulirish/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh}
```

To update later on, just run that command again.

### Sensible OS X defaults

When setting up a new Mac, you may want to set some sensible OS X defaults:

```bash
./.osx
```

## upstream

Suggestions/improvements
[welcome back upstream](https://github.com/mathiasbynens/dotfiles/issues)!