LinuxGem
此处为老的 LinuxGem,新版 LinuxGem 请移步 www.linuxgem.org

comments.vim -- 方便的在 Vim 中插入代码注释

galeki posted @ 2008年4月12日 08:39 in 文档编辑与排版 with tags 注释 vim , 11599 阅读

代码中的注释不光可以用来描述代码功能,更多的时候是 debug 时用来屏蔽某些代码,把某些语句注释掉查看运行结果,再恢复作对比,相信写过程序的人都有这个经历吧。

不同的语言注释的写法不同,有的时候要注释一大传代码,确实是挺闷的,像 /* ... */ 这种还算好,如果只有单行注释,比如 # 这样的方式的话,就只有一行一行来了……

comments.vim 是个可以帮你轻松插入注释的 Vim 脚本,支持c、js、tex、lua、python、bash、html 等常见的注释格式~

使用方法非常简单: >c 是加上注释,<c 是去掉注释~

你可以直接 >c 把当前行注释,也可以用鼠标选取一段代码,再 >c 把他们全部注释掉~

如果你想添加新的注释格式和支持的文件格式,也很简单,打开 comments.vim,会看到最后有这样的代码:

au FileType * CommentStyle #
au FileType vim CommentStyle "
au FileType c,css,js,sql CommentStyle /* @ */
au FileType tex,mf,mytex,lilypond,postscr CommentStyle %
au FileType cpp,xkb CommentStyle \\\\
au FileType groff,nroff CommentStyle .\\"
au FileType config CommentStyle dnl
au FileType lua CommentStyle --
au FileType xdefaults CommentStyle !
au FileType html CommentStyle <!-- @ -->
au FileType python CommentStyle """ @ """

这就是各种注释的定义了,很容易就看出格式: au FileType 文件格式 CommentStyle 注释格式,@  是注释内容的占位符。 想加入新格式,就照猫画虎写个就可以了~

comments.vim 的下载地址: http://www.vim.org/scripts/script.php?script_id=2082

vim&#21021;&#23398;& 说:
2008年4月13日 00:43 请问是否把文件放在plugin下就可以使用了?
grasscap 说:
2008年4月13日 01:03 VIM的列编辑足矣
anoy 说:
2008年4月13日 04:50 @vim初学者: 对头~
f 说:
2008年4月15日 03:42 用<c去掉注释的时候会连同前面的空格一起去掉?
&#23567;&#32418; 说:
2008年6月17日 21:32 用<c去掉注释的时候会连同前面的空格一起去掉? 是啊,如何解决啊,期待。。。
galeki 说:
2008年6月18日 05:12 确实是个问题,等待高手改代码,汗
Element 说:
2008年10月31日 22:49

Drop into 'runtimepath' and say :runtime comments.vim

这个 runtimepath 是哪个目录哦

ETHENS 说:
2020年8月15日 22:30

I was actually recommended to use the platform of the https://se.altounlockpdf.com/ and I love everythnig about it. It really protected each and every file of mine without damaging the actual quality of it at all.

UMAIR 说:
2021年1月19日 14:40

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us, I too always learn something new from your post. https://caldwells.com/interior-doors /pre-finished

JOHN 说:
2021年3月06日 18:23

Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. novelty funsy the stranger

JOHN 说:
2021年3月09日 16:18

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. sức khỏe

fdfd 说:
2021年3月12日 23:08

Hey what a splendid post I have go over and trust me I have been looking out for this comparative sort of post for recent week and scarcely ran over this. Much thanks and will search for more postings from you.  Buy 4 AcO DMT

JOHN 说:
2021年3月13日 16:05

 If someone week i really ashen-haired not actually pretty, whether you will lite grope a present, thought to follow us to displays bursting with ends of the earth considerably? Inside the impeccant previous, sea ever have dried-up, my hubby and i only may very well be with all of you connected thousands of samsara. his comment is here

JOHN 说:
2021年3月14日 16:40

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work custom jewelry dallas

amelia 说:
2021年3月14日 23:01

Super site! I am Loving it!! Will return once more, Im taking your food additionally, Thanks.  wholesale jewellery online

JOHN 说:
2021年3月15日 21:07

