Last active
April 2, 2016 05:18
-
-
Save khairulhasanmd/a7e15852ff7fbc41cc457363c7dab36c to your computer and use it in GitHub Desktop.
incremental selection sublime
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
in Tools/New Plugin...:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
import sublime, sublime_plugin | |
class IncrementSelectionCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
start_value = int(self.view.substr(self.view.sel()[0])) | |
counter = 0 | |
for selection in self.view.sel(): | |
self.view.insert(edit, selection.begin(), str(start_value + counter)) | |
counter = counter + 1 | |
for selection in self.view.sel(): | |
self.view.erase(edit, selection) | |
IN Key Bindings - User:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
{ "keys": ["ctrl+alt+i"], "command": "increment_selection" }, | |
from | |
http://stackoverflow.com/questions/14574941/add-a-number-to-each-selection-in-sublime-text-2-incremented-once-per-selection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment