1

I'm trying to understand the seeking behaviour in evil-mode. suppose you have this ([|] is point):

thi[s] is a text with a 'quote' -> command: ci'
this is a text with a '[|]'

Evil seeks forward to the nearest quote pair, erases what's inside the pair, moves point to there and places you in insert mode. Very powerful. Now, when you try to do that with round brackets:

thi[s] is a text with a (round bracket) -> command: ci(
thi[s] is a text with a (round bracket) -> nothing happens

in this case evil does not seek forward. seems that seeking forward only works with single and double quotes.

Why single and double quotes seek forward by default while the other text objects do not? How can I implement the seeking behaviour for evil text objects?

1 Answer 1

1

By default the paren text objects are defined with characters. If you define them with strings/regexps for the opening and closing delimiters, it should seek (because evil-up-block is now used).

For text objects where the opening/closing delimiter is the same (like evil-inner-single-quote), you should use evil-select-quote instead of evil-select-paren to define the text object, and it should seek correctly.

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.