DotfiM v0.0.1 - A dotfile manager

Timoses timosesu at gmail.com
Wed Jul 4 08:28:22 UTC 2018


On Tuesday, 3 July 2018 at 16:31:39 UTC, Francesco Mecca wrote:
> On Saturday, 30 June 2018 at 14:27:39 UTC, Timoses wrote:
>> Thought I'd try a release of this project of mine which I find 
>> very useful.
>>
>> https://github.com/Timoses/dotfim
>>
>> DotfiM is capable of syncing your dotfiles across machines via 
>> a git repository. Simply download DotfiM, build it and run 
>> `dotfim sync <your dotfile git repo>`. DotfiM asks if you 
>> would like to install all the dotfiles in the git repository 
>> to your local home folder.
>>
>> DotfiM is very useful if you set up your environment via 
>> dotfiles. This could include your vim setup or how your shell 
>> looks and behaves. The goal of DotfiM is to take your 
>> environment setup anywhere you go.
>>
>> DotfiM will create two sections in a synced dotfile:
>> - One section is synchronized to the git repository
>> - another is only kept locally
>>
>>
>> I'd be thrilled to hear if it works for you. Let me know of 
>> any issues or ideas you might have.
>>
>>
>> Note that I've started this project almost a year ago when I 
>> was still in "Dinfant shoes".
>>
>>
>>
>> What is a dotfile?
>> Basically, it's a configuration file on UNIX systems and can 
>> be used to customize your environment.
>
> It would be interesting if you highlights the difference 
> between the traditional stow approach:
> http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html
>
> On top of my mind I have this questions:
> Are you using symlinks?
> Can I sync parts of the dotfiles?

I must admit, I didn't look around much for dotfile management 
tools before implementing DotfiM. I just jumped at the 
opportunity for a D project.

Compared to Stow I'd highlight the following differences:
- DotfiM doesn't use symlinks, instead contents of the gitfiles 
(the dotfiles saved in the git repository) are thrown into your 
home directory while keeping already existing content of the 
dotfile (in the home directory) in a local "section". In effect 
the dotfile then contains two sections, one which is synced with 
the git repo and one which is kept only locally.
The resulting dotfile in the home directory will look something 
like this:
	# This dotfile is managed by DotfiM

	#-------------DotFiM-------------#
	# DotfiM - Git Section
	#  Changes to this section are synchronized with your dotfiles 
repo
	#  Git Commit Hash: aaa19f7f595bc9f0d6e5bdbeb1b8a1f93cdfe803
	# - - - - - - - - - - -

	# My synced setups
	...

	# - - - - - - - - - - -
	# DotfiM - end of Git Section
	#-------------DotFiM-------------#

	#-------------DotFiM-------------#
	# DotfiM - Local Section
	#  This section is only kept locally and will not be synced
	# - - - - - - - - - - -

	# Any stuff only locally applied

	# - - - - - - - - - - -
	# DotfiM - end of Local Section
	#-------------DotFiM-------------#

If you decide that you no longer want to sync the dotfile just do 
`dotfim remove <file>` and it'll remove the synced part and only 
leave the local section in place. Since all content of the synced 
section is already synced to the git repo, nothing should be lost.

- So, compared to Stow the git repository is organized as a 
"mirror" of the actual dotfile repository and not organized in 
packages.

- Lastly, DotfiM automatically syncs your changes to the dotfiles 
in the home folder when running `dotfim` and takes over all the 
fetching and pushing to the git repository.

How does Stow work when you already have an existing file and 
install another? Symlinking would delete the old file and just 
replace it with a symlink to the new file in the stow package?


Implementing something like profiles could be interesting, though 
I haven't had the need for it so far and therefore also didn't 
think of any strategy of implementing such a feature.


More information about the Digitalmars-d-announce mailing list