C:\Users\USERNAME\Sync\DotFiles
In this section, I discuss terminology, naming conventions, and path separators.
Traditionally
a
dotfile
was
a
configuration file whose name started with
a dot (.
), for example:
.bashrc
.bash_profile
.vimrc
Nowadays it’s common to use the word dotfile to mean any configuration file and that’s the meaning I use in this article.
ℹ | The trailing rc in
.bashrc
and
.vimrc
means
“run commands.”
Details are at
wikipedia.org/wiki/Rc. |
I use the following naming conventions.
Naming Convention | Example(s) |
---|---|
Most directory names start with an upper case character and sometimes use PascalCase.[2] |
|
Most file names use all lower case characters. |
|
A directory or file name that I want
listed near the top of an
alphanumeric sort
starts with an underscore ( |
|
A directory or file name that I want to be really noticeable is in all caps. |
|
In the scenarios below,
the
Windows path separator can be either
backslash (\
)
or
forward slash (/
).
To learn about this, see:
ℹ | Forward slash is also known as slash. |
This section describes how I use sync.com[3] to synchronize some of my dotfiles. This strategy should work with Dropbox and other file synchronization services.
DOTFILESDIR
environment variableSince the path to my DotFiles
directory
is different on
different devices,
I create a
DOTFILESDIR
environment variable
on each device.
For example, on one of my Windows devices
$DOTFILESDIR
is:
C:\Users\USERNAME\Sync\DotFiles
And on another one of my Windows devices, it’s:
D:\Sync\DotFiles
Vim is a plain text editor that is available on many operating systems, including Linux, macOS, and Windows. For more about Vim and its dotfiles, see…
Infinite Ink’s #vim Portal
and
:help vimrc
.
Below is how I set up my systems to synchronize some Vim settings across my devices.
In my Sync/DotFiles
directory,
I create a directory named Vim
.
In this Sync/DotFiles/Vim
directory,
I
create
a file named vimrc.vim
that contains my
cross-device
Vim
settings.
On each of my devices,
in
Vim’s default vimrc file[5]
(for example
~/VimFiles/vimrc
[6]
on Windows),
I
put something like this
line:
source $USERPROFILE/Sync/DotFiles/Vim/vimrc.vim ~~~~~~~~~~~~ works on my Windows devices
Or, if I’ve defined $DOTFILESDIR
, something like this:
source $DOTFILESDIR/Vim/vimrc.vim
To learn about the source
command,
run
:help source
from
within Vim.
Let the cloud storage provider (Dropbox, Filen, sync.com, etc.) synchronize this file across my devices.
Launch Vim on each of my devices and make sure this
shared vimrc.vim
file is sourced and works.
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 is a Chromium-based web browser that is available on many operating systems, including Linux, 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.
In my Sync/DotFiles
directory,
I create a directory named Qutebrowser
.
In this Sync/DotFiles/Qutebrowser
directory,
I
create
a file named config2.py
that contains my
cross-device
qutebrowser
settings.
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/config2.py')
To learn about this, see Infinite Ink’s qutebrowser Tips and Fragments.
Let the cloud storage provider (Dropbox, Filen, sync.com, etc.) synchronize this file across my devices.
Launch qutebrowser on each of my devices and make sure this
config2.py
file is sourced and works.
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 └── config2.py |
For more about backup and sync, see Infinite Ink’s…
Dropbox
, Filen Sync
, and Sync
.:version
command to view a list of possible default vimrc
files and the :echo $MYVIMRC
command to find out the current vimrc
file.VimFiles
, rather than all lower case vimfiles
, works.@nm@mathstodon.xyz
or
#InfiniteInk
in it.