Given the following line:
[aaaa bbbb cccc dddd] [decimal](18, 0) NULL,
How would you replace the spaces only between the first set of brackets in Vim? What would the /s command look like?
Update:
This is the intend outcome
[aaaa_bbbb_cccc_dddd] [decimal](18, 0) NULL,
The easiest way to do it would be to visually select the contents of the
[]ed string and perform the replacement just on that selection:This doesn’t work very well if you’re trying to do things programmatically, though. In that case, you can match the entire
[]ed string and use a replacement expression to construct the result.