1

I want to use Vim (MacVim) to remove all single quotes from a file. I tried the following:

:%s/'//g

:%s/\'//g

but in both cases, Vim returns:

E486: Pattern not found:

I get the same error when I simply try to search for single quotes:

/'

What am I doing wrong?

1
  • 2
    Maybe the character is not actually a ' but something that looks like it? You can check with the ga command (should print 39). Nov 24 at 1:22

1 Answer 1

1

Together with @Martin I believe your file doesn't contain single quote but something that looks like single quote.

To look for it you could either

  • Copy the single character yl and search for it: /Ctrl-r"Enter

  • Discover it's code using the ga command an search for it: /Ctrl-vu2019Enter

Assuming 2019 is the Unicode code of your looklike quote.

The character u2019 is actually very similar to single quote u0027.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.