OverrideAudit icon indicating copy to clipboard operation
OverrideAudit copied to clipboard

[FEATURE] Simplify overrides synchronization

Open AAWO opened this issue 2 years ago • 5 comments

Summary

When using Sublime Text with OverrideAudit on multiple computers, the package overrides need to be recreated manually on each machine. The overrides can potentially be synchronized with user settings. It can be done by storing the actual package overrides in the subfolder inside the User/ directory (i.e. User/package overrides/) and creating a symlink in the Packages/ directory.

Expected Behavior

  • Store the overrides in the User/ directory in order to allow them to be synchronized with the User/ folder (the actual synchronization is left for the user)
  • Automatically detect (or via some refresh command) new overrides (synchronized from other computer) and create a symlink in the Packages/ directory

Extra information

Files in subfolders of the User/ are ignored by Sublime Text. This feature, along with symlinks technique suggested for synchronization using Dropbox can be used to synchronize the overrides across multiple computers.

The suggested files and folders structure:

Packages/
   *symlink to example package 1 override*/
   *symlink to example package 2 override*/
   User/
      package overrides/
         *example package 1 override*/
            overriden files
         *example package 2 override*/
            overriden files

I have tested such configuration and it seems to work without any issues.

AAWO avatar Apr 30 '22 10:04 AAWO

Files in subfolders of the User/ are ignored by Sublime Text.

Are you absolutely sure about that? (Hint: JS Custom is proof that they are not. Sure, Python files are technically ignored, but that doesn't help for syntax overrides, tmPreferences, menus etc.)

keith-hall avatar Apr 30 '22 20:04 keith-hall

There is a currently in progress feature (though it has been a bit since I had time to work on it) wherein there would be an added command that allows you generate a patch file that conveys information about every override in every package or just a single package, which you could move to another machine and have OverrideAudit apply to get the original overrides back.

OdatNurd avatar Apr 30 '22 20:04 OdatNurd

Also, indeed the only special thing about the User package as opposed to other packages is that the contents of it are always loaded last, and that in ST~~4~~ it always runs in the 3.8 plugin host.

The fact that plugins don't load from anything other than the root is not special to the User package, as Keith mentioned; that's just how packages work.

Most importantly, you can't override package files by putting them in the User package; what you're doing is adding another resource that also gets loaded. In some cases that will appear to work, such as a plugin in the User package that defines a command with the same name as that from another package, because the User package always loads last. However you would notice that trying to "override" the menu in this fashion, it won't work.

OdatNurd avatar Apr 30 '22 20:04 OdatNurd

It's great to know you are already working on such a feature. Thank you both for the detailed explanation as well.

AAWO avatar May 01 '22 09:05 AAWO

As for an alternative to manage overrides on multiple machines, I synchronize a small repository of files that I symlink into my HOME folder using stow that is not specific to ST but has proved to be quite helpful and sufficient in power for the purpose. I also have some overrides in that.

See https://github.com/FichteFoll/dotfiles/tree/master/sublime-text/.config/sublime-text/Packages for the actual configs.

FichteFoll avatar Jun 27 '22 09:06 FichteFoll