How can I permanently enable line numbers in IntelliJ?

Intellij Idea

Intellij Idea Problem Overview


How can I permanently enable line numbers in IntelliJ IDEA?

Intellij Idea Solutions


Solution 1 - 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

enter image description here

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.

  1. On a Mac, these are named IntelliJ IDEA | Preferences...

enter image description here

Solution 2 - Intellij Idea

The question is obviously well answered already, but since IJ 13 you can enable line numbers in 2 seconds flat:

  1. Press shift twice
  2. Type "line number"
  3. The option shows in the menu and press enter to enable/disable.

enter image description here

Et voila ;)

Solution 3 - Intellij Idea

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.

enter image description here

Please note that this only works on a per-file basis, however. Enjoy.

Solution 4 - Intellij Idea

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.Intellij Settings search for line numbers

Solution 5 - Intellij Idea

Android Studio 1.3.2 and on, IntelliJ 15 and on

Global configuration

File -> Settings -> Editor -> General -> Appearance -> Show line numbers

enter image description here


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. enter image description here

Solution 6 - Intellij Idea

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

enter image description here

Solution 7 - Intellij Idea

IntelliJ 14 (Ubuntu):

See: how-do-i-turn-on-line-numbers-permanently-in-intellij-14

Permanently:

File > Settings > Editor > General > Appearance > show line numbers

Editor

For current Editor:

View > Active Editor > Show Line Numbers

Menu

Solution 8 - Intellij Idea

IntelliJ IDEA 15

5 approaches

Global change
  1. File > Settings... > Editor > General > Appearance > Show line numbers

show line numbers

  1. Hit Shift twice > write "line numbers" > Show Line Numbers (that one that has the toggle) > change the toggle to ON

shift shift


Change for the Active Editor
  1. Right click on the left side bar > Show Line Numbers

right click

  1. Hit Shift twice > write "line" > Show Line Numbers (the line doesn't have the toggle)

shift shift line

  1. Ctrl + Shift + A > write "Show line" > Active Editor: Show Line Numbers > change the toggle to ON

Ctrl Shift A

Solution 9 - Intellij Idea

Ok in intelliJ 14 Ultimate using the Mac version this is it.

> IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers

Solution 10 - Intellij Idea

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'

enter image description here

Solution 11 - Intellij Idea

Android Studio

Go to Android Studio => Preferences => Editor => General => Appearance => set Checked "Show line numbers"

enter image description here

Solution 12 - Intellij Idea

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

Solution 13 - Intellij Idea

I add this response for IntelliJ IDEA 2018.2 - Ultimate.

Using menu

IntelliJ Idea > Preferences > Editor > General > Appearance > Show Line Numbers

enter image description here

Using Shortcuts - First way

For Windows : Ctrl+Shift+a
For Mac : Cmd+shift+a

enter image description here

Using Shortcuts - Seconde way

Touch Shift twice

enter image description here

These three methods exist since the last 4 versions of Intellij and I think they remain valid for a long time.

Solution 14 - Intellij Idea

For 9.0.4

File > Settings

In the tree view group

------------IDE Settings ---------

Click the Editor [+]

Select Appearance... Its there.

Solution 15 - Intellij Idea

1st way: Go to View => Active Editor => show line numbers

enter image description here

2nd way Go to Android Studio => Preferences => Editor=> Appearance => set Checked "Show Line Numbers"

enter image description here

enter image description here

Solution 16 - Intellij Idea

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:

Choosing

and within that is the "Settings" dialog shown by the Windows Intellij.

Solution 17 - Intellij Idea

In IntelliJ 14 it has moved again somewhat down the menu.

Now we have it unter Editor -> General -> Appearance

enter image description here

Solution 18 - Intellij Idea

Just an update for Android Studio 1.5.1 on Windows:

Go to File -> Settings -> follow picture enter image description here

Solution 19 - Intellij Idea

On IntelliJ IDEA 2016.1.2

Go to Settings > Editor > General > Appearance then check the Show Line number option

enter image description here

Solution 20 - Intellij Idea

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

show_line_numbers

Solution 21 - Intellij Idea

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

enter image description here

For shortcut:

⌘ + ⇧ + A (command + shift + A)

type enter image description here

and click on the pop up to turn on Show line numbers and you are good to go.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontView Question on Stackoverflow
Solution 1 - Intellij IdeaDónalView Answer on Stackoverflow
Solution 2 - Intellij IdeaSamuel KerrienView Answer on Stackoverflow
Solution 3 - Intellij IdeaitshoView Answer on Stackoverflow
Solution 4 - Intellij IdeaRadu BompaView Answer on Stackoverflow
Solution 5 - Intellij IdeateobaisView Answer on Stackoverflow
Solution 6 - Intellij IdeaShihamView Answer on Stackoverflow
Solution 7 - Intellij IdeaJBaczukView Answer on Stackoverflow
Solution 8 - Intellij IdeaROMANIA_engineerView Answer on Stackoverflow
Solution 9 - Intellij IdeaShawn VaderView Answer on Stackoverflow
Solution 10 - Intellij IdeaSiddharthaView Answer on Stackoverflow
Solution 11 - Intellij IdeaGuy WestView Answer on Stackoverflow
Solution 12 - Intellij IdeampontilloView Answer on Stackoverflow
Solution 13 - Intellij IdeaL Y E S - C H I O U K HView Answer on Stackoverflow
Solution 14 - Intellij IdeaItumacView Answer on Stackoverflow
Solution 15 - Intellij IdeaRohitView Answer on Stackoverflow
Solution 16 - Intellij IdeaOwenView Answer on Stackoverflow
Solution 17 - Intellij IdeaMaxMView Answer on Stackoverflow
Solution 18 - Intellij IdeaCholetskiView Answer on Stackoverflow
Solution 19 - Intellij IdeaA0__oNView Answer on Stackoverflow
Solution 20 - Intellij IdeaMd. Jamal UddinView Answer on Stackoverflow
Solution 21 - Intellij IdeabhordupurView Answer on Stackoverflow