0

I'm editing some large YAML files with neovim, and need to add (and remove, in some cases) single quotes around some values.

For example -

code: 1234

needs to be changed to

code: '1234'

in other cases,

account_number: '1234'

needs to be changed to

account_number: 1234

I've tried :%s in as many ways I can think of, but can't solve it. Any suggestions?

Thank you.

Steve
  • 1
  • 2

1 Answers1

0

This does it: :%s/"\([0-9]\+\)"/\1/g

Steve
  • 1
  • 2