I am creating a yml file out of some variables. I have like 80 lines and they all have the pattern:
my-first-command-line-var: {{ my-first-command-line-var }},
my-second-cli-var: {{ {{ my-second-cli-var }} ,
my-third-var: {{ my-third-var }}
and so on
That's because all cli variables are with -
but yaml can't handle _
.
So I need to replace all -
inside {{ }}
with a _
, so it becomes:
my-first-command-line-var: {{ my_first_command_line_var }},
my-second-cli-var: {{ {{ my_second_cli_var }} ,
my-third-var: {{ my_third_var }}
I have tried :%s/{{\zs\-*ze}}/_/g
and some variations like :%s/{{\zs\(-\)*ze}}/_/g
but nothing like this worked.