Created
May 3, 2012 18:02
-
-
Save zszugyi/2587656 to your computer and use it in GitHub Desktop.
sublime_text2 plugin to add numbers to the selected locations in the current view
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, sublime_plugin | |
| class NumberSelections(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| selections = self.view.sel() | |
| for i in reversed(range(len(selections))): | |
| selection = self.view.sel()[i] | |
| self.view.insert(edit, selection.begin(), "%d" % (i + 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment