Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace '&=' with '=&' in Vim?

I tried to replace '&=' with '=&' in Vim, but the command :%s/&=/=&/g replaced '&=' with '=&='.

Why did that happen ? What command should I use ?

like image 423
booksee Avatar asked Sep 19 '14 02:09

booksee


People also ask

How messy is window replacement?

Installing new windows usually involves creating some debris. Plaster, paint flakes, and old sealant can cause quite a mess, and some consequential damage may occur to nearby wallpaper, paintwork, and tiles. During a window replacement project, the area around your windows essentially becomes an active building site.

Do you install replacement windows from the inside or outside?

In colder climates, it is generally more efficient to install windows from the inside to be sealed against the cold air. However, installing windows from the outside is more common in warmer temperatures, as it allows for better airflow and cooling.


1 Answers

Just escape the ampersand.

:%s/&=/=\&/g

You need to escape it because & is a special character in the replacement that will be replaced with the entire matched pattern.

like image 193
Bill Lynch Avatar answered Sep 26 '22 11:09

Bill Lynch