When submitting an issue here on github, I am able to make lists with "checkboxes" which can be checked/unchecked.
For example, using:
- [ ] an example issue
- [x] a completed issue
Can a similar feature be added (without the fancy rendering)?
Where one can insert a "checkbox" using a keyboard shortcut, and then check/uncheck it using another?
I've had this on my personal list as well! I like it a lot but haven't looked into it yet as it's changing text content. If it's doable in a non-hacky way, I'll try and add it.
Any suggestions for the keyboard shortcut(s)?
Maybe something like cmd+., or cmd+/, to toggle them on and off?
As for inserting a new checkbox, evernote uses cmd+shift+t, but I think that's too many keys.
It could be that pressing cmd+/ inserts a new checkbox, and then subsequently toggles it.
I like the idea of spacebar to toggle, that keeps it consistent with html checkboxes. however that should only work when you are between [ ]. Would you expect cmd+. to work wherever you are on a line?
Just pushed this to the checkbox-support branch. if you press ctrl + /, it will add an empty checkbox to the beginning of the current line (prepended by any whitespace you already have, so indented lists work) . pressing ctrl + / again will toggle the checkbox to checked and unchecked.
What this doesn't do is append the checkbox after any "list" items such as * or -, it will instead add the checkbox before the list item but after any whitespace at the beginning of the line. To me this looks better (and it's less code to write and maintain, so double win). Let me know what you think @evolutionxbox!
I really like this. I'm going to checkout that branch later today and have a play around. Personally I think you've got a good approach.
Just pushed support for interaction with selections too: select multiple lines and press ctrl + / and it will add/toggle checkboxes on all of them.
I'm using FromScratch as my to-do scratchpad (it feels like a much nicer macOS Stickies), and I'm really looking forward to this in stable. 👍
Supporting list-style checkboxes may be useful for those who want Markdown in the end, but I think I can live without them.
What are list-style checkboxes?
The GitHub flavored Markdown syntax of:
- [ ] one
- [ ] two
- [ ] three
- [x] four
- [ ] five
...which they render as so:
Ah, yes. We're not going to render checkboxes as html, they will remain plain text. IMO the dash is superfluous:
[ ] one
[ ] two
[ ] two point one
[ ] three
Reads just as well, right? See my comment here for rationale: #36 (comment)
@Kilian yeah I agree with you. The checkboxes do not need to render.
Yes, it reads fine, but isn't great for copy/pasting into Markdown files.
And just to be clear, I don't think FromScratch should render them as HTML — I'd just personally prefer - [ ] one over [ ] one.
- [ ] one
[ ] one
That said, it's perfectly fine for FromScratch not to bother with that, as it's not a Markdown editor (and doesn't want to be one). If I end up needing something like this, processing text is easy enough to script.
Edit: I just realized FromScratch doesn't support italicizing or bolding text in a Markdown(-like) manner anyway (which I probably just assumed it does for no good reason), so this whole thing is a bit silly. If it's meant to remain a plain-text scratchpad, it's fine as it is (though 👍 for the checkbox keyboard shortcuts).
Just merged this back to master, will be in 1.3.0!