htmlvimkeyboard-shortcutsjanus

How to delete HTML tags, not the contents in Vim


I have the following piece of code in a file that I opened in Vim:

<p>Hello stackoverflow!</p>

How can I delete <p> and </p> tags but keep the contents between them? That is, what should I press to end with:

Hello stackoverflow!

I know pressing d i t will do opposite.

I'm using Janus.


Solution

  • With the surround.vim plugin installed, press d s t to delete surrounding tag.

    Similar shortcuts:

    and so on...