5

If I have a line say

`\\sfdas\lsdfjla\`

and I try to select the text inside the backtics using yi`, I expect that the entire text inside the backtics should be selected. However, it seems that in VIM 8.0, it doesn't select the entire text \\sfdas\lsdfjla\.

I have tried this with vim -u NONE to make sure its not a artifact from other plugins.

Is this by design?

1 Answer 1

5

The problem you are seeing comes from the last part, the \` makes Vim think it is an escaped accent and it will keep looking for another following accent. However since there is none, selecting the text object will fail.

To fix this for your specific case, I would simple unset the quoteescape option, e.g. :set quoteescape=. Alternatively, you can double the final backslash \\` which should also work.

2
  • Thanks for the explanation. I will look into quoteescape I was expecting that.. but shouldn't vim consider all text inside a buffer to have no special meaning to vim, unless indicated otherwise (such as the lines which indicate folding settings at the bottom of the files etc)?
    – alpha_989
    Commented Jun 13, 2018 at 19:28
  • From my experience, people expect vim to take escaped characters into account when using e.g. % (jumping between parenthesis) or for the text object. But this is always guessing (in one direction or the other). Commented Jun 13, 2018 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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