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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
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: