Using the Cloud to Sync Dotfiles (without using symlinks)
Updated 2021-December-19

Page contents

News

2021-December-1  Published this evolving⁠[1] article.

Prerequisites

In this section I discuss some terminology and naming conventions that I use.

 

Terminology

Traditionally a dotfile was a configuration file whose name started with a dot (.), for example:

  • .bashrc

  • .bash_profile

  • .vimrc

Nowadays the word dotfile is often used to mean any configuration file, and that is the meaning that I use in this article.

 

The trailing rc in .bashrc and .vimrc means “run commands.” Details are at wikipedia.org/wiki/Rc.

 

My directory and file naming conventions

I use the following naming conventions.

Naming Convention Example(s)

Most directory names start with an upper case character and sometimes use PascalCase.

DotFiles
Vim

Most file names use all lower case characters.

vimrc.vim

A directory or file name that I want listed near the top of an alphanumeric sort starts with an underscore (_).

_README.txt

A directory or file name that I want to be really noticeable is in all caps.

_README.txt

 

How I synchronize my dotfiles

As I wrote about in My Primary Cloud Storage Provider is sync.com⁠☁️, I use sync.com[2] to synchronize files across my devices. This section describes how I synchronize some of my dotfiles.

 

First, create a DotFiles directory

In my Sync[3] directory, I create a directory named DotFiles.

 

Vim’s vimrc

Vim is a plain text editor that is available on many operating systems, including Li⁠nux, macOS, and Windows. For more information, see…

Below is how I set up my systems to synchronize some of my Vim settings across my devices.

 

  1. In my Sync/DotFiles directory, I create a directory named Vim.

  2. In this Sync/DotFiles/Vim directory, I create a file named vimrc.vim that contains my cross-⁠device Vim settings.

  3. On each of my devices, in Vim’s default vimrc file (for example ~/VimFiles/vimrc[4] on Windows), I put something like this line:

    source $USERPROFILE/Sync/DotFiles/Vim/vimrc.vim
           ~~~~~~~~~~~~
           works on my Windows devices

    To learn about the above source command, run :help source from within Vim.

  4. Let the cloud storage provider (Dropbox, Filen, sync.com, etc.) synchronize this file across my devices.

  5. Launch Vim on each of my devices and make sure this shared vimrc.vim file is sourced and works.

  6. Celebrate.🎉

 

💡

To help my future self remember how I’ve set things up, I create a README file that describes the above steps, especially step 3. Here is a fragment of my directory structure:

~
└── Sync/
    └── DotFiles/
        └── Vim/
            ├── _README.txt
            └── vimrc.vim

 

 

qutebrowser’s config.py

qutebrowser is a Chromium-based web browser that is available on many operating systems, including Li⁠nux, macOS, and Windows. Details are on Infinite Ink’s #qutebrowser Portal.

Below is how I set up my systems to synchronize some of my qutebrowser settings across my devices.

 

  1. In my Sync/DotFiles directory, I create a directory named Qutebrowser.

  2. In this Sync/DotFiles/Qutebrowser directory, I create a file named config-shared.py that contains my cross-⁠device qutebrowser settings.

  3. On each of my devices, in qutebrowser’s default config.py (for example ~/AppData/Roaming/qutebrowser/config/config.py on Windows), I put something like this line:

    config.source('C:/Full/Path/To/Sync/DotFiles/Qutebrowser/config-shared.py')

    To learn about this, see Infinite Ink’s qutebrowser Tips and Fragments.

  4. Let the cloud storage provider (Dropbox, Filen, sync.com, etc.) synchronize this file across my devices.

  5. Launch qutebrowser on each of my devices and make sure this config-shared.py file is sourced and works.

  6. Celebrate.🎉

 

💡

To help my future self remember how I’ve set things up, I create a README file that describes the above steps, especially step 3. Here is a fragment of my directory structure:

~
└── Sync/
    └── DotFiles/
        └── Qutebrowser/
            ├── _README.txt
            └── config-shared.py

 

See also

Endnotes


1. Many Infinite Ink articles, including this one, are evergreen and regularly updated.
2. This link to sync.com is a referral link. If you use this link to sign up, both you and I will get a free extra gigabyte of storage.👏
3. The name of this directory depends on the cloud storage provider. Possible names include Dropbox, Filen Sync, and Sync.
4. Since Windows’ file system is case insensitive, naming this default Vim directory VimFiles, rather than all lower case vimfiles, works.

Comments and questions 📝 👍 👎 🤔

Your public comment or question might immediately improve this page or help me to (eventually) improve this page.