Your home directory is your castle. Don't leave your dotfiles behind.
Your home directory is your castle. Don't leave your dotfiles behind.
Your home directory is your castle. Don't leave your dotfiles behind.
Homesick is sorta like 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.
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:
To get started, install homesick first:
gem install homesickIf you're starting from scratch and don't have a castle yet, generate one:
homesick generate ~/.homesick/repos/my-dotfilesThis creates a new git repository with a home/ directory ready for your dotfiles. If you have a github.user set in your git config, it will also add a GitHub remote automatically. You can then track files into it:
homesick track ~/.vimrc my-dotfilesOtherwise, if you already have a castle hosted somewhere, clone it:
Next, you use the homesick command to clone a castle:
homesick clone git://github.com/technicalpickles/pickled-vim.gitAlternatively, if it's on github, there's a slightly shorter way:
homesick clone technicalpickles/pickled-vimWith the castle cloned, you can now link its contents into your home dir:
homesick link pickled-vimYou can remove symlinks anytime when you don't need them anymore
homesick unlink pickled-vimIf 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:
homesick rc CASTLEThe 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.
If you're not sure what castles you have around, you can easily list them:
homesick listTo pull your castle (or all castles):
homesick pull --all|CASTLETo commit your castle's changes:
homesick commit CASTLETo push your castle:
homesick push CASTLETo open a terminal in the root of a castle:
homesick cd CASTLETo open your default editor in the root of a castle (the $EDITOR environment variable must be set):
homesick open CASTLETo execute a shell command inside the root directory of a given castle:
homesick exec CASTLE COMMANDTo execute a shell command inside the root directory of every cloned castle:
homesick exec_all COMMANDNot sure what else homesick has up its sleeve? There's always the built in help:
homesick helpIf you ever want to see what version of homesick you have type:
homesick version|-v|--versionhomesick link basically makes symlink to only first depth in castle/home. If you want to link nested files/directories, please use .homesick_subdir.
For example, when you have castle like this:
castle/home
`-- .config
`-- fooapp
|-- config1
|-- config2
`-- config3and have home like this:
$ tree -a
~
|-- .config
| `-- barapp
| |-- config1
| |-- config2
| `-- config3
`-- .emacs.d
|-- elisp
`-- initsYou 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.
castle/.homesick_subdir
.configand run homesick link CASTLE. The result is:
~
|-- .config
| |-- barapp
| | |-- config1
| | |-- config2
| | `-- config3
| `-- fooapp -> castle/home/.config/fooapp
`-- .emacs.d
|-- elisp
`-- initsOr homesick track NESTED_FILE CASTLE adds a line automatically. For example:
homesick track .emacs.d/elisp castlecastle/.homesick_subdir
.config
.emacs.dhome directory
~
|-- .config
| |-- barapp
| | |-- config1
| | |-- config2
| | `-- config3
| `-- fooapp -> castle/home/.config/fooapp
`-- .emacs.d
|-- elisp -> castle/home/.emacs.d/elisp
`-- initsand castle
castle/home
|-- .config
| `-- fooapp
| |-- config1
| |-- config2
| `-- config3
`-- .emacs.d
`-- elispHomesick is tested on the following Ruby versions:
Check out homeshick.
Copyright (c) 2010 Joshua Nichols. See LICENSE for details.
No open issues yet, or sync has not completed.