Arduino IDE Display Code Line Numbers
Go to File > Preferences. Under the Settings tab, click the checkbox for Display line numbers.



Keep in mind that this option is available in the latest version of the Arduino Integrated Development Environment (v1.6.6). In case you are using GNU/Linux distribution is recomended to use the one that is NOT in the distribution's repositories but the one that is offered in https://www.arduino.cc/en/Main/Software

If you are using a Linux OS this solution may not work. Look at the 'preferences.txt' where you can edit your preferences in a file without a GUI.It will display all possible options available for your current version of Arduino IDE on your OS. It is usually in the '.arduino' folder which may be in your 'home' folder.