deshmukh
deshmukh

Reputation: 383

Emmet Vim wrap a specific tag around

This is very basic but I just could not find an easier way of doing it.

I have an html file and I want to wrap <strong></strong> around some part.

So, I go to visual mode. Select the text. Do Control Y - ,. It asks for Tag. I enter strong and it wraps the tags as expected.

But this is way too long for vim IMHO.

Is not there a quicker/ easier way to get this done? May be an abbreviation attached to a keystroke?

So, I select the text in visual mode, press a key and there --- <strong> </strong> appear around it?

Upvotes: 2

Views: 3240

Answers (1)

Peter Lewerin
Peter Lewerin

Reputation: 13272

With the surround plugin it's select the text in visual mode, press S<, tag name, <cr>.

Or ys, motion or text object, <, tag name, <cr>.

< can be replaced by t, attributes can be appended to the tag name, and <cr> can be replaced by >.

Upvotes: 5

Related Questions