开发者

How can I change a list of plain lines into headlines/TODO items?

开发者 https://www.devze.com 2023-03-20 00:27 出处:网络
If I paste in a block of t开发者_运维问答ext composed of separated lines, is there any way to convert each of those lines into either headlines or TODO list items?So:

If I paste in a block of t开发者_运维问答ext composed of separated lines, is there any way to convert each of those lines into either headlines or TODO list items? So:

item
item
item

becomes:

* item
* item
* item

without my having to type [Meta][Return] at the begging of each line?


With a default org-mode configuration, select your lines up to and including the newline at the end of the last line, and do M-x org-toggle-heading. With a prefix argument, it tells org-mode how many levels in it should make the heading (C-u 4 M-x org-toggle-heading)


For example with following command:

M-x query-replace-regex RET ^\(.*\)$ RET * \1 RET


Select your three lines, and while your cursor is on the first column of the fourth line type C-xrt*SPACERET. This calls the string-rectangle to insert the string *[space] in the vertical selection delimited by the mark and the cursor (i.e., the first column). C-xrt is a very useful command when editing aligned text.


To convert the line prefix from a Workflowy export (0-n leading spaces followed by a single -):

M-x replace-regexp RET ^ *- RET \,(make-string (length \&) ?*)
0

精彩评论

暂无评论...
验证码 换一张
取 消