Nothing compares to Weber using Genesis sort of grills. That is certainly the type gas grills which have been that will always make sure that they deliver a high performance part of down interval Budapest Short Term Rental

JOHN 说:
2021年3月16日 15:12

 If someone week i really ashen-haired not actually pretty, whether you will lite grope a present, thought to follow us to displays bursting with ends of the earth considerably? Inside the impeccant previous, sea ever have dried-up, my hubby and i only may very well be with all of you connected thousands of samsara. mini-Flats for rent in Lekki Nigeria,

JOHN 说:
2021年3月17日 18:40 One present why galore businesses opt for postcards is because they are overmuch cheaper to be prefab and this can forbear a lot of expenses on the lengthened run.  Computer Rams in kenya
amelia 说:
2021年3月18日 06:00

Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks wholesale backpack

amelia 说:
2021年3月18日 06:00

Companion, this site may be fabolous, i simply like it.  wholesale fashion accessories by the dozen

JOHN 说:
2021年3月20日 18:36

definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! according to sfweekly

JOHN 说:
2021年3月22日 14:54

You've completed in excellent work. t suggest to my frtends ind personilly wtll certitnly dtgtt. t'm conftdent they'll be gitned from thts webstte. cycblebittoken

JOHN 说:
2021年4月01日 16:23

Your work here on this blog has been top notch from day 1. You've been continously providing amazing articles for us all to read and I just hope that you keep it going on in the future as well. Cheers! big gaming

JOHN 说:
2021年4月03日 15:39

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. whiskey ring scandal

chalsea 说:
2021年4月14日 21:20

Im no master, however I trust you simply made a brilliant point. You absolutely completely comprehend what youre talking about, and I can genuinely get behind that.  armas de fogo

chalsea 说:
2021年4月14日 21:20

Doubtlessly this is an amazing post I got a great deal of learning in the wake of perusing good fortunes. Topic of online journal is phenomenal there is very nearly everything to peruse, Brilliant post.  vip ground transport

daniyalabbas212@gami 说:
2021年5月09日 22:50

The students will be able to check their UP Board Result for Class 12 via SMS also. The UP Board 12th Result 2021 would comprise the student's roll number, name, subject-wise marks among other details. Around 25 lakh students will be UP Board 12th Result 2021able to check their UP Board Result 2021 Class 12 for the UP 12th examination which will be conducted in April and May 2021. As soon as the UP Board Result 2021 is announced, the official website might crash or not load due to heavy traffic, in such a case, students must not panic and wait patiently to check their UP MSP Results 2021 for Class 12.

daniyalabbas212@gami 说:
2021年5月10日 07:55

The students will be able to check their UP Board Result for Class 12 via SMS also. The UP Board 12th Result 2021 would comprise the student's roll number, name, subject-wise marks among other details. Around 25 lakh students will be able to check their UP Board Result 2021 Class 12 for the UP 12th examination which will be conducted in April and May 2021. As soon as the UP Board Result 2021 Uttar Pradesh 12th Result 2021 ​is announced, the official website might crash or not load due to heavy traffic, in such a case, students must not panic and wait patiently to check their UP MSP Results 2021 for Class 12.

daniyalabbas212@gami 说:
2021年5月12日 03:36 Technological advancements have led us to many different avenues, including electronic signatures. Find more on this at https://www.signnow.com/ask/your-2020-guide-to-electronic-signatures I've certainly been impressed with their functions.
ETHENS 说:
2021年5月22日 22:31 Thanks for this post, I am a big fan of this website would like to go on updated. thenyic
<a href="https://san 说:
2021年5月28日 18:41

I see something really special in this internet site .<a href="https://sanwells.se/">Sanwells</a>

bandri 说:
2021年5月28日 18:44

I see something really special in this internet site . Sanwells

bandri 说:
2021年5月29日 21:48

I think this is among the most vital info for me. And i’m satisfied studying your article. However should commentary on few normal things, The website taste is ideal, the articles is in reality excellent . Excellent activity, cheers.we buy houses Chicago

bandri 说:
2021年5月30日 08:17

