some javascript codes embedded in html as below:
commented with the vim plugin NERD_Commenter
<body>
<script language="javascript">
<!--alert("hello word");-->
<!--alert("hello word");-->
<!--alert("hello word");-->
<!--alert("hello word");-->
</script>
</body>
I'd like the inner javascript codes commented in a style below:
<script language="javascript">
//alert("hello word");
//alert("hello word");
//alert("hello word");
//alert("hello word");
</script>
How to deal with it? Or is there a better plugin for code commenting?
You can use tcomment.vim. That's what I use and it supports some mixed language highlighting (demo). For example you can use gc<motion>
to comment text or gcc
to comment a line and it will usually detect the language appropriately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With