Let's say I'm editing this line of JavaScript in Vim:
var opener = 'As Gregor Samsa awoke one morning from uneasy dreams he found himself transformed in his bed into a gigantic insect';
If my cursor is on the G in Gregor, how do I move it to the t in insect?
I'm not talking about moving to the end of the line. I'm talking about moving to the end of the JavaScript string encapsulated in the single quotation marks. (I know I can do it with /'h, but I'm wondering if there's a more generic command—maybe something like %.)
There's vi'<Esc>, which goes into visual mode with the selection comprising the interior of the current string, and the cursor at the end of the selection — then leaves visual mode.
I'm not sure if there's a better way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With