Consider a file with an AsciiDoc ordered list like this:
. one + ---- echo hello # arbitrary lines... echo world ---- . two . three How do you move the code block to some arbitrary place in the list (like two)? In words, I want to "reach from + to the next quad dash".
I played with the problem for a bit and can solve in two steps:
- Get to the start of the code block of the one item:
/one/;/----/. - Attach the code block to another list item—that is, in ed, move the range from previous line (the
+) to the next----to the target (two list item in this case):-,/----/m/two/.
Which yields:
. one . two + ---- echo hello # arbitrary lines... echo world ---- . three But I wonder if there's a nicer way!