Display line numbers in Visual Studio [Works for all Versions]

If you are using any version of Visual Studio, then it will be really helpful to display line numbers in Visual Studio while coding and debugging especially.

Here are the steps to show line numbers in Visual Studio.

Display line numbers in Visual Studio:

  1. Go to Tools → Options…
    Tools Options menu in Visual Studio
  2. Look for the Text Editor → All Languages option.
    Check the Line numbers option under the Display section
    Display Line Numbers in Visual Studio for All Languages

This will show line numbers for all types of languages.

Some other curious topics to read:
Did you know you can unzip files using Java?
Show Line Numbers in Eclipse IDE

But, if you want to enable line numbers for a specific language, select the respective language from the list and check the Line numbers box.
In the below example, I am enabling line numbers only for C/C++.
Show Line Numbers in Visual Studio for C C-plus-plus

That’s it. Now, the line numbers appear in each file in the Visual Studio project/solution.

Being a developer, I personally use the Visual Studio for my C++ development activities and if you are a developer also, showing the line numbers in VS will add efficiency to your coding and debugging.

The above steps for showing line numbers in Visual Studio works with all versions available i.e. professional, enterprise, and community in all the platforms like Windows, Linux, and Mac with minor changes in the way you find the options.

Happy learning 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top