笔者有个习惯,对于每行代码的注释喜欢写在行尾。为了能让代码排版更美观,如果能将所有行尾注释对齐是个不错的方式。手动对齐只能自己敲空格对齐是比较麻烦的,所以撸了个插件,分享给有同样强迫症的 coder。
插件地址 https://marketplace.visualstudio.com/items?itemName=sbfkcel-align-tail-comments.align-tail-comments
插件效果
USE
- Install this extension;
(ctrl|cmd)+shift+p
->Align Tail Comments
;- You can add snaplines by configuring settings.json.
settings.json
->"editor.rulers": [100]
If you do not want to configure rulers, you can modify the column values in the extended options.