Q: how can I create a text object for innermost paired delimiters?

evil has text objects to allow us to operate on the standard paired delimiters like parentheses, braces, brackets, quote marks, and so on.

When I'm using the paired delimiters, though, I'm usually looking to operate on the innermost pair:

Here's some text (and a parenthetical remark with "quotes*" in them).

If the * in "quotes" is point, I want to operate on "quotes" rather than the full parenthetical expression. In this case, I could just use the quotes text object, but I'd like to create a single, DWIM text object for the purposes of keybinding.

How can I define a text object that will simply select the innermost paired delimiters (as defined in some variable)?


Your Answer

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

Browse other questions tagged or ask your own question.