To override Sublime Text unpacked packages every Sublime Text start. You can also call the command
OverrideUnpackedPackages: Now on the command palette.
To select the file to override,
just creates them on the folder Packages/User/OverrideUnpackedPackages following the packages file structure.
For example,
if you want to override the file:
Packages/amxmodx/Main.sublime-menu
You need to create the replacement file on the folder:
Packages/User/OverrideUnpackedPackages/amxmodx/Main.sublime-menu
Then run the command OverrideUnpackedPackages Now on the command palette or just restart Sublime
Text.
To allow you override default menu as files .sublime-menu, you will need to rename the files you
put on the folder OverrideUnpackedPackages to .sublime-menu.hide. This way Sublime Text
will not double load your menus.
When the OverrideUnpackedPackages will perform the override, it will rename them back to their
original names as the .sublime-menu mentioned just above.
Other packages can import OverrideUnpackedPackages and add files to be copied and overridden.
This is a simple example:
import os
try:
from OverrideUnpackedPackages.override_unpacked_packages import add_folder_to_processing_queue
except ImportError as error:
print( "Error: Could not import the package `OverrideUnpackedPackages`, please install the package. " + str( error ) )
def add_folder_to_processing_queue(*args):
print( "add_folder_to_processing_queue could not add the following arguments..." )
for arg in args:
print( str( arg ) )
PACKAGE_ROOT_DIRECTORY = os.path.dirname( os.path.realpath( __file__ ) )
def plugin_loaded() :
add_files_to_copy_list()
def add_files_to_copy_list():
add_folder_to_processing_queue( PACKAGE_ROOT_DIRECTORY, "amxmodx", 100 )This some code also works when the package is inside a .sublime-package file. This is
automatically detected by OverrideUnpackedPackages when the PACKAGE_ROOT_DIRECTORY is set to the
folder .sublime-package. Therefore the file is unzipped, instead of just copied.
- Download & Install
Sublime Text 3(https://www.sublimetext.com/3) - Go to the menu
Tools -> Install Package Control, then, wait few seconds until the installation finishes up - Now,
Go to the menu
Preferences -> Package Control - Type
Add Channelon the opened quick panel and press Enter - Then,
input the following address and press Enter
https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json - Go to the menu
Tools -> Command Palette... (Ctrl+Shift+P) - Type
Preferences: Package Control Settings – Useron the opened quick panel and press Enter - Then,
find the following setting on your
Package Control.sublime-settingsfile:"channels": [ "https://packagecontrol.io/channel_v3.json", "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json", ],
- And,
change it to the following, i.e.,
put the
https://raw.githubusercontent...line as first:"channels": [ "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json", "https://packagecontrol.io/channel_v3.json", ],
- The
https://raw.githubusercontent...line must to be added before thehttps://packagecontrol.io...one, otherwise, you will not install this forked version of the package, but the original available on the Package Control default channelhttps://packagecontrol.io...
[!WARNING] Placing this custom channel before the default channel changes Package Control's resolution globally. Packages from this channel with the same name will override versions from the default channel.
You can review the channel contents here: https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json
- The
- Now,
go to the menu
Preferences -> Package Control - Type
Install Packageon the opened quick panel and press Enter - Then,
search for
OverrideUnpackedPackagesand press Enter
See also:
- ITE - Integrated Toolset Environment
- Package control docs for details.
All files in this repository are released under GNU General Public License v3.0 or the latest version available on http://www.gnu.org/licenses/gpl.html
- The LICENSE file for the GPL v3.0 license
- The website https://www.gnu.org/licenses/gpl-3.0.en.html
For more information.