jshawl
jshawl

Reputation: 3483

Can I move to end of text inside tag with one move?

Let's say I have some HTML:

<tag>Here is a bunch of text which is pretty long.</tag>

My cursor is on H.

I want to add some more text after the period. That is, I want to append text inside of the tag.

Right now, I'd probably $ to the end of the line and then b until I get to the .

The end of the text inside the tag is not predictable, so I can't use f..

What's the fastest way to get to the end of the text inside a tag?

Upvotes: 4

Views: 813

Answers (3)

Sagar Lama
Sagar Lama

Reputation: 66

It's not one move but this gets the work done. Assuming that you are in normal mode. Enter the following commands

vatA

What this does is, it visually selects the block including the tag and appends at the end of the line.

Upvotes: 0

romainl
romainl

Reputation: 196916

I would do t<a instinctively.

But I like FDinoff's method better.

Upvotes: 4

FDinoff
FDinoff

Reputation: 31469

This might not be the best way but one way to do this is to use vit to visually select the inner tag block. And then type A to append to the visually selected region.

So the command is

vitA

And if you just want your cursor at the end of the tag just use

vit<esc>

Upvotes: 13

Related Questions