nvALT now understands GitHub-style task lists. A checkbox is just text in the note, the editor treats it like a task, and the preview draws it as one.
Make a task
Put the cursor on a line and press Option-Command-T. The same command is Task in the editor’s Format menu.
A plain line turns into a task:
- [ ] mail the contract
If the line is already a list item, the checkbox lands after the marker you already used:
* [ ] call mom
1. [ ] book the train
Press the shortcut again and the checkbox goes away. - [ ] mail the contract goes back to - mail the contract.
Check it off
Click the space between the brackets. A space becomes x, and x becomes a space again.
- [x] mail the contract
A finished task is crossed out in the editor. The marker and the checkbox stay plain, so you can still see where to click.
Keep going
Return at the end of a task starts the next line as a new open task:
- [x] mail the contract
- [ ]
A numbered task keeps counting, so 1. [ ] book the train is followed by 2. [ ] .
Return on an empty checkbox clears that line instead of adding another one. Same idea as hitting Return on a bare - .
In the preview
Apex (which runs the nvALT preview now) already understands GitHub chekboxes. The preview renders these as real checkboxes. A completed item shows up checked and crossed out. Clicking still happens in the editor. The preview is just there to read.
TaskPaper-Style
This isn’t new, but nvALT also recognizes @done tags and will strike through any line containing them, so you can use TaskPaper formatting and get a workable task list. There are currently no shortcuts for toggling a task finished. I would have liked to use ⌘+D for that, but it’s already assigned to “Deselect Note” and I’m not sure how many people already use that instinctively. I’ll toy with it.