A Way to Save Your Dotfiles

Wed Mar 12, 2014

I use command line and terminal a lot. There will a lot of software using dotfiles to save their configurations. For example, Vim uses .vimrc file to store all Vim editor settings and Git uses .gitconfig to store user settings. Every time you reinstall your system, you have to re-configure it. For me, I am also developing on Linux Server. I have some virtual machines, I have to re-configure it every time I create a new virtual machine.

It is important to save your configure file in a good way so that we can reuse it multi times. In the past, I created several git repositories to track my dotfiles. This will be very hard to manage. After suffering so much thing, I get an idea to store these files.

It is quite simple.

Create a repository named dotfiles( or anything you want).

Save your configuration files in to this directory.

Use git submodule to manage plugins. For example Vim plugins.

Create symbolic links to your home directory( or any directory you have to put it in).

I also create a bash file to create symbolic link automatically. And a bash file named fetch.sh to install my dotfiles. An example is here.