C# Visual Studio 中的 100 个字符行标记

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9894397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 11:06:39  来源:igfitidea点击:

100 characters line marker in Visual Studio

c#visual-studio

提问by Pierre-Antoine

Possible Duplicate:
Adding a guideline to the editor in Visual Studio

可能的重复:
向 Visual Studio 中的编辑器添加指南

Is there a way to display a vertical line at 80 or 100 characters in the editor of Visual Studio?

有没有办法在 Visual Studio 的编辑器中显示 80 或 100 个字符的垂直线?

I know it is possible in Eclipse and coudn't find it in VS.

我知道这在 Eclipse 中是可能的,但在 VS 中找不到。

This vertical marker line help seeing when to break a line of code for people that do not go over 80 or 100 characters per line of code.

对于每行代码不超过 80 或 100 个字符的人,此垂直标记线有助于查看何时中断一行代码。

I am a Java developer that currently develop in C#, my habbit may not correspond to C# style guide.

我是一名 Java 开发人员,目前使用 C# 进行开发,我的习惯可能与 C# 风格指南不符。

Thanks in advance.

提前致谢。

采纳答案by Cristian Lupascu

If you are using VS 2010, you can install the Productivity Power Tools extension, which provides this functionality.

如果您使用的是 VS 2010,则可以安装提供此功能的 Productivity Power Tools 扩展

The feature you're looking for is called "Column Guides". The PPT website states:

您正在寻找的功能称为“列指南”。PPT网站上说:

Simply place the cursor at the appropriate column and select Add Guideline from the context menu

只需将光标放在适当的列上,然后从上下文菜单中选择添加指南