How can I transform comments like
{{{
abc
def
}}}
to markdown comments like
abc
def
(4 spaces at the start of each line) in vim or sed?
I tried the following but I didn’t get the spaces after the first line:
:%s/{{{\n\(\_.*\)\n}}}/ \1/
With vim:
Explanation:
:g/{{{/run a command on each line with the pattern{{{,/}}}/le 4left align from the current line to the ending}}}ddelete the current line/}}}/dsearch for the line matching}}}and delete itDepending on your indent settings using
>instead ofle 4might be sorter.For more help see