嵌入到html中的一些javascript代码如下:
使用vim插件NERD_Commenter进行注释
<body>
<script language="javascript">
<!--alert("hello word");-->
<!--alert("hello word");-->
<!--alert("hello word");-->
<!--alert("hello word");-->
</script>
</body>我希望内部的javascript代码以下面的样式注释:
<script language="javascript">
//alert("hello word");
//alert("hello word");
//alert("hello word");
//alert("hello word");
</script>如何应对?或者有没有更好的代码注释插件?
发布于 2012-08-20 23:29:42
您可以使用tcomment.vim。这就是我使用的,它支持一些混合语言突出显示(demo)。例如,您可以使用gc<motion>对文本进行注释,或者使用gcc对一行进行注释,它通常会适当地检测语言。
https://stackoverflow.com/questions/9940623
复制相似问题