0xdevalias / dotfiles

devalias does dotfiles
http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/
MIT License
8 stars 1 forks source link

[sublime] Track Sublime Text preferences #2

Open 0xdevalias opened 7 years ago

0xdevalias commented 7 years ago
{
  "ignored_packages":
  [
    "Vintage"
  ],
  "scroll_past_end": true,
  "show_encoding": true,
  "show_line_endings": true,
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "trim_trailing_white_space_on_save": true,
  "copy_with_empty_selection": false,
  "ensure_newline_at_eof_on_save": true,
  "highlight_modified_tabs": true,
}
0xdevalias commented 3 years ago

We should make sure to capture this from the old laptop, and then merge that with setup on the new laptop + test if dotfiles auto setup is working as expected.

Looking at https://github.com/0xdevalias/dotfiles/blob/devalias/sublimetext/install.sh we're linking/tracking Preferences.sublime-settings, but looking on the filesystem, there seem to be other potentially useful files too:

⇒  ls ~/Library/Application\ Support/Sublime\ Text\ 3
 Cache/   Index/  'Installed Packages'/   Lib/   Local/   Packages/

⇒  ls ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages
 0_package_control_loader.sublime-package  'Package Control.sublime-package'  'Pretty JSON.sublime-package'

⇒  ls ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
User/

⇒  ls ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
'Package Control.cache'/  'Package Control.merged-ca-bundle'  'Package Control.sublime-settings'  'Package Control.user-ca-bundle'   Preferences.sublime-settings@   oscrypto-ca-bundle.crt

Based on this, I think we would want to at the very least capture Package Control.sublime-settings, or some data from it:

{
    "bootstrapped": true,
    "in_process_packages":
    [
    ],
    "installed_packages":
    [
        "Pretty JSON"
    ]
}

Could it be worth making this entire folder a symlink into our dotfiles directory, then using .gitignore to not track bits we don't want/need?


How do related issues such as https://github.com/0xdevalias/dotfiles/issues/1 fit in with this?


Is there anything worth saving from my (7+ years) old settings?


Other thoughts/questions:

0xdevalias commented 2 years ago

Could it be worth making this entire folder a symlink into our dotfiles directory, then using .gitignore to not track bits we don't want/need?

This was implemented in:

Some other interesting commits around the same time were:

0xdevalias commented 2 years ago

https://packagecontrol.io/docs/syncing

To properly sync your installed packages across different machines, you actually do not want to sync the whole Packages/ and Installed Packages/ folders. The reason for this is that some packages have different versions for different operating systems. By syncing the actual package contents across operating systems, you will possibly run into broken packages.

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. If this file is copied to another machine, the next time Sublime Text is started, Package Control will install the correct version of any missing packages.