Skip to content

You must be logged in to vote

Hi! Is there a way to define a custom textobject that will go from the current cursor position to the next closing quote?

For example, if I have the string "hellothere" and | is the cursor:

"hello|there"

Is there something I could set a textobject Q to such that typing dQ would result in:

"hello"

For this particular case there are goto_left and goto_right mappings. They can be used like dg]q to delete until right side of q textobject (using " here is also possible). This works with any textobject: f, ), etc., which it makes pretty handy.

Using t/T operator is also a good advice.

Other than that, yes it is possible in theory to define this type of textobject, but I wouldn't recommend doi…

Replies: 2 comments 2 replies

You must be logged in to vote
1 reply
@garymh

You must be logged in to vote
1 reply
@garymh

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.ai
3 participants