I'm trying to convert lines of text into Todos or check box items in org-mode. For example, if I have:
Line 1
Line 2
Line 3
I would like to convert that to either
*TODO Line 1
*TODO Line 2
*TODO Line 3
or
[ ] Line 1
[ ] Line 2
[ ] Line 3
I know that C-c -
will convert the selected area into a list (source):
Line 1
Line 2
Line 3
But is there any way to convert it into a list with check boxes (or alternatively, lines of Todos?)
Thanks in advance!
I highlight the region and then do C-c -
and then re-highlight and do C-u C-c C-x C-b
.
You can use this function to make the current line(s) into checkbox(es):
(defun org-set-line-checkbox (arg)
(interactive "P")
(let ((n (or arg 1)))
(when (region-active-p)
(setq n (count-lines (region-beginning)
(region-end)))
(goto-char (region-beginning)))
(dotimes (i n)
(beginning-of-line)
(insert "- [ ] ")
(forward-line))
(beginning-of-line)))
So now, starting with:
Line 1
Line 2
Line 3
With C-3 C-c c you get:
- [ ] Line 1
- [ ] Line 2
- [ ] Line 3
Now with C-c C-* you can get:
* TODO Line 1
* TODO Line 2
* TODO Line 3
Starting with
Line 1
Line 2
Line 3
With C-x h C-u C-c - you get:
- Line 1
- Line 2
- Line 3
After, with C-x h C-u C-c C-x C-b you get:
- [ ] Line 1
- [ ] Line 2
- [ ] Line 3
But this is rather unwieldy, org-set-line-checkbox
from above
should be faster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With