miro
miro

Reputation: 742

what does ^A stand for in vim

I need to replace ^A, ^B in a file, the following command is useless :s/^A/

Upvotes: 2

Views: 343

Answers (2)

Christian C. Salvadó
Christian C. Salvadó

Reputation: 827178

To get the ^A character, press CTRL-V CTRL-A

If you have configured the "paste" action with CTRL-V (generally on Windows) you can use CTRL-Q instead of it.

Upvotes: 7

Martin v. Löwis
Martin v. Löwis

Reputation: 127447

You need to escape the ^ with a \, i.e. s/\^A/^B/. ^ denotes "start of line" in a regular expression. In the replacement text, escaping is not necessary, but possible.

Upvotes: 3

Related Questions