3
[![Gem Version](https://badge.fury.io/rb/homesick.svg)](http://badge.fury.io/rb/homesick)
4
[![Build Status](https://travis-ci.org/technicalpickles/homesick.svg?branch=master)](https://travis-ci.org/technicalpickles/homesick)
5
[![Dependency Status](https://gemnasium.com/technicalpickles/homesick.svg)](https://gemnasium.com/technicalpickles/homesick)
6
[![Coverage Status](https://coveralls.io/repos/technicalpickles/homesick/badge.png)](https://coveralls.io/r/technicalpickles/homesick)
7
[![Code Climate](https://codeclimate.com/github/technicalpickles/homesick.svg)](https://codeclimate.com/github/technicalpickles/homesick)
8
[![Gitter chat](https://badges.gitter.im/technicalpickles/homesick.svg)](https://gitter.im/technicalpickles/homesick)
10
Your home directory is your castle. Don't leave your dotfiles behind.
12
Homesick is sorta like [rip](http://github.com/defunkt/rip), but for dotfiles. It uses git to clone a repository containing dotfiles, and saves them in `~/.homesick`. It then allows you to symlink all the dotfiles into place with a single command.
14
We call a repository that is compatible with homesick to be a 'castle'. To act as a castle, a repository must be organized like so:
16
* Contains a 'home' directory
17
* 'home' contains any number of files and directories that begin with '.'
19
To get started, install homesick first:
23
Next, you use the homesick command to clone a castle:
25
homesick clone git://github.com/technicalpickles/pickled-vim.git
27
Alternatively, if it's on github, there's a slightly shorter way:
29
homesick clone technicalpickles/pickled-vim
31
With the castle cloned, you can now link its contents into your home dir:
33
homesick symlink pickled-vim
35
You can remove symlinks anytime when you don't need them anymore
37
homesick unlink pickled-vim
39
If you need to add further configuration steps you can add these in a file called '.homesickrc' in the root of a castle. Once you've cloned a castle with a .homesickrc run the configuration with:
43
The contents of the .homesickrc file must be valid Ruby code as the file will be executed with Ruby's eval construct. The .homesickrc is also passed the current homesick object during its execution and this is available within the .homesickrc file as the 'self' variable. As the rc operation can be destructive the command normally asks for confirmation before proceeding. You can bypass this by passing the '--force' option, for example `homesick rc --force CASTLE`.
45
If you're not sure what castles you have around, you can easily list them:
49
To pull your castle (or all castles):
51
homesick pull --all|CASTLE
53
To commit your castle's changes:
55
homesick commit CASTLE
61
To open a terminal in the root of a castle:
65
To open your default editor in the root of a castle (the $EDITOR environment variable must be set):
69
To execute a shell command inside the root directory of a given castle:
71
homesick exec CASTLE COMMAND
73
To execute a shell command inside the root directory of every cloned castle:
75
homesick exec_all COMMAND
77
Not sure what else homesick has up its sleeve? There's always the built in help:
81
If you ever want to see what version of homesick you have type:
83
homesick version|-v|--version
87
`homesick symlink` basically makes symlink to only first depth in `castle/home`. If you want to link nested files/directories, please use .homesick_subdir.
89
For example, when you have castle like this:
98
and have home like this:
111
You may want to symlink only to `castle/home/.config/fooapp` instead of `castle/home/.config` because you already have `~/.config/barapp`. In this case, you can use .homesick_subdir. Please write "directories you want to look up sub directories (instead of just first depth)" in this file.
113
castle/.homesick_subdir
117
and run `homesick symlink CASTLE`. The result is:
125
| `-- fooapp -> castle/home/.config/fooapp
130
Or `homesick track NESTED_FILE CASTLE` adds a line automatically. For example:
132
homesick track .emacs.d/elisp castle
134
castle/.homesick_subdir
147
| `-- fooapp -> castle/home/.config/fooapp
149
|-- elisp -> castle/home/.emacs.d/elisp
163
## Supported Ruby Versions
165
Homesick is tested on the following Ruby versions:
171
## Note on Patches/Pull Requests
174
* Make your feature addition or bug fix.
175
* Add tests for it. This is important so I don't break it in a future version unintentionally.
176
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
177
* Send me a pull request. Bonus points for topic branches.
179
## Need homesick without the ruby dependency?
181
Check out [homeshick](https://github.com/andsens/homeshick).
185
Copyright (c) 2010 Joshua Nichols. See LICENSE for details.