1

I want to escape in my file some of the " by \".

For example, I want to transform foo"bar"xyz" to foo\"bar\"xyz\".

Attempt 1 :

  1. search for " (typing /")

  2. create my macro (typing qai\, Esc, RightArrow, nq)

  3. use my macro with @a. Unfortunately, this last step failed.

Attempt 2 :

  1. search for " (typing /")

  2. create my macro (typing qai\, Esc, l, nq)

  3. use my macro with @a. Works like a charm.

Question :

Why this macro fails when using arrows, and works perfectly when using l?

This is the first time it happens to me, so my guess is that it has to do something with vim interpreting the \ to actually escape something in the macro itself, but I don't know how to check my assertion.

nobe4
  • 16,033
  • 4
  • 48
  • 81
Richard
  • 111
  • 3

0 Answers0