The commands that are used for this new functionality are edit_settings
and edit_syntax_settings
, both of which are stored (along with support code) in Packages/Default/settings.py
. Note however that (at least currently) edit_syntax_settings
invokes edit_settings
to do it’s job, so you really only need to worry about the one command.
A plugin like the following can be used to detect when this command is either just about to happen or has just finished happening:
import sublime
import sublime_plugin
class SampleListener(sublime_plugin.EventListener):
def on_window_command(self, window, command, args):
if command == "edit_settings":
print ("About to execute " + command)
def on_post_window_command(self, window, command, args):
if command == "edit_settings":
print ("Finished executing " + command)
The documentation for these events only mentions that they trigger on the execution of a WindowCommand
and the edit_settings
is defined as an ApplicationCommand
but this still works. I don’t know if that is an omission in the documentation or a bug in sublime or what, though.