I’d like to insert “Hello, World!” and move the cursor just before the “World” programmatically.
I tried specifying the cursor position by “$0” but it didn’t work.
import sublime, sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, self.view.sel()[0].begin(), "Hello, $0World!")
How do I specify where to put the cursor in a string?