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:
- Go to Tools → Options…
- Look for the Text Editor → All Languages option.
Check the Line numbers option under the Display section
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++.
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 🙂