-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
I use stow to manage my dotfiles so that I can clone and set them up easily on a new machine. You can read this blog if you want a guide on how to use it for dotfiles, but all you need to know to use it here is that it creates symlinks for you in the correct places pointing back to this repository.
To begin, first clone this repository. I recommend cloning it into a subdirectory of your $HOME
, e.g. $HOME/.dotfiles
, because my stow install script relies on stow's default behaviour of using the current directory as the stow directory (where the files come from) and the parent directory as the target directory (where the symlinks are installed). If you want to clone it somewhere else and want to use stow, I recommend looking at man stow
first to see how it works.
Before installing my dotfiles, please read install-dotfiles.sh
here and modify the $dirs
variable by commenting out the directories you DON'T want to install. Each entry corresponds to a directory in the top-level directory of this dotfiles repo, so you can see what dotfiles will be installed in each directory. To install, run
./install-dotfiles.sh
in the repo's root directory. Stow should warn you if any files will be overwritten, but you should double-check beforehand anyway. I also recommend doing a sanity-check after installing to make sure that all the dotfiles have been set up in the correct locations. E.g. if you've installed the nvim
directory, I would run ls -al ~/.config
and expect to see an entry like this:
lrwxrwxrwx. 1 limao limao 30 Nov 9 13:41 nvim -> ../.dotfiles/nvim/.config/nvim
Stow can also remove symlinks as well. You can do this with the same install script,
./install-dotfiles.sh --clean
which removes the symlinks corresponding to the directories in the same $dirs
variable.
Even though I don't use many oh-my-zsh plugins, I do have an install script here that installs them automatically to $ZSH_CUSTOM/plugins
:
./install-omz-plugins.sh
Similarly to above, pick and choose the plugins you want to add by adding their repo URLs to the $repos
variable.