Sublime Forum

Overwritting a default package. With a twist

#1

Hey guys. Up until this point, I could bet that you could overwrite a default package by having a structure like this (assuming you want to overwrite some PHP parts):

Packages\User\PHP\Snippets\class-{-}.sublime-snippet

However… it seems that if you have a Packages\PHP\Snippets\class-{-}.sublime-snippet… it doesn’t overwrite it. Which is a bit odd if you’d like to use git packages but also having some customisations.

0 Likes

#2

Overrides have to be in a folder with the same name as the .sublime-package, and the same path structure thereunder. For example:

PHP.sublime-package\Snippets\class-{-}.sublime-snippet would need to be overridden by a file named Packages\PHP\Snippets\class-{-}.sublime-snippet. You are correct that using git-based package (or any unpacked packages) does not allow for overrides.

With git you could maintain your own branch and rebase your changes on top of the master branch, if you want to achieve something similar.

The User folder comes into play when loading settings and keymaps. It is loaded last, so settings set in .sublime-settings in there will overwrite settings from packages.

2 Likes

#3

I was hoping for somethign more… portable without having to fork the whole packages, make symlinks & such. (i.e. being on git packages on one machine, on stable packages on another).

But rebasing sounds good for now. Thanks!

0 Likes