如何在vim中删除html标签?

问题描述 投票:0回答:1

考虑类似的文本

<p>In this article, using <code>ffmpeg </code>I am going to
 show you just how easy it is to add a red hue to an image</p>

我只想删除

<code>
</code>
标签。我试过:

 vnoremap <silent> rt :s/<[^>]*>//g<CR>:noh<CR>

但这将删除当前行中的所有标签,即使唯一突出显示的部分是

<code>ffmpeg </code>

html vim
1个回答
0
投票

对于 HTML 标签,已经存在针对

inner tag
的动作 it 和针对
a tag
at。将光标放在
<code>...</code>
上的任意位置并按
dat
将删除开始和结束代码标签以及内部的任何内容。
请参阅
:help at
了解更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.