How can I permanently enable line numbers in IntelliJ IDEA?
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
https://i.stack.imgur.com/9DL9q.png
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...
https://i.stack.imgur.com/JVZlJ.jpg
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.
https://i.stack.imgur.com/E38WH.png
Et voila ;)
show line number
s 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 Shift
s 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.
https://i.stack.imgur.com/tqMgd.png
Please note that this only works on a per-file basis, however. Enjoy.
https://i.stack.imgur.com/sfNsG.png
Android Studio 1.3.2 and on, IntelliJ 15 and on
Global configuration
File -> Settings -> Editor -> General -> Appearance -> Show line numbers
https://i.stack.imgur.com/VeB78.png
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)
https://i.stack.imgur.com/YGkgw.gif
For InteliJ IDEA 11.0 and above Goto File --> Settings in the Settings window Editor --> Appearance and tick Show line numbers check box.
https://i.stack.imgur.com/07g1k.jpg
IntelliJ 14 (Ubuntu):
See: how-do-i-turn-on-line-numbers-permanently-in-intellij-14
Permanently:
File > Settings > Editor > General > Appearance > show line numbers
https://i.stack.imgur.com/ArGQ9.png
For current Editor:
View > Active Editor > Show Line Numbers
https://i.stack.imgur.com/wK2Af.png
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
Right click on the left side bar > Show Line Numbers Hit Shift twice > write "line" > Show Line Numbers (the line doesn't have the toggle) Ctrl + Shift + A > write "Show line" > Active Editor: Show Line Numbers > change the toggle to ON
Ok in intelliJ 14 Ultimate using the Mac version this is it.
IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers
On IntelliJ 12 on MAC OSX, I had a hard time finding it. The search wouldn't show me the way for some reason. Go to Preferences and under IDE Settings, Editor, Appearance and select 'Show line numbers'
https://i.stack.imgur.com/Hpc01.png
Android Studio
Go to Android Studio => Preferences => Editor => General => Appearance => set Checked "Show line numbers"
https://i.stack.imgur.com/MiEaP.png
I just hit this with IdeaVim plugin installed, where even if I set Show Line Numbers
, it continued to revert to hiding them.
The (forehead-slapping-worthy) solution was:
:set nu
I add this response for IntelliJ IDEA 2018.2 - Ultimate.
Using menu
IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers
https://i.stack.imgur.com/hrzEN.png
Using Shortcuts - First way
For Windows : Ctrl+Shift+a For Mac : Cmd+shift+a
https://i.stack.imgur.com/yExMF.png
Using Shortcuts - Seconde way
Touch Shift twice
https://i.stack.imgur.com/lJpH2.png
These three methods exist since the last 4 versions of Intellij and I think they remain valid for a long time.
1st way: Go to View => Active Editor => show line numbers
https://i.stack.imgur.com/SP6TG.png
2nd way Go to Android Studio => Preferences => Editor=> Appearance => set Checked "Show Line Numbers"
https://i.stack.imgur.com/3WCdD.png
https://i.stack.imgur.com/i9T1u.png
For 9.0.4
File > Settings
In the tree view group
------------IDE Settings ---------
Click the Editor [+]
Select Appearance... Its there.
On Mac Intellij 12.1.2 there is no File-Settings:
There is an application-name menu item to the left of "File" with a "preferences" menu item:
https://i.stack.imgur.com/veG7t.png
and within that is the "Settings" dialog shown by the Windows Intellij.
In IntelliJ 14 it has moved again somewhat down the menu.
Now we have it unter Editor -> General -> Appearance
https://i.stack.imgur.com/1qjBW.png
Just an update for Android Studio 1.5.1 on Windows:
https://i.stack.imgur.com/mXdJ7.jpg
On IntelliJ IDEA 2016.1.2
Go to Settings > Editor > General > Appearance then check the Show Line number option
https://i.stack.imgur.com/gjMvm.png
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
https://i.stack.imgur.com/1iZww.png
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
https://i.stack.imgur.com/nESrm.png
For shortcut:
⌘ + ⇧ + A (command + shift + A)
https://i.stack.imgur.com/G9ILU.png
and click on the pop up to turn on Show line numbers
and you are good to go.
Success story sharing