如果您想通过单次击键获得近乎完美的评论理由,请使用Comment Reflower。
与和VS2012一起使用。VS2013VS2015
VS2012:为 Visual Studio 2012 安装/升级 Comment Reflower
2015-08-31 更新:现在扩展库中提供了一个Comment Reflower 扩展,可以直接从Tools > Extensions and UpdatesVS2012、VS2013 和 VS2015轻松安装。
从http://www.kynosarges.de/CommentReflower.html下载“Comment Reflower” ,解压到目录C:\Program Files (x86)\Visual Studio Comment Reflower。
更新文件CommentReflower.Addin,以便从toVersion递增(这会将其从 VS2010 升级到 VS2012)。注意:此 .xml 文件中有两个地方必须更新此版本。10.011.0
在 VS2012 中,选择Tools..Options..AddIn Security并添加路径C:\Program Files (x86)\Visual Studio Comment Reflower。
重启VS2012。
现在有新的菜单项:Tools..Reflow Comment at Cursor和Tools..Comment Reflower Settings。
VS2013:为 Visual Studio 2013 安装/升级 Comment Reflower
2015-08-31 更新:现在扩展库中提供了一个 Comment Reflower 扩展,可以直接从Tools > Extensions and UpdatesVS2012、VS2013 和 VS2015轻松安装。
重复上述说明,并将步骤 2 中的版本从 更改11.0为12.0。
VS2015:为 Visual Studio 2015 安装/升级 Comment Reflower
现在扩展库中提供了一个Comment Reflower 扩展,可以轻松地直接从Tools > Extensions and UpdatesVS2012、VS2013 和 VS2015 中安装。
感谢@Martin Liversage 指出这一点。
要添加一个快捷键来证明您的光标所在的当前评论是正确的
转到Tools..Options..Keyboard,输入reflow,Show commands containing选择CommentReflower.Connect.ReflowPoint,在框中输入一个组合键(例如Ctrl-J)Press shortcut keys,然后点击Assign。
现在,如果您将光标放在评论上,并按下所述组合键 ( Ctrl-J),它将自动(并且漂亮地)为您证明评论的合理性。您应该会看到绑定键出现在Tools菜单中:

更新边距宽度
进入Tools..Comment Reflower Settings并将默认值 80 更改Wrap Width为更宽的值,例如140,并将“最小块宽度”更改为10(*not*将其设置为更小的值!):
