Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sublime] Track Sublime Text preferences #2

Open
0xdevalias opened this issue Aug 18, 2017 · 3 comments
Open

[sublime] Track Sublime Text preferences #2

0xdevalias opened this issue Aug 18, 2017 · 3 comments
Assignees

Comments

@0xdevalias
Copy link
Owner

0xdevalias commented Aug 18, 2017

{
  "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
Copy link
Owner Author

0xdevalias commented Sep 25, 2020

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 #1 fit in with this?


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


Other thoughts/questions:

@0xdevalias 0xdevalias changed the title [sublime] Add preferences [sublime] Track Sublime Text preferences Sep 25, 2020
@0xdevalias
Copy link
Owner Author

0xdevalias commented Jul 5, 2022

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:

  • 899c4c3: [sublimetext] refactor install.sh to symlink entire user settings folder + use sublpm to install Package Control by default

Some other interesting commits around the same time were:

  • 81e0bb6: [bin] add sublpm 'Sublime Text Package Manager' helper script
  • b64032f: [bin] add Sublime Text package list to brew-lists using sublpm helper script

@0xdevalias
Copy link
Owner Author

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.

@0xdevalias 0xdevalias self-assigned this Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant