sublime

ST2



ST3



active_window ST2≠3

ST2 active_window() # => Window

Returns the most recently used window.



ST3 active_window() # => Window

Returns the most recently used window.



arch ST2≠3

ST2 arch() # => String

Returns the CPU architecture, which may be "x32" or "x64"



ST3 arch() # => str

Returns the CPU architecture, which may be "x32" or "x64"



cache_path ST3

ST3 cache_path() # => str

Returns the path where Sublime Text stores cache files.



decode_value ST3

ST3 decode_value(string) # => value

Decodes a JSON string into an object. If the string is invalid, a ValueError will be thrown.



encode_value ST3

ST3 encode_value(value, <pretty>) # => str

Encode a JSON compatible value into a string representation. If pretty is set to True, the string will include newlines and indentation.



error_message ST2&3

ST2&3 error_message(string) # => None

Displays an error dialog to the user.



expand_variables ST3

ST3 expand_variables(value, variables) # => value

Expands any variables in the string value using the variables defined in the dictionary variables. value may also be a list or dict, in which case the structure will be recursively expanded. Strings should use snippet syntax, for example: expand_variables("Hello, ${name}", {"name": "Foo"})



find_resources ST3

ST3 find_resources(pattern) # => [str]

Finds resources whose file name matches the given pattern.



get_clipboard ST2≠3

ST2 get_clipboard() # => String

Returns the contents of the clipboard.



ST3 get_clipboard(<size_limit>) # => str

Returns the contents of the clipboard. size_limit is there to protect against unnecessarily large data, defaults to 16,777,216 characters



installed_packages_path ST2≠3

ST2 installed_packages_path() # => String

Returns the path where all the user's *.sublime-package files are.



ST3 installed_packages_path() # => str

Returns the path where all the user's .sublime-package files are located.



load_binary_resource ST3

ST3 load_binary_resource(name) # => bytes

Loads the given resource. The name should be in the format Packages/Default/Main.sublime-menu.



load_resource ST3

ST3 load_resource(name) # => str

Loads the given resource. The name should be in the format Packages/Default/Main.sublime-menu.



load_settings ST2≠3

ST2 load_settings(base_name) # => Settings

Loads the named settings. The name should include a file name and extension, but not a path. The packages will be searched for files matching the base name, and the results will be collated into the settings object. Subsequent calls to load_settings with the name base_name will return the same object, and not load the settings from disk again.



ST3 load_settings(base_name) # => Settings

Loads the named settings. The name should include a file name and extension, but not a path. The packages will be searched for files matching the base_name, and the results will be collated into the settings object. Subsequent calls to load_settings() with the base_name will return the same object, and not load the settings from disk again.



log_commands ST2&3

ST2&3 log_commands(flag) # => None

Controls command logging. If enabled, all commands run from key bindings and the menu will be logged to the console.



log_input ST2&3

ST2&3 log_input(flag) # => None

Controls input logging. If enabled, all key presses will be logged to the console.



log_result_regex ST3

ST3 log_result_regex(flag) # => None

Controls result regex logging. This is useful for debugging regular expressions used in build systems.



message_dialog ST2&3

ST2&3 message_dialog(string) # => None

Displays a message dialog to the user.



ok_cancel_dialog ST2≠3

ST2 ok_cancel_dialog(string, <ok_button>) # => bool

Displays an ok / cancel question dialog to the user. If ok_button is provided, this may be used as the text on the ok button. Returns True if the user presses the ok button.



ST3 ok_cancel_dialog(string, <ok_title>) # => bool

Displays an ok / cancel question dialog to the user. If ok_title is provided, this may be used as the text on the ok button. Returns True if the user presses the ok button.



packages_path ST2≠3

ST2 packages_path() # => String

Returns the base path to the packages.



ST3 packages_path() # => str

Returns the path where all the user's loose packages are located.



platform ST2≠3

ST2 platform() # => String

Returns the platform, which may be "osx", "linux" or "windows"



ST3 platform() # => str

Returns the platform, which may be "osx", "linux" or "windows"



run_command ST2≠3

ST2 run_command(string, <args>) # => None

Runs the named ApplicationCommand with the (optional) given arguments.



ST3 run_command(string, <args>) # => None

Runs the named ApplicationCommand with the (optional) given args.



save_settings ST2&3

ST2&3 save_settings(base_name) # => None

Flushes any in-memory changes to the named settings object to disk.



score_selector ST2≠3

ST2 score_selector(scope, selector) # => Int

Matches the selector against the given scope, returning a score. A score of 0 means no match, above 0 means a match. Different selectors may be compared against the same scope: a higher score means the selector is a better match for the scope.



ST3 score_selector(scope, selector) # => int

Matches the selector against the given scope, returning a score. A score of 0 means no match, above 0 means a match. Different selectors may be compared against the same scope: a higher score means the selector is a better match for the scope.



set_clipboard ST2&3

ST2&3 set_clipboard(string) # => None

Sets the contents of the clipboard.



set_timeout ST2≠3

ST2 set_timeout(callback, delay) # => None

Calls the given callback after the given delay (in milliseconds). Callbacks with an equal delay will be run in the order they were added. It is safe to call setTimeout from multiple threads.



ST3 set_timeout(callback, delay) # => None

Runs the callback in the main thread after the given delay (in milliseconds). Callbacks with an equal delay will be run in the order they were added.



set_timeout_async ST3

ST3 set_timeout_async(callback, delay) # => None

Runs the callback on an alternate thread after the given delay (in milliseconds).



status_message ST2

ST2 status_message(string) # => None

Sets the message that appears in the status bar.



version ST2≠3

ST2 version() # => String

Returns the version number



ST3 version() # => str

Returns the version number



windows ST2≠3

ST2 windows() # => [Window]

Returns a list of all the open windows.



ST3 windows() # => [Window]

Returns a list of all the open windows.



yes_no_cancel_dialog ST3

ST3 yes_no_cancel_dialog(string, <yes_title>, <no_title>) # => int

Displays a yes / no / cancel question dialog to the user. If yes_title and/or no_title are provided, they will be used as the text on the corresponding buttons on some platforms. Returns sublime.DIALOG_YES, sublime.DIALOG_NO or sublime.DIALOG_CANCEL.




Generated from the official documentation on Sat Oct 29 20:16:51 EEST 2016 by Leonid Shevtsov.