Skip to content

Instantly share code, notes, and snippets.

@bronson
Created July 25, 2014 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bronson/7f3898258725de809716 to your computer and use it in GitHub Desktop.
Save bronson/7f3898258725de809716 to your computer and use it in GitHub Desktop.
Vim's string handling doesn't make sense?

Type this into Vim:

:echo 'doesn''t' == "doesn't"

That demonstrates that the literal string exactly equals the regular string.

So why does

:grep -r "doesn't"

work, returning all instances of doesn't, but

:grep -r 'doesn''t'

fails, returning instances of doesnt instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment