假设我有一个不错的注释块,例如下面的一个

/*
** 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而不是替换每个注释行之前的初始**?

非常感谢你!

最佳答案

参见:help format-comments。我得到你想要的结果

:set comments=s0:/*,mb:**,ex:*/

10-01 23:00