How can I permanently enable line numbers in IntelliJ IDEA?
How can I permanently enable line numbers in IntelliJ IDEA?
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

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.

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.
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
For IntelliJ 20.1 or above, on Mac OSX:
IntelliJ IDEA -> Editor -> General -> Appearance -> Show line numbers
Point to be noted: Always look for Editor
For shortcut:
⌘ + ⇧ + A (command + shift + A)
and click on the pop up to turn on Show line numbers and you are good to go.