问题
Sometimes I install a new sublime package and a new directory gets added to the /Users/max/Library/Application Support/Sublime Text 3/Packages
directory, which I like because I can use a bookmark with FuzzyFileNav and quickly browse the default .sublime-settings
and .sublime-key
files to get my bearings about what is going on with this package. However sometimes there is no entry added, as shown below (ironically with FuzzyFileNav)
So then the way I would find the .sublime-settings
and .sublime-keymap
files is to use the dropdown menu in sublime also shown below:
What I'm wondering is:
- Why do some packages add entries to my Packages directory and other don't?
- If there is no entry in Packages then where do the package specific
.sublime-settings
and.sublime-keymap
files live?
My main goal is to be able to quickly navigate between my User and Default settings but it makes it hard when I'm feeling like Hansel and wondering where'd all the files go...you know :)
One workaround that might work is to copy all the Default .sublime-settings
and .sublime-keymap
files that don't live in the Packages directory and put them in the User directory and rename them to PackageName.sublime-settings
and PackageName.sublime-keymap
and then I'll be able to browse them anyways because I also have a bookmark to User. I think that would work because it would overwrite all the Default settings (that live somewhere) with all the exact same settings. Or maybe I could do that same thing except put the files in the Default directory; however, from what I've been reading it's bad form to modify the Default directory. Obviously the most ideal thing would be to just figure out where the heck these files are.
回答1:
Sublime Text uses different folder locations for different kinds of packages. For instance, all packaged files install to Installed Packages
and are self-contained in a standard Zip file using the file extension .sublime-package
. When a package includes a file .no-sublime-package
, the package will be extracted. All extracted packages are stored in the Packages
folder.
Settings and keymaps are stored within both packed and unpacked packages. Those can be overruled/extended by saving them to Packages/User
.
Detailed information on package locations and hierarchy can be found in the Package Control documentation.
回答2:
idleberg's answer contains a good explanation of why you were unable to find .sublime-package
files & unpackaged files in the same location.
The following information details an alternative method you can use to navigate all package files, whether packed or unpacked.
All of SublimeTexst's installed package files can be navigated and edited via PackageResourceViewer's PackageResourceViewer: Open Resource
command.
Any files that are edited from a .sublime-package
file will have a new instance created at Packages/PackageName
. The new file will now override the original file ( which still exists in the .sublime-package
file ). The original file can be reactivated by deleting the edited file.
Files edited from an unpacked package will be affected directly.
If both packaged & unpackaged instances of a file exist, PackageResourceViewer
will open the unpackaged instance.
来源:https://stackoverflow.com/questions/37167919/where-do-some-sublime-packages-and-default-settings-go