My dotfiles. Period.

INSTALL.md 3.7KB

INSTALLATION

Note that this will only work for dotfiles stored right in your $HOME. Support for configuration stored in folders like ~/.config/application or ~/.local/application is planned.

To install, you need to perform following steps:

  1. Clone repository to a stable place on your box

    For now, I'm going to assume it's local/mydots

  2. Move (and merge if needed) your existing configs to dotfiles folder. Remove the dot from name, e.g.:

    $ mv ~/.gnucash ~/local/mydots/dotfiles/gnucash
    

    This works for directories as well as files, although e.g. for bash, vim or git, I recommend different solutions--see below.

    Also note that you can name the dotfiles folder whatever you want; there's no real connection with the repository.

  3. Run mklinks script with single argument: path to dotfiles folder (or how you named it), e.g.:

    $ ~/local/mydots/mklinks ~/local/mydots/dotfiles
    

    The script will create links back in your $HOME, uless they (or real files) did already exist, in which case it will only warn you. This makes it easy to exclude some of your applications from some of your machines: just skip step 2 for them.

Instructions for bash

Although similar technique could be used for bash, I prefer toi have defaults specified by distro. Therefore I use other technique:

Instead of step 2 above, move/merge your specific ~/.bashrc changes to either one of these, or preferably, split them as needed:

dotfiles/bash/global-before.bashrc
dotfiles/bash/user/<your-username>.bashrc
dotfiles/bash/host/<your-hostname>.bashrc
dotfiles/bash/global-after.bashrc

Then, replace your ~/.bashrc with your default distro's one, commonly found in /etc/skel/.bashrc, and patch it with dotfiles/bash/setup/bashrc.diff:

$ cp /etc/skel/.bashrc ~/
$ patch -u ~/.bashrc local/mydots/dotfiles/bash/setup/bashrc.diff

From that point on, .bashrc will source appropriate fies for you, so do not make any changes to your local .bashrc, unless you really want them to be local, i.e. private only.

Instructions for Vim

If you want to keep default vim-ish behavior and have all local config in ~/.vimrc, you can use above generic steps. However, if you want to have rather more sophisticated model, and for example use my vim configuration as a starting point, do this instead of step 2:

  1. Merge your local ~/.vimrc into dotfiles/vim/vimrc

  2. Create a symlink to ~/.vim/vimrc:

    $ cd
    $ ln -s local/mydots/dotfiles/vim/vimrc .vimrc
    

You could actually have your .vimrc symlink point right to local/mydots/... I find this more flexible, though.

perlcritic_vim

Additionally, if you want to use perlcritic.vim, you need to:

  • install Perl::Critic (from CPAN)

  • put bin/perlcritic_vim to your PATH

Instructions for git

Note: For most of config I have shared, you will need at least git 1.8. Without it, things will not work, and you might even end up with broken git!

However, if you only want to use the sharing/splitting mechanism, 1.7 should be OK. No warranties, though.

The pricnicple is the same as in bash section above: a new folder is created, local config is split into parts per user/host or global one, and original file becomes just a crossroads into these.

Except that since git does not support expansion in config paths, the fil must be created by a script. So what you want to do is the same as for bash above, except that instead of applying patch to your .gitconfig, you simply delete it and run dotfiles/git/setup.

If you have a local changes that you don't want to share, you can either put them into the re-created ~.gitconfig, or (as I prefer) in dotfiles/git/private/gitconfig