首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用NERD_Commenter注释不理想,注释javascript嵌入html文件

用NERD_Commenter注释不理想,注释javascript嵌入html文件
EN

Stack Overflow用户
提问于 2012-03-30 17:47:21
回答 1查看 304关注 0票数 5

嵌入到html中的一些javascript代码如下:

使用vim插件NERD_Commenter进行注释

代码语言:javascript
运行
复制
<body>
    <script language="javascript">
        <!--alert("hello word");-->
        <!--alert("hello word");-->
        <!--alert("hello word");-->
        <!--alert("hello word");-->
    </script>
</body>

我希望内部的javascript代码以下面的样式注释:

代码语言:javascript
运行
复制
    <script language="javascript">
        //alert("hello word");
        //alert("hello word");
        //alert("hello word");
        //alert("hello word");

    </script>

如何应对?或者有没有更好的代码注释插件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-08-20 23:29:42

您可以使用tcomment.vim。这就是我使用的,它支持一些混合语言突出显示(demo)。例如,您可以使用gc<motion>对文本进行注释,或者使用gcc对一行进行注释,它通常会适当地检测语言。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9940623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档