README
Manage your dotfiles as (un)installable, (un)linkable packages.
Installation
Simply run:
$ npm install -g dotfiles-pm
# Commands **list** ``` List all your packages. Linked packages are prefixed with [*] unlinked packages with [.] ```
install
Install a package. Looks for a dotfile.json in PWD
```
**uninstall <name>**
```
Uninstall a package. If it is linked, it will be unlinked.
```
**link <name>**
```
Link one of your installed packages.
```
**unlink <name>**
```
Unlink one of your linked packages.
```
<br/>
# Usage
## Installing a package
A package is a directory containing some of your files and a *dotfile.json* which holds your package info. It will look something like this:
```json
{
"name": "nvim",
"linkto": "/home/ben/.config",
"withdir": "nvim",
"ignore": [ ".git/" ]
}
option | description |
---|---|
name | our package name, for obvious reasons! |
linkto | the directory we want to link our files to. Defaults to $HOME if omitted |
withdir | an extra directory in which we want to place our actual links. So the link path becomes: linkto/withdir/somefile |
ignore | a list of files we don't want to copy when installing. You can use your usual glob patterns here, yippie! |
Once you've got all that done simply run *install* in the directory with the *dotfile.json* ```bash $ dotfiles install ```
Dotfiles copies all the files and dirs in the directory (minus the ignore list) to ~/.config/dotfiles/installed/<package name> and adds the package to its internal cache.
Now we can (un)link the package, nice!
Linking a package
Simply run link to link a package.
$ dotfiles link <package name>
## Unlinking a package Simply run *unlink* to unlink a package. If you used *withdir* in your *dotfile.json* this directory will be automatically removed if it is empty. ```bash $ dotfiles unlink
Uninstalling a package
Simply run uninstall to uninstall one of your packages.
$ dotfiles uninstall <package name>
Uninstalling will unlink and completely remove it from your packages directory $HOME/.config/dotfiles/installed
## ZSH Completion ZSH completion scripts are included in the zsh folder.
oh-my-zsh plugin
Place dotfiles.plugin.zsh in $HOME/.oh-my-zsh/custom/plugins/dotfiles and add it to the plugins list in your .zshrc
plugins = (dotfiles <any other stuff that was already here>)
regular zsh completion script
Place _dotfiles in a directory that is included in your zsh fpath.
e.g. $HOME/.zsh/completions would be configured like this in your .zshrc
fpath=($HOME/.zsh/completions $fpath)
## Updating a package TODO
## Profiles TODO
## Local repositories TODO
## Remote repositories TODO