我经常使用gq
将较长的注释限制在一定数量的字符内,如果我使用//
或/* /*
来注释我的代码,则这个功能可以很好地发挥作用:
// here is a simple comment that exceeds my line width
// across multiple lines
// here is a simple comment that
// exceeds my line width across
// multiple lines
然而,如果我有三斜杠注释,例如用于doxygen,它无法工作:
/// here is a simple comment that exceeds my line width
/// across multiple lines
/// here is a simple comment that
// exceeds my line width / across
// multiple lines
vim
似乎将最后一个斜杠包含在文本中,而不承认它是注释的一部分。我该如何解决这个问题呢?以下是我希望在选中三条斜线注释并按下gq
时看到的结果:
/// here is a simple comment that
/// exceeds my line width across
/// multiple lines
注意,我不想影响普通的注释的现有行为。我正在使用vim 7.4.52。