I tried :s%/{//g
and :s%/\{//g
. How do I find and replace (remove, actually) braces in vim?
Thanks.
EDIT: I meant to have the % before the s, so I may have just been mistyping. Thanks everyone for the swift replies.
An extension to @chaos
The {
character (ie: left brace, not to be confused with bracket [
, or parentheses (
)
... does not need to be escaped.
You probably mean to remove all braces. The percent symbol should be before the 's', not after. It means to perform the search on all ranges.
So, just do:
:%s/{//g
:%s/}//g
All done!
You should consider reading up on VIM ranges. For example, to do replacements on the current line and up to 10 lines down, you could do:
:.,.+10s/}//g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With