I have been exploring for a little for any high quality articles or blog posts in this kind of area . Exploring in Yahoo I ultimately stumbled upon this web site. Reading this information So i¡¦m glad to show that I have an incredibly good uncanny feeling I came upon exactly what I needed. I such a lot indubitably will make certain to don¡¦t forget this web site and give it a look a relentless basis.we buy houses Chicago

ETHENS 说:
2021年6月04日 23:06

How do I know if a Wordpress theme supports a subscribe option? odzyskiwanie danych Bełchatów

ETHENS 说:
2021年6月09日 22:10

Thanks for this post. I definitely agree with what you are saying. I have been talking about this subject a lot lately with my mother so hopefully this will get him to see my point of view. Fingers crossed! check this link

ETHENS 说:
2021年6月10日 02:01

I really don’t accept this particular article. Nonetheless, I had searched with Google and I’ve found out that you’re right and I had been thinking in the improper way. Keep on creating top quality material similar to this. check this link

ETHENS 说:
2021年6月14日 14:01

That’s not me not used to blogging and actually value internet site. You can find much innovative content that peaks my interest. Let me bookmark your website whilst checking you out of trouble. getinto pc

ETHENS 说:
2021年6月17日 12:58

Some really marvelous work on behalf of the owner of this web site , dead great subject matter. trade financing

ETHENS 说:
2021年6月19日 23:49

That’s not me not used to blogging and actually value internet site. You can find much innovative content that peaks my interest. Let me bookmark your website whilst checking you out of trouble. avant recommended reads

ETHENS 说:
2021年6月24日 23:28

สล็อตออนไลน์ ที่มาในรูปแบบใหม่ ที่เข้าถึงได้ง่ายดายยิ่งกว่าคราวก่อนด้วยเหตุว่าสมัยปัจจุบันเป็นสมัยของโลกอินเตอร์เน็ตที่ใครๆก็เข้าถึงได้ ไม่ส่าจะเป็นเกมส์ คาสิโน เกมส์สล็อต ที่พวกเราเอามาเก็บเอาไว้ในเว็บไซต์ของพวกเราเพื่อนักพนันไม่ว่าจะเป็นหน้าเก่าคนใหม่ได้มาทดสอบเล่นเกมส์ PGSLOT สล็อตแบบออนไลน์กัน เนื่องจากการที่พวกเราได้พนันผ่านออนไลน์ ไม่ว่าสมาชิกจะมี งบประมาณน้อย ทุนน้อย ก็สมารถยนต์เข้าถึงได้ สามารถเล่นได้ตามที่ใจต้องการ pgslotauto.cc

james 说:
2021年11月06日 17:55

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. 오피아트

seo 说:
2021年11月07日 23:38
 

 

james 说:
2021年11月12日 16:13

s is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. digital agency perth

james 说:
2021年11月12日 19:54

Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks mmathlab

JAMES 说:
2021年11月14日 17:45
 

 

soap2day 说:
2021年12月12日 22:43

I like what you guys are up too. Such smart work and reporting! Carry on the superb works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my website soap2day

sam 说:
2021年12月21日 19:27

Salon is now proud to offer complete range of hair styling, facial skincare treatments and body hair removal services for men.Groom Deals

william 说:
2021年12月21日 19:43

Kbc Lottery Winner 2022 list for information online like Kaun Banega Crorepati Lucky draw Winners 2022.Kbc lottery winner 2022

ch 说:
2022年1月25日 04:12

I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. https://www.5g999.co/slot

howtallis50cent 说:
2022年2月10日 15:20

<a href="https://www.lifestyle-hobby.com/how-tall-is-50-cent-everything-you-should-know-about-him/">how tall is 50 cent</a>

does wendy's take ap 说:
2022年2月10日 21:28

"<a href=""https://10most.net/does-wendys-take-apple-pay/"">does wendy's take apple pay
</a>"

ch 说:
2022年2月14日 03:29

I've been surfing online over three hours today, yet I never discovered any fascinating article like yours. It's really sufficiently worth for me. As I would see it, if all website admins and bloggers made great substance as you did, the web will be significantly more helpful than any time in recent memory. www.pgslot888.net

ch 说:
2022年2月14日 03:29

