Ben Godfrey

Strip tags in a Vim buffer

Before I forget this, here’s a simple Vim command to strip XML or HTML tags from a buffer. The expression is non-greedy and catches tags that span multiple lines.

:%s/<\_.\{-1,\}>//g

Bookmark and Share

Comments

Add a new comment

Your avatar

Add a new comment

Cancel   Forgot password?
Cancel

Attention! Log in (if you've commented before) or use your OpenID.

You can use Markdown here.

Preview