I would like to bind a command to get the following string:
- ] | {2012-10-05}
(The | represents the position of the caret.)
This can’t be done with a snippet because the date has to be dynamic. I’m no programmer, but I’ve been messing around with the itodo plugin to arrive at what I want:
line_contents = '- ] \t{%s}' % datetime.now().strftime("%Y-%m-%d")
self.view.insert(edit, line.begin(), line_contents)
This is quite close but I would like the caret to be after the “checkbox” (the square bracekts). Any pointers?
P.S. Sorry if this has been answered before. I recall reading similar questions, but I couldn’t find an answer to the specific issue I’m having.
Edit: added a parenthetical explanation.