Krit
Krit

Reputation: 101

In Vim, when doing vi", how do you only select things inside the quotes and not things between the quotes

Take for example

{ label: "Contacts", p|age: "/contacts" },

When the cursor is on page, doing vi" selects , page: and not the subsequent quotee, /contacts.

What can be done to solve this issue?

Upvotes: 1

Views: 115

Answers (1)

romainl
romainl

Reputation: 196576

Well, the behaviour you describe is expected and documented so there is no "issue" to speak of.

From :help a":

Selects the text from the previous quote until the next quote.

What you want is something that doesn't exist in Vim, a "next text object" text object.

There are a few old but still working snippets floating around for that (ask your favourite search engine), as well as plugins.

Upvotes: 5

Related Questions