I have multiple linux machine. I want to share my .vimrc, .hgrc. But, there are a little difference between different machines. Is there smart method?
I’m using mercurial.
mkdir settings
ln ~/.vimrc settings/vimrc
ln ~/.hgrc settings/hgrc
then use mercurial to keep settings.
There are a little difference of hgrc file on different machine.
I require to branch merge always.
I’m wonder is there better method?
What I typically do is have a .bashrc, etc. file that is common on all systems, and then I source a local version called
.bashrc.localor something like that, that doesn’t get saved in source control with the machine specific settings.In .bashrc:
In .vimrc
etc.
If you want to get fancy you can store your local settings files in source control by using your hostname as a discriminator on the local file name. So instead of
.vimrc.localyou could do.vimrc.machine1.local, etc.