Extremely helpful post. This is my first time i visit here. I discovered such a variety of fascinating stuff in your online journal particularly its exchange. Truly its extraordinary article. Keep it up. https://HubPGSlot.com

koffi olomide 说:
2022年2月17日 13:20

<a href="https://www.election-net.com/rdc-koffi-olomide-de-retour-a-kinshasa-depuis-jeudi-malgre-sa-condamnation-en-france/">koffi olomide</a>

sss 说:
2022年2月17日 13:21

Simplibuy is your online one-stop resource for buying medical supplies, diagnostic equipment and accessories.Ultrasound Supplies

Top 10 Handsome Man 说:
2022年2月23日 01:13

<a href="https://www.lifestyle-hobby.com/top-10-handsome-man-in-the-world-2021/">Top 10 Handsome Man in the World 2021</a>

Vector SEO 说:
2022年2月26日 23:28

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2 release date in hindi</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年2月27日 22:09

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2</a> Looking forward to your more posts. Thanks

Aplepixel 说:
2022年2月27日 23:37

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2 release date in hindi</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年2月28日 22:56

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://accuvity.org/yaar-anmulle-returns-full-movie/">yaar anmulle returns full movie download filmyzilla</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月01日 23:00

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://accuvity.org/yaar-anmulle-returns-full-movie/">Yaar Anmulle Returns Trailer</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月03日 22:12

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月08日 00:04

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://activemist.org/how-to-unlock-characters-in-mario-party/">how to unlock characters in mario party</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月15日 21:28

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2 release date in hindi</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月16日 21:38

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://ablepixel.net/download-the-witcher-season-2-in-hindi/">the witcher season 2</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月16日 23:08

<a href="https://accuvity.org/yaar-anmulle-returns-full-movie/">yaar anmulle returns full movie download filmyzilla</a>

Vector SEO 说:
2022年3月17日 22:23

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://accuvity.org/yaar-anmulle-returns-full-movie/">Yaar Anmulle Returns Trailer</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月18日 22:16

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://activemist.org/how-to-unlock-characters-in-mario-party/">how to unlock characters in mario party</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月19日 22:01

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://activemist.org/how-to-unlock-characters-in-mario-party/">super mario party unlock characters</a> Looking forward to your more posts. Thanks

Vector SEO 说:
2022年3月19日 23:11

Highly appritiated. I found always great and unique content on this website. Kindly also visit my website <a href="https://activemist.org/how-to-unlock-characters-in-mario-party/">super mario party unlock</a> Looking forward to your more posts. Thanks

amelia 说:
2022年7月03日 01:29

Extraordinary Article it its truly useful and inventive update us as often as possible with new upgrades. its was truly important. much appreciated. corporate office email

amelia 说:
2022年9月01日 01:37

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. minecraft remoteconnect

ch 说:
2022年11月20日 18:36

A debt of gratitude is in order for setting aside an ideal opportunity to talk about this, I feel unequivocally about it and affection adapting more on this subject. no link

ch 说:
2022年12月14日 03:05

If you don't mind proceed with this incredible work and I anticipate a greater amount of your amazing blog entries. Fitness quotes for women

ch 说:
2023年7月09日 05:01

This is truly a decent and instructive, containing all data furthermore greatly affects the new innovation. A debt of gratitude is in order for sharing it Ac repair las vegas

ch 说:
2023年7月16日 01:17

i cherish perusing this article so beautiful!!great work! ทดลองเล่นสล็อต

ch 说:
2023年8月05日 20:20

i truly like this article please keep it up. Website Design

ch 说:
2023年8月06日 06:31

You know your undertakings emerge of the group. There is something uncommon about them. It appears to me every one of them are truly splendid! 먹튀검증업체

ch 说:
2023年8月23日 05:19

I gotta most loved this site it appears to be exceptionally useful . videotape

ch 说:
2023年10月04日 03:30

There is such a great amount in this article I would never have considered all alone. Your substance gives perusers things to consider in an intriguing way. Much thanks to you for your reasonable data. www.mt-spot.com

ch 说:
2023年10月16日 04:39

i read a considerable measure of stuff and i found that the method for composing to clearifing that precisely need to say was great so i am awed and ilike to come back again in future.. HDV


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter