visual-studio 在 Visual Studio 中启用行号显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2706910/
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-10-22 11:50:07  来源:igfitidea点击:

Enable the display of line numbers in Visual Studio

visual-studio-2010visual-studioline-numbers

提问by Cyclone

Why doesn't Visual Studio have any way of showing line numbers in a source file? Is there any way to enable it, or a plugin for it? I know that the number of lines of code in a program doesn't matter, but sometimes it is nice to know how long a program is or the number of a particular line for reference.

为什么 Visual Studio 没有任何方式显示源文件中的行号?有什么方法可以启用它,或者它的插件?我知道程序中的代码行数并不重要,但有时知道程序的长度或特定行的数量以供参考是很好的。

Though I tried, I can't seem to find a way to enable line numbering and I find that surprising.

尽管我尝试过,但我似乎找不到启用行编号的方法,我觉得这令人惊讶。

This is Visual Studio 2010 Ultimate. (If you have read my older questions, I've been using 2008 Express until now.)

这是 Visual Studio 2010 Ultimate。(如果您已经阅读过我的旧问题,那么直到现在我一直在使用 2008 Express。)

回答by James McNellis

Visual Studio has line numbering:

Visual Studio 具有行编号:

Tools -> Options -> Text Editor -> All Languages -> check the "Line numbers" checkbox.

工具 -> 选项 -> 文本编辑器 -> 所有语言 -> 选中“行号”复选框。

回答by 0x6C38

As of Visual Studio 2015, you can find the option under:

从 Visual Studio 2015 开始,您可以在以下位置找到该选项:

Tools-> Options -> Text Editor -> All Languages-> General -> Line Numbers

Tools-> Options -> Text Editor -> All Languages-> General -> Line Numbers

Visual Studio 2013 Line Numbers Option Menu

Visual Studio 2013 行号选项菜单



Or simply go to tools -> optionsand type on the search bar: "Numbers".

或者干脆去tools -> options和键入的搜索栏:“数字”。

回答by Cyclone

Tools -> Options -> Show All Settings -> Text Editor -> All Languages -> Line Numbers

工具 -> 选项 -> 显示所有设置 -> 文本编辑器 -> 所有语言 -> 行号

回答by Abdessamad Doughri

In Visual Studio 2013 & 2015 :

在 Visual Studio 2013 和 2015 中:

Tools -> Options -> Text Editor -> All Languages -> check Line Numbers enter image description here

工具 -> 选项 -> 文本编辑器 -> 所有语言 -> 检查行号 在此处输入图片说明

回答by Dmitri Larionov

It's not enabled by default but you can enable it by going to:

默认情况下未启用它,但您可以通过以下方式启用它:

  1. Click Tools
  2. Options
  3. Text Editor (expand)
  4. All Languages
  5. Line Numbers (Checkbox)
  6. Click Ok
  1. 单击工具
  2. 选项
  3. 文本编辑器(展开)
  4. 所有语言
  5. 行号(复选框)
  6. 单击确定

settings

设置

回答by Ya Basha

In VS 2010:

在 VS 2010 中:

Tools > Settings > Expert Settings

工具 > 设置 > 专家设置

Then:

然后:

Tools > Options > Show all settings > Text editor > C# > General > Check Line Numbers (checkbox)

工具 > 选项 > 显示所有设置 > 文本编辑器 > C# > 常规 > 检查行号(复选框)

回答by Sherif Hamdy

Visual studio 2015 enterprice

Visual Studio 2015 企业版

Tools -> Options -> Text Editor -> All Languages -> check Line Numbers

工具 -> 选项 -> 文本编辑器 -> 所有语言 -> 检查行号

https://msdn.microsoft.com/en-us/library/ms165340.aspxenter image description here

https://msdn.microsoft.com/en-us/library/ms165340.aspx在此处输入图片说明

回答by Wesam

Options -> Text Editor -> All Languages -> Line Number checkbox enter image description here

选项 -> 文本编辑器 -> 所有语言 -> 行号复选框 在此处输入图片说明

回答by Seba Illingworth

Type 'line numbers' into the Quick Launch textbox (top right VS 2015), and it'll take you right where you need to be (tick Line Numbers checkbox).

在快速启动文本框(V​​S 2015 右上角)中输入“行号”,它会带你到你需要的地方(勾选行号复选框)。

回答by Martin Marconcini

Are you talking about seeing the line numbers or knowing the total number of lines in a project? Here is the 1st one

您是在谈论查看行号还是知道项目中的总行数? 这是第一个