Dotfiles


Dotfiles are the files that start with a ( . ) They are usually used to configure programs or applications.

The problem is that in your daily life, you use a lot of different programs, with different configuration, that you need to manage every time that you are in front a new system. It’s also possible that you use more than one laptop. For example, you might use one for work and another for your personal life.

For that reason, the best approach for me—and probably for you—is to have all the configuration in one folder and upload the project to GitHub (with a public or private repository). This way, you can use it wherever you want.

To help us with this approach we have GNU Stow, a easy tool to manage create links from your configuration folder to the place where the configuration for a specific program have to be.

dotfiles folder Inside your dotfiles folder, you have to create a folder for any configuration. Inside any folder you have to follow the config structure from each individual app. For example. The nvim configuration usually is in ~/.config/nvim/ So that you have to follow the same structure in your dotfiles folder. The reference point of the configurations is your user’s folder

nvim config folder

Now with the command stow nvim stow creates symbolic links in the correct folder following the folder structure in your nvim folder inside dotfiles folder

If I go to ~/.config/nvim/ nvim condig folder working The configuration was applied and its working.

Remember

If you have any configuration in the folder that you are going to link, you have to delete it before you run the stow command. If you don't do that, you will have a conflict with the files that you have in the folder and the symbolic links that stow is going to create.

Now, it’s your turn!