Where does sublime store themes?

2020-05-19 06:59发布

I've installed itg.flat for sublime via the package manager. I'm wanting to make a few edits to theme but I can't find where package manager has installed the theme files. I'm using ST3 on OS X Mavericks

I've had a look around the net but haven't found anything relating specifically to what I'm after so a SO thread is a last resort.

3条回答
SAY GOODBYE
2楼-- · 2020-05-19 07:24

Additional notes and what I've found:

Thank you all for the notes. What my portable install looks like (in location):

  • C:\Users\xxxxxx\Downloads\Sublime Text Build 3065 x64\Packages\Color Scheme - Default.sublime-package

What you're looking for:

  • It's the Color Scheme - Default.sublime-package
查看更多
我只想做你的唯一
3楼-- · 2020-05-19 07:32

Sublime Text 3 packages installed via Package Control are by default stored as .sublime-package zip files in your Packages directory, whose location depends on your operating system:

  • Linux: ~/.config/sublime-text-3/Packages
  • OS X: ~/Library/Application Support/Sublime Text 3/Packages
  • Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages
  • Windows Portable Install: InstallationFolder\Sublime Text 3\Data\Packages

The easiest way to edit them is to install PackageResourceViewer from Package Control. Once installed, open the Command Palette with ShiftP (OS X) or CtrlShiftP (Windows/Linux) and type in prv to access the PackageResourceViewer options.

Select Extract Package, then scroll down to Theme - itg.flat and hit Enter. This will extract the package into your Packages folder, which can be easily accessed via your operating system's file manager (Finder, Windows Explorer, Nautilus, etc.) by selecting Sublime Text → Preferences → Browse Packages… (this is for OS X, Windows and Linux have a separate Preferences menu). Any edits to the files in this directory will override the files contained in the Installed Packages/Theme - itg.flat.sublime-package file.

If you only wish to edit a single file, after typing prv into the Command Palette, chose PackageResourceViewer: Open Resource instead. You can then navigate through your packages and choose the file(s) you wish to edit - Theme - itg.flat/itg.flat.dark.sublime-theme, for example. Once you edit the file(s) you have chosen, they will be saved in the Packages directory,

However, please keep in mind that if the package is updated in the future, the changes will not apply because you've overridden them by extracting the files into Packages. This is not quite the case if you choose Open Resource - only the files you chose to edit and save will be stored in Packages, and they will override the identically-named file in the .sublime-package archive. If the package is updated in the future, the file(s) containing your edits will still override the same file(s) in the archive, but the rest of the files will be updated. For example, if you edit itg.flat.dark.sublime-theme via Open Resource, when the entire Theme - itg.flat is updated, your customized file will override the file of the same name in the package archive, but all other files will have the changes from the update applied.

查看更多
放荡不羁爱自由
4楼-- · 2020-05-19 07:47

In st3 you can override packages by creating a same-name folder under ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/

For example, if you want to override the default theme:

  • Open contents of Sublime Text.app (right clic > show package content), locate Contents/MacOS/Packages/Theme - Default.sublime-package

  • .sublime-package files are zip, so copy the file somewhere outside, unzip it, locate the Default.sublime-theme file. It's json.

  • Do your edits to the file

  • Navigate to ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/, create a 'Theme - Default' folder

  • Copy your Default.sublime-theme into the folder you just created

Done. Any edits you'll do to Default.sublime-theme will be auto-loaded in your current theme, no need to restart ST.

For reference:

https://www.sublimetext.com/docs/3/packages.html

查看更多
登录 后发表回答