Given the following text:
0 : Container(
alignment: Alignment.center,
padding: const EdgeInsets.all(24.0),
child: RichText(
text: TextSpan(
style: TextStyle(fontStyle: FontStyle.normal),
text:
'It’s hard')),
color: getRandomColor()),
0 : Container(
alignment: Alignment.center,
padding: const EdgeInsets.all(24.0),
child: RichText(
text: TextSpan(
style: TextStyle(fontStyle: FontStyle.normal),
text:
'My dreams always start in the middle')),
color: getRandomColor()),
0 : Container(
alignment: Alignment.center,
padding: const EdgeInsets.all(24.0),
child: RichText(
text: TextSpan(
style: TextStyle(fontStyle: FontStyle.normal),
text:
'I will the privilege')),
I am trying the following using a vimscript variable to capture the "0 : Container(" while at the same time incrementing the "0":
:let a = 0 | g/ \zs\d\+\ze,$/ s//\=a/ : Container( | let a += 1
This solution was posted here, but it's for a slightly different pattern.
What am I missing in this syntax that's not letting it match?
g/ \zs\d\+\ze,$/ s//\=a/ : Container( | let a += 1doesn't make sense. There are trailing characters afters//\=a/which should be:help :s_flagsbut aren't. Perhaps a copy-paste error? – D. Ben Knoble Jun 01 '23 at 19:450s or is it something else? – romainl Jun 02 '23 at 07:28