DEV Community

Discussion on: Manage Your Dotfiles Like a Superhero

Collapse
 
grimm26 profile image
Mark Keisler

What happens when you have two or more packages that use . config/ ? Will it still try to symlink that directory? It would be much better to make sure the directory is created and only symlink files.

Collapse
 
jakewies profile image
Jake Wiesler • Edited

Great question! I can only answer from experience. There may be a more sophisticated answer.

Before setting up my .dotfiles in the way I described in this post, I had a .config directory with a few subdirectories for packages I use routinely. I don't need to version control these packages, so they aren't stowed in my .dotfiles directory.

stow realizes this, and instead of symlinking the entire .config directory, it goes one level deeper and symlinks the stowed directory. This preserves the rest of the folders in .config from being symlinked.

So what this looks like using a stowed nvim directory:

.dotfiles
    nvim
       .config
            nvim
                .dotfile
.config 
    package-1
    package-2
    nvim -> .dotfiles/nvim/.config/nvim
Enter fullscreen mode Exit fullscreen mode

Hope this answers your question!