Enable the display of line numbers in Visual Studi

2019-01-31 02:11发布

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.

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.)

15条回答
倾城 Initia
2楼-- · 2019-01-31 03:07

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

查看更多
Anthone
3楼-- · 2019-01-31 03:07

For MS Visual Studio 2015 type "Text" in Quick Launch (Ctrl+Q) of top right corner. 1) quicklaunch

2) In the list select Text Editor->All Languages->General select_allLanguages

3) Now check on "Line Numbers" and click OK to get the line numbers.

Finally we get the line number in text editor.

查看更多
欢心
4楼-- · 2019-01-31 03:12

Line numbers are not on by default. To turn on line numbers just go to Tools -> Options -> Text Editor -> All Languages -> General -> Display and check Line numbers:

http://blogs.msdn.com/blogfiles/zainnab/WindowsLiveWriter/TurnonLineNumbers_A5E7/image_thumb.png

查看更多
登录 后发表回答