This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| _types = { | |
| "IDII": 7, | |
| "SEDOL": 7, | |
| "DATE": 7, | |
| "TYPE": 1 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class BookmarkEventListener(sublime_plugin.EventListener): | |
| def toggle_bookmarks(self, view, point): | |
| # Get existing bookmarks and create a region for the new one | |
| bookmarks = view.get_regions("bookmarks") | |
| new = sublime.Region(point) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| [ | |
| // If you use the Chain of Command package, use this binding to chain | |
| // the two required commands together. | |
| { "keys": ["ctrl+shift+h"], "command": "chain", | |
| "args": { | |
| "commands": [ | |
| ["terminus_close"], | |
| ["destroy_pane", {"direction": "self"}] | |
| ] | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class ExpandAndFoldSnippetCommand(sublime_plugin.TextCommand): | |
| def run(self, edit, name, folds): | |
| self.view.run_command("insert_snippet", {"name": name}) | |
| for _ in range(folds): | |
| self.view.run_command("fold") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { "caption": "Developer: Open API Files", "command": "open_api_files" }, | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class ReverseSelectAllCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| span = sublime.Region(len(self.view), 0) | |
| self.view.sel().add(span) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class DoFindReplaceCommand(sublime_plugin.TextCommand): | |
| """ | |
| Find all instances of the search text and replace it with the replacement | |
| text provided. The arguments allow you to decide if the command should be a | |
| regular expression (the default) or just plain text, and whether or not | |
| case should be ignored or not (by default it is not). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class ExampleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| self.view.insert(edit, 0, "Hello, World!") | |
| class SecondExampleCommand(sublime_plugin.TextCommand): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class RegionExampleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit, example): | |
| if example == "1": region = sublime.Region(0, 10) | |
| elif example == "2": region = sublime.Region(10, 20) | |
| elif example == "3": region = sublime.Region(5) | |
| elif example == "4": region = self.view.word(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| class CustomContextEventListener(sublime_plugin.EventListener): | |
| """ | |
| This event is raised when Sublime sees a key binding context key it does not | |
| recognize. | |
| """ | |
| def on_query_context(self, view, key, operator, operand, match_all): |