Skip to content

Dotfiles Usage Guide

antoniy edited this page Dec 14, 2020 · 3 revisions

Dotfiles Setup Guide

Dotfiles are structured to use GNU Stow and Git. Stow is a tool that manages symlinks with care to not do any destructive actions and dry-run support.

Installation

You need to install git and stow to be able to use the dotfiles management mechanism.

Arch

pacman -S git stow

MacOSX

brew install git stow

Clone dotfiles repository somewhere convenient. For this example, we'll use ~/.dotfiles directory:

git clone https://github.com/antoniy/dotfiles.git ~/.dotfiles

Automatic installation

We can deploy our dotfiles automatically using make:

cd ~/.dotfiles
make        # deploy default minimal configurations
make darwin # deploy all MacOSX configs
make linux  # deploy all Linux configs

Check out Makefile for details of what each one of the above does.

Manual

For more control, we can use stow directly to deploy our configs.

stow --no-fold -nvRt ~ git

Here -n flag indicates that this is gonna be a dry-run. Together with -v (verbose) flag we will get all the information of what would happen without doing any changes to our system. The -R will restow (unlink and then link) the specified modules. -t <dir> indicates the target directory for stow to link our files - in this case our home directory. Final parameter is our modules (divided by space). --no-fold is useful for some modules to tell stow not to link directory containing the config files but to link each config file individually. This is useful because sometimes we link a specific config file but the software has other files in the same directory that we don't want to bring to our dotfiles repository (as it will be the case if the whole config directory is a link to our dotfiles).

To install specified modules we can do:

stow --no-fold -vRt ~ git zsh tmux bat

For more information about using stow check out man stow.

Clone this wiki locally