Skip to content

Instantly share code, notes, and snippets.

View nielsiano's full-sized avatar
💭
(┛ಠ_ಠ)┛彡┻━┻

Niels Stampe nielsiano

💭
(┛ಠ_ಠ)┛彡┻━┻
View GitHub Profile
import sublime
import sublime_plugin
class NumberCommand(sublime_plugin.TextCommand):
def run(self, edit):
selection = self.view.sel()
for region in selection:
try:
value = int(self.view.substr(region))
self.view.replace(edit, region, str(self.op(value)))