Sublime Text plugin to increment numbers in selection
import sublime
import sublime_plugin
class IncrementSelectionCommand(sublime_plugin.TextCommand):
def run(self, edit):
s = self.view.substr(self.view.sel()[0])
start_value = int(s)
length = len(s)
counter = 0
for selection in self.view.sel():
self.view.insert(edit, selection.begin(), str(start_value+counter).zfill(length))
counter = counter + 1
for selection in self.view.sel():
self.view.erase(edit, selection)