Overview

Let's talk about Sublime Text 4 settings sync.

Back in the day of my 6th-year article↓, I was still using Sync Settings to synchronize user settings across multiple devices.

The Sync Settings package is now UNMAINTAINED. With gratitude for its service, let's move on to the method officially recommended.

 

That would be this↓, the official Syncing page.

To properly sync your installed packages across different machines, you actually do not want to sync the whole Packages/ and Installed Packages/ folders.

The proper solution is to install Package Control on all machines and then to sync only the Packages/User/ folder. This folder contains the Package Control.sublime-settings file, which includes a list of all installed packages.

 

Here's the Strategy

  • Move the entire Packages/User folder to the cloud
  • In the actual Packages/User location, place a symbolic link to the cloud folder
  • The official document says not to sync the Installed Packages folder, but for various reasons, I'm syncing Package Control and the color theme
    • Reason 1: Sublime Text 4's Package Control has bugs, so it's necessary to use a custom Package Control.sublime-package
    • Reason 2: Since I'm using a color theme available through Package Control, that theme is specified in the user settings. To prevent Sublime from throwing errors like "that theme isn't installed," it's necessary to have the Theme - Nexus.sublime-package in place

 

What to Do When Starting Sublime on a New Device

Every time I clean install a device, I run the following to sync settings.

# First, open Sublime. (Creates ~/Library/Application Support/Sublime Text)

# Navigate to the folder where SublimeTextUserSettings is located.

# Connect SublimeTextUserSettings and Packages/User/ with a symbolic link.
# Note that for Sublime Text 3, it's Sublime Text 3/Packages/User, not
# Sublime Text/Packages/User. Pay attention.
CURRENT_PATH=$(pwd)
rm -r "$HOME/Library/Application Support/Sublime Text/Packages/User"
ln -sf "$CURRENT_PATH/SublimeTextUserSettings" "$HOME/Library/Application Support/Sublime Text/Packages/User"

# Manually install Package Control and Theme - Nexus.
# Package Control: The default Package Control is broken, so I get a working one.
#                  https://github.com/wbond/package_control/issues/1612
#                  https://qiita.com/Cova8bitdot/items/c09f6b3401fa8a0915e6
cp "$CURRENT_PATH/Package Control.sublime-package" "$HOME/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package"
# Since Nexus is mentioned in UserSettings, but installing Nexus beforehand prevents errors, so it's installed first.
cp "$CURRENT_PATH/Theme - Nexus.sublime-package" "$HOME/Library/Application Support/Sublime Text/Installed Packages/Theme - Nexus.sublime-package"

# Open Sublime again. (Packages get installed in Installed Packages)

That's about it.