~ubuntu-branches/debian/sid/homesick/sid

« back to all changes in this revision

Viewing changes to README.markdown

  • Committer: Package Import Robot
  • Author(s): Alexander GQ Gerasiov
  • Date: 2015-02-22 23:22:46 UTC
  • Revision ID: package-import@ubuntu.com-20150222232246-f6wk17zfb7euvs5x
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# homesick
 
2
 
 
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)
 
9
 
 
10
Your home directory is your castle. Don't leave your dotfiles behind.
 
11
 
 
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.
 
13
 
 
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:
 
15
 
 
16
* Contains a 'home' directory
 
17
* 'home' contains any number of files and directories that begin with '.'
 
18
 
 
19
To get started, install homesick first:
 
20
 
 
21
    gem install homesick
 
22
 
 
23
Next, you use the homesick command to clone a castle:
 
24
 
 
25
    homesick clone git://github.com/technicalpickles/pickled-vim.git
 
26
 
 
27
Alternatively, if it's on github, there's a slightly shorter way:
 
28
 
 
29
    homesick clone technicalpickles/pickled-vim
 
30
 
 
31
With the castle cloned, you can now link its contents into your home dir:
 
32
 
 
33
    homesick symlink pickled-vim
 
34
 
 
35
You can remove symlinks anytime when you don't need them anymore
 
36
 
 
37
    homesick unlink pickled-vim
 
38
 
 
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:
 
40
 
 
41
    homesick rc CASTLE
 
42
 
 
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`.
 
44
 
 
45
If you're not sure what castles you have around, you can easily list them:
 
46
 
 
47
    homesick list
 
48
 
 
49
To pull your castle (or all castles):
 
50
 
 
51
    homesick pull --all|CASTLE
 
52
 
 
53
To commit your castle's changes:
 
54
 
 
55
    homesick commit CASTLE
 
56
 
 
57
To push your castle:
 
58
 
 
59
    homesick push CASTLE
 
60
 
 
61
To open a terminal in the root of a castle:
 
62
 
 
63
    homesick cd CASTLE
 
64
 
 
65
To open your default editor in the root of a castle (the $EDITOR environment variable must be set):
 
66
 
 
67
    homesick open CASTLE
 
68
 
 
69
To execute a shell command inside the root directory of a given castle:
 
70
 
 
71
    homesick exec CASTLE COMMAND
 
72
 
 
73
To execute a shell command inside the root directory of every cloned castle:
 
74
 
 
75
    homesick exec_all COMMAND
 
76
 
 
77
Not sure what else homesick has up its sleeve? There's always the built in help:
 
78
 
 
79
    homesick help
 
80
 
 
81
If you ever want to see what version of homesick you have type:
 
82
 
 
83
    homesick version|-v|--version
 
84
 
 
85
## .homesick_subdir
 
86
 
 
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.
 
88
 
 
89
For example, when you have castle like this:
 
90
 
 
91
    castle/home
 
92
    `-- .config
 
93
        `-- fooapp
 
94
            |-- config1
 
95
            |-- config2
 
96
            `-- config3
 
97
 
 
98
and have home like this:
 
99
 
 
100
    $ tree -a
 
101
    ~
 
102
    |-- .config
 
103
    |   `-- barapp
 
104
    |         |-- config1
 
105
    |         |-- config2
 
106
    |         `-- config3
 
107
    `-- .emacs.d
 
108
        |-- elisp
 
109
        `-- inits
 
110
 
 
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.
 
112
 
 
113
castle/.homesick_subdir
 
114
 
 
115
    .config
 
116
 
 
117
and run `homesick symlink CASTLE`. The result is:
 
118
 
 
119
    ~
 
120
    |-- .config
 
121
    |   |-- barapp
 
122
    |   |     |-- config1
 
123
    |   |     |-- config2
 
124
    |   |     `-- config3
 
125
    |   `-- fooapp        -> castle/home/.config/fooapp
 
126
    `-- .emacs.d
 
127
        |-- elisp
 
128
        `-- inits
 
129
 
 
130
Or `homesick track NESTED_FILE CASTLE` adds a line automatically. For example:
 
131
 
 
132
    homesick track .emacs.d/elisp castle
 
133
 
 
134
castle/.homesick_subdir
 
135
 
 
136
    .config
 
137
        .emacs.d
 
138
 
 
139
home directory
 
140
 
 
141
    ~
 
142
    |-- .config
 
143
    |   |-- barapp
 
144
    |   |     |-- config1
 
145
    |   |     |-- config2
 
146
    |   |     `-- config3
 
147
    |   `-- fooapp        -> castle/home/.config/fooapp
 
148
    `-- .emacs.d
 
149
        |-- elisp         -> castle/home/.emacs.d/elisp
 
150
        `-- inits
 
151
 
 
152
and castle
 
153
 
 
154
    castle/home
 
155
    |-- .config
 
156
    |   `-- fooapp
 
157
    |       |-- config1
 
158
    |       |-- config2
 
159
    |      `-- config3
 
160
    `-- .emacs.d
 
161
        `-- elisp
 
162
 
 
163
## Supported Ruby Versions
 
164
 
 
165
Homesick is tested on the following Ruby versions:
 
166
 
 
167
* 1.9.3
 
168
* 2.0.0
 
169
* 2.1.0
 
170
 
 
171
## Note on Patches/Pull Requests
 
172
 
 
173
* Fork the project.
 
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.
 
178
 
 
179
## Need homesick without the ruby dependency?
 
180
 
 
181
Check out [homeshick](https://github.com/andsens/homeshick).
 
182
 
 
183
## Copyright
 
184
 
 
185
Copyright (c) 2010 Joshua Nichols. See LICENSE for details.