Permalink
Browse files

initial commit

  • Loading branch information...
1 parent ec7377c commit ec085f889592542dbb2fb0c69d5e1ee35c2c8f1d Neil Middleton committed Feb 21, 2012
View
6 .gemrc
@@ -0,0 +1,6 @@
+:update_sources: true
+:bulk_threshold: 1000
+gem: --no-ri --no-rdoc
+:verbose: true
+:benchmark: false
+:backtrace: false
View
@@ -0,0 +1,22 @@
+let mapleader = ","
+
+set guifont=Inconsolata:h18
+color molokai
+set wildchar=<Tab> wildmenu wildmode=full
+
+set grepprg=ack
+set grepformat=%f:%l:%m
+
+set tabstop=2
+set smarttab
+set shiftwidth=2
+set expandtab
+set backspace=start,indent
+
+set number
+set hlsearch
+syntax on
+
+if has("gui_running")
+ set guioptions=egmrt
+endif
View
10 .zshrc
@@ -0,0 +1,10 @@
+. ~/.zsh/config
+. ~/.zsh/aliases
+. ~/.zsh/completion
+
+mvim() {
+ (unset GEM_PATH GEM_HOME; command mvim "$@")
+}
+
+# use .localrc for settings specific to one system
+[[ -f ~/.localrc ]] && . ~/.localrc
View
0 bash/aliases 100644 → 100755
No changes.
View
0 bash/completions 100644 → 100755
No changes.
View
0 bash/config 100644 → 100755
No changes.
View
0 bash/paths 100644 → 100755
No changes.
View
61 bash_profile 100644 → 100755
@@ -10,3 +10,64 @@ fi
if [ -f ~/.localrc ]; then
. ~/.localrc
fi
+
+# Git Colour Coding
+
+RED="\[\033[0;31m\]"
+YELLOW="\[\033[0;33m\]"
+GREEN="\[\033[0;32m\]"
+BLUE="\[\033[0;34m\]"
+LIGHT_RED="\[\033[1;31m\]"
+LIGHT_GREEN="\[\033[1;32m\]"
+WHITE="\[\033[1;37m\]"
+LIGHT_GRAY="\[\033[0;37m\]"
+COLOR_NONE="\[\e[0m\]"
+
+function parse_git_branch {
+ git rev-parse --git-dir &> /dev/null
+ git_status="$(git status 2> /dev/null)"
+ branch_pattern="^# On branch ([^${IFS}]*)"
+ remote_pattern="# Your branch is (.*) of"
+ diverge_pattern="# Your branch and (.*) have diverged"
+ if [[ ! ${git_status}} =~ "working directory clean" ]]; then
+ state=" ${RED}"
+ fi
+ # add an else if or two here if you want to get more specific
+ if [[ ${git_status} =~ ${remote_pattern} ]]; then
+ if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
+ remote=" ${YELLOW}"
+ else
+ remote=" ${YELLOW}"
+ fi
+ fi
+ if [[ ${git_status} =~ ${diverge_pattern} ]]; then
+ remote=" ${YELLOW}"
+ fi
+ if [[ ${git_status} =~ ${branch_pattern} ]]; then
+ branch=${BASH_REMATCH[1]}
+ echo " (${branch})${remote}${state}"
+ fi
+}
+
+function prompt_func() {
+ previous_return_value=$?;
+ prompt="${TITLEBAR} \w${GREEN}$(parse_git_branch) ${COLOR_NONE} "
+ if test $previous_return_value -eq 0
+ then
+ PS1="${prompt}"
+ else
+ PS1="${prompt} ${RED}${COLOR_NONE} "
+ fi
+
+ PS1="\$(~/.rvm/bin/rvm-prompt i v g) $PS1"
+}
+
+PROMPT_COMMAND=prompt_func
+export ARCHFLAGS="-arch x86_64"
+#export PATH=/usr/local/git/bin:$PATH
+
+export GEM_PRIVATE_KEY='~/.ssh/gem-private_key.pem'
+export GEM_CERTIFICATE_CHAIN='~/.ssh/gem-public_cert.pem'
+export PATH
+
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Print the current Git branch.
+#
+# AUTHOR:
+# Geoffrey Grosenbach http://peepcode.com
+
+git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'
View
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+# Emits Git metadata for use in a Zsh prompt.
+#
+# AUTHOR:
+# Ben Hoskings
+# https://github.com/benhoskings/dot-files/blob/master/files/bin/git_cwd_info
+#
+# MODIFIED:
+# Geoffrey Grosenbach http://peepcode.com
+
+# The methods that get called more than once are memoized.
+
+def git_repo_path
+ @git_repo_path ||= `git rev-parse --git-dir 2>/dev/null`.strip
+end
+
+def in_git_repo
+ !git_repo_path.empty? &&
+ git_repo_path != '~' &&
+ git_repo_path != "#{ENV['HOME']}/.git"
+end
+
+def git_parse_branch
+ @git_parse_branch ||= `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`.chomp
+end
+
+def git_head_commit_id
+ `git rev-parse --short HEAD 2>/dev/null`.strip
+end
+
+def git_cwd_dirty
+ " %{\e[90m%}✗%{\e[0m%}" unless git_repo_path == '.' || `git ls-files -m`.strip.empty?
+end
+
+def rebasing_etc
+ if File.exists?(File.join(git_repo_path, 'BISECT_LOG'))
+ "+bisect"
+ elsif File.exists?(File.join(git_repo_path, 'MERGE_HEAD'))
+ "+merge"
+ elsif %w[rebase rebase-apply rebase-merge ../.dotest].any? {|d| File.exists?(File.join(git_repo_path, d)) }
+ "+rebase"
+ end
+end
+
+if in_git_repo
+ print " %{\e[90m%}#{git_parse_branch} %{\e[37m%}#{git_head_commit_id}%{\e[0m%}#{rebasing_etc}#{git_cwd_dirty}"
+end
View
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Print the current Git branch.
+#
+# AUTHOR:
+# Geoffrey Grosenbach http://peepcode.com
+
+git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'
View
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+# Emits Git metadata for use in a Zsh prompt.
+#
+# AUTHOR:
+# Ben Hoskings
+# https://github.com/benhoskings/dot-files/blob/master/files/bin/git_cwd_info
+#
+# MODIFIED:
+# Geoffrey Grosenbach http://peepcode.com
+
+# The methods that get called more than once are memoized.
+
+def git_repo_path
+ @git_repo_path ||= `git rev-parse --git-dir 2>/dev/null`.strip
+end
+
+def in_git_repo
+ !git_repo_path.empty? &&
+ git_repo_path != '~' &&
+ git_repo_path != "#{ENV['HOME']}/.git"
+end
+
+def git_parse_branch
+ @git_parse_branch ||= `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`.chomp
+end
+
+def git_head_commit_id
+ `git rev-parse --short HEAD 2>/dev/null`.strip
+end
+
+def git_cwd_dirty
+ " %{\e[90m%}✗%{\e[0m%}" unless git_repo_path == '.' || `git ls-files -m`.strip.empty?
+end
+
+def rebasing_etc
+ if File.exists?(File.join(git_repo_path, 'BISECT_LOG'))
+ "+bisect"
+ elsif File.exists?(File.join(git_repo_path, 'MERGE_HEAD'))
+ "+merge"
+ elsif %w[rebase rebase-apply rebase-merge ../.dotest].any? {|d| File.exists?(File.join(git_repo_path, d)) }
+ "+rebase"
+ end
+end
+
+if in_git_repo
+ print " %{\e[90m%}#{git_parse_branch} %{\e[37m%}#{git_head_commit_id}%{\e[0m%}#{rebasing_etc}#{git_cwd_dirty}"
+end
View
BIN bin/subl
Binary file not shown.
View
11 gemrc
@@ -1,9 +1,12 @@
---
-:verbose: true
-gem: --no-ri --no-rdoc
:update_sources: true
-:sources:
-- http://gems.rubyforge.org
+gem: --no-ri --no-rdoc
:backtrace: false
+:verbose: true
:bulk_threshold: 1000
:benchmark: false
+:sources:
+- http://gemcutter.org
+- http://rubygems.org
+- http://gems.github.com
+- http://gemcutter.org/
View
17 irbrc
@@ -43,4 +43,21 @@ def paste
`pbpaste`
end
+if ENV["RAILS_ENV"]
+ require 'rubygems'
+
+ begin
+ require "ap"
+ IRB::Irb.class_eval do
+ def output_value
+ ap @context.last_value
+ end
+ end
+ rescue LoadError => e
+ puts "ap gem not found. Try typing 'gem install awesome_print' to get super-fancy output."
+ end
+end
+
+
+
load File.dirname(__FILE__) + '/.railsrc' if $0 == 'irb' && ENV['RAILS_ENV']
View
@@ -0,0 +1,22 @@
+let mapleader = ","
+
+set guifont=Inconsolata:h18
+color molokai
+set wildchar=<Tab> wildmenu wildmode=full
+
+set grepprg=ack
+set grepformat=%f:%l:%m
+
+set tabstop=2
+set smarttab
+set shiftwidth=2
+set expandtab
+set backspace=start,indent
+
+set number
+set hlsearch
+syntax on
+
+if has("gui_running")
+ set guioptions=egmrt
+endif
View
@@ -19,14 +19,26 @@ alias gs='git status'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
# rails
+alias be='bundle exec'
alias sc='script/console'
alias ss='script/server'
+alias rs='bundle exec rails server'
+alias rc='bundle exec rails console'
alias sg='script/generate'
-alias a='autotest -rails'
+alias g='bundle exec guard -c'
alias tlog='tail -f log/development.log'
-alias scaffold='script/generate nifty_scaffold'
alias migrate='rake db:migrate db:test:clone'
alias rst='touch tmp/restart.txt'
+alias prep='rake db:migrate && rake db:test:clone_structure'
+alias resetdb='rake db:migrate:reset && rake db:test:clone_structure'
+alias tit='rm -rf server'
+alias restart='touch tmp/restart.txt'
+alias fs='bundle exec foreman start'
+alias work='heroku accounts:set kyan'
+alias personal='heroku accounts:set personal'
# commands starting with % for pasting from web
alias %=' '
+
+#dns
+alias flushdns='dscacheutil -flushcache'
View
@@ -1,46 +1,30 @@
-if [[ -n $SSH_CONNECTION ]]; then
- export PS1='%m:%3~$(git_info_for_prompt)%# '
-else
- export PS1='%3~$(git_info_for_prompt)%# '
-fi
-
-export EDITOR='mate -w'
-export PATH="~/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:$PATH"
-export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
-
-fpath=(~/.zsh/functions $fpath)
-
-autoload -U ~/.zsh/functions/*(:t)
-
-HISTFILE=~/.zsh_history
-HISTSIZE=1000
-SAVEHIST=1000
-REPORTTIME=10 # print elapsed time when more than 10 seconds
-
-setopt NO_BG_NICE # don't nice background tasks
-setopt NO_HUP
-setopt NO_LIST_BEEP
-setopt LOCAL_OPTIONS # allow functions to have local options
-setopt LOCAL_TRAPS # allow functions to have local traps
-setopt HIST_VERIFY
-setopt SHARE_HISTORY # share history between sessions ???
-setopt EXTENDED_HISTORY # add timestamps to history
-setopt PROMPT_SUBST
-setopt CORRECT
-setopt COMPLETE_IN_WORD
-setopt IGNORE_EOF
-
-setopt APPEND_HISTORY # adds history
-setopt INC_APPEND_HISTORY SHARE_HISTORY # adds history incrementally and share it across sessions
-setopt HIST_IGNORE_ALL_DUPS # don't record dupes in history
-setopt HIST_REDUCE_BLANKS
-
-zle -N newtab
-
-bindkey '^[^[[D' backward-word
-bindkey '^[^[[C' forward-word
-bindkey '^[[5D' beginning-of-line
-bindkey '^[[5C' end-of-line
-bindkey '^[[3~' delete-char
-bindkey '^[^N' newtab
-bindkey '^?' backward-delete-char
+# DESCRIPTION:
+# A simple zsh configuration that gives you 90% of the useful features that I use everyday.
+#
+# AUTHOR:
+# Geoffrey Grosenbach http://peepcode.com
+
+
+# RVM
+if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
+
+# Colors
+autoload -U colors
+colors
+setopt prompt_subst
+
+# Prompt
+local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
+
+PROMPT='
+%{$fg[cyan]%}%~%{$reset_color%}
+${smiley} %{$reset_color%}'
+
+RPROMPT='%{$fg[white]%} $(~/.rvm/bin/rvm-prompt)$(~/bin/git-cwd-info.rb)%{$reset_color%}'
+
+# Show completion on first TAB
+setopt menucomplete
+
+# Load completions for Ruby, Git, etc.
+autoload compinit
+compinit

0 comments on commit ec085f8

Please sign in to comment.