How can I permanently enable line numbers in IntelliJ IDEA?
-
636why don't all IDE's have the default to "yes show line numbers", how do you debug anythign without using line numbers ?NimChimpsky– NimChimpsky2012-09-10 08:43:30 +00:00Commented Sep 10, 2012 at 8:43
-
10Most IDE's have the line number where your mouse cursor is in the status bar, but that's not too useful. Normally there is line numbers in stack traces right? In VIM you can jump to line numbers <line number>G, and Sublime Text, Ctrl+g (type in line number). What's the benifit of line numbers if you can jump straight where you want to go?Dauh Fhauc– Dauh Fhauc2013-09-13 13:43:06 +00:00Commented Sep 13, 2013 at 13:43
-
23What I like the most about the line number column is that it provides an easy hit area for selecting multiple lines without having to fiddle with exact cursor placement.Eric Cosky– Eric Cosky2014-12-31 17:32:24 +00:00Commented Dec 31, 2014 at 17:32
-
7I also can't imagine people working without line numbers switched on. And never the less you might possibly don't need it because you just click on links in stacktraces. It gives you orientation in the code and might also be usefull if you talk to someone else about fragments of it.ccDict– ccDict2015-10-29 08:45:52 +00:00Commented Oct 29, 2015 at 8:45
-
9All of you talking about clicking on stack traces are assuming that the stack trace being debugged is generated in the IDE. This is almost never the case in a real world scenario. You get a stack trace from a client and then you need to track it down.Dan– Dan2016-02-03 15:06:29 +00:00Commented Feb 3, 2016 at 15:06
21 Answers
IntelliJ 14.X Onwards
From version 14.0 onwards, the path to the setting dialog is slightly different, a General submenu has been added between Editor and Appearance as shown below

IntelliJ 8.1.2 - 13.X
From IntelliJ 8.1.2 onwards, this option is in File | Settings1. Within the IDE Settings section of that dialog, you'll find it under Editor | Appearance.
- On a Mac, these are named IntelliJ IDEA | Preferences...

12 Comments
The question is obviously well answered already, but since IJ 13 you can enable line numbers in 2 seconds flat:
- Press shift twice
- Type "line number"
- The option shows in the menu and press enter to enable/disable.

Et voila ;)
9 Comments
show line numbers you select. There is one which turns it on/off temporary and one which changes settings (with an on/off toggle at end of line)Shift two times consequently, something like a "double click". Not hold the both Shifts at the same time :)NOT a solution, rather a TEMPORARY solution which only works only for the current editor and current session:
Simply right click on the place where the line-numbers should be, and there you'll see a small menu.
then, mark the "Show Line Numbers" option.

Please note that this only works on a per-file basis, however. Enjoy.
4 Comments
In Intellij 13 the layout has changed, the Settings button can only be found in File -> Settings and not in the toolbars, and from there you follow the same steps: Editor -> Appearance -> Show line numbers, or search for Line numbers in the Settings search input.
1 Comment
Android Studio 1.3.2 and on, IntelliJ 15 and on
Global configuration
File -> Settings -> Editor -> General -> Appearance -> Show line numbers
Current editor configuration
First way: View -> Active Editor -> Show Line Numbers (this option will only be available if you previously have clicked into a file of the active editor)
Second way: Right click on the small area between the project's structure and the active editor (that is, the one that you can set breakpoints) -> Show Line Numbers.

Comments
For InteliJ IDEA 11.0 and above
Goto File --> Settings in the Settings window Editor --> Appearance
and tick Show line numbers check box.

2 Comments
IntelliJ 14 (Ubuntu):
See: how-do-i-turn-on-line-numbers-permanently-in-intellij-14
Permanently:
File > Settings > Editor > General > Appearance > show line numbers

For current Editor:
View > Active Editor > Show Line Numbers

Comments
IntelliJ IDEA 15
5 approaches
Global change
File > Settings... > Editor > General > Appearance > Show line numbers
Hit Shift twice > write "line numbers" > Show Line Numbers (that one that has the toggle) > change the toggle to ON
Change for the Active Editor
1 Comment
Ok in intelliJ 14 Ultimate using the Mac version this is it.
IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers
2 Comments
I add this response for IntelliJ IDEA 2018.2 - Ultimate.
Using menu
IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers
Using Shortcuts - First way
For Windows : Ctrl+Shift+a
For Mac : Cmd+shift+a
Using Shortcuts - Seconde way
Touch Shift twice
These three methods exist since the last 4 versions of Intellij and I think they remain valid for a long time.
Comments
On IntelliJ IDEA 2016.1.2
Go to Settings > Editor > General > Appearance then check the Show Line number option
2 Comments
IntelliJ 2019 community edition has line number by default. If you want to show or hide line numbers, go to the following settings to change the appearance.
go to → File → Setting → Editor → General → Appearance → [Check] Show line numbers




















