Skip to content

Latest commit

 

History

History
114 lines (76 loc) · 2.73 KB

README.rdoc

File metadata and controls

114 lines (76 loc) · 2.73 KB

Pitr’s Dot Files

***IMPORTANT*** change name and email in ‘.gitconfig` after installation

Installation

git clone git://github.com/pitr/config_files ~/.config_files
cd ~/.config_files
rake install

Environment

Mac OS X will work. UNIX-based OS should work (the only problem is EDITOR is Sublime Text).

Commands

Bash

Adds ~/bin to PATH if it exists.

I normally place all of my coding projects in ~/code, so this directory can easily be accessed (and tab completed) with the “c” command.

c confi<tab>

Usual ls, ll, l, .. stuff.

Shortcuts for most used programs:

g - git
v - vim
r - rails
p - python
e. - Sublime Text

Tab completion is also added to rake and git commands:

rake db:mi<tab>
git checkout ma<tab>
gco ma<tab>

To speed things up, the results are cached in local .rake_tasks~. It is smart enough to expire the cache automatically in most cases, but you can simply remove the files to flush the cache.

When in a git controlled directory, you’ll notice the current branch name shows up in the prompt while in a git repository.

~/code/config_files master^0 (ruby-2.1.2)
✔

release - branch name
* - dirty repository
[2] - depth of stash

If you’re using Rails, you’ll find some handy aliases (below). You can also use show_log and hide_log in script/console to show the log inline.

ss          # script/server
sc          # script/console
sg          # script/generate
tlog        # tail -f log/development.log
migrate     # rake db:migrate
remigrate   # rake db:migrate && rake db:migrate:redo

# rails 3+ aliases
rs          # rails server
rc          # rails console
rg          # rails generate

Helpers from reinh.com/blog/2008/08/27/hack-and-and-ship.html

hs      # hack && ship = pull + rebase/merge + push
hsd     # hack && ship && deploy = hs + push to heroku
hrs     # hack && rake && ship = same as hs but run rake test before push

If there are some shell configuration settings which you want secure or specific to one system, place it into a ~/.bashrc file. This will be loaded automatically if it exists.

Gem

Disables generation of ri and rdoc.

Git

Adds shortcuts like:

gb    # git branch -a -v
gc    # git commit -m
ga    # git add
gadd  # git add -u && git add . && git status
gco   # git checkout
gd    # git diff --word-diff (since git 1.7.2)
gg    # git graph ...
gpl   # git pull --rebase
gup   # git up (install git-up gem first)

And so forth.

Happy Git Commits (collectiveidea.com/blog/archives/2010/08/03/happy-git-commits/).

# in ~/code/project
cd .git/hooks
ln -s ~/.git/hooks/post-commit

IRB

Adds colour and better inspector (looksee).

Screen

Initializes 6 windows: main, code, gcc, git, irc, etc