Vim:让gq不要在Comment Block中移位`**'

时间:2012-02-15 14:57:21

标签: c++ c vim formatting

假设我有一个很好的评论块,例如下面的那个

/*
** This is a nice comment block. Displace the `**'s and I will eat your nose! Also, here is a long line of text clearly longer than the textwidth, which should force gq to rearrange the lines. Wheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...
**
**
*/

我应用gq格式化它并确保没有行超过字符数。如何让gq不要取代每个注释行前面的初始`**?

非常感谢!

1 个答案:

答案 0 :(得分:3)

请参阅:help format-comments。我从

获得了你想要的结果
:set comments=s0:/*,mb:**,ex:*/