390

How to make phpstorm display line numbers by default?
Couldn't find that option. It's kind of annoying to turn them on manually for each page.

Pat Myron
  • 4,437
  • 2
  • 20
  • 39
domino
  • 7,271
  • 12
  • 36
  • 48
  • 36
    you can search on top of the settings pane. just write "line number" and you will find it – kissgyorgy May 02 '12 at 19:03
  • 27
    I can't believe PhpStorm doesn't have this enabled by default. What developer doesn't want line numbers most of the time? (*not really a question*) Anyways, good question, thanks! – Elijah Lynn Jun 05 '13 at 14:47
  • 10
    Yeah, it's actually really annoying that it's not on by default. I'd assume every developer unfamiliar with their product has ended up on this page at some point. – skrilled Nov 18 '13 at 23:21
  • 2
    Maybe we are all supposed to get to the point as programmers where our chi "inner energy" helps us see line numbers even when they're not there. Thank you IntelliJ!!! – Cozzbie Jun 18 '15 at 08:45
  • 1
    Other IDE's don't have it enabled by default either, not sure why... Monitor size is generally not exactly that limited these days, and line numbers are used constantly, by me anyways. – Andrew Oct 11 '15 at 17:36

19 Answers19

656

Settings (or Preferences if you are on Mac) | Editor | General | Appearance and check Show line numbers.

szaman
  • 2,159
  • 1
  • 14
  • 30
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
125

Just now found where is it on Windows. Its View -> Active Editor -> Show Line Numbers (changes only for current document) and File -> Settings -> Editor -> Appearance -> Show Line Numbers (for all documents)

For Mac Version go to PhpStorm -> Preferences in menu. In the preference window go to IDE settings -> Editor -> Appearance -> Show Line Numbers (To change setting for all documents)

OR if you want to quickly set show line number PER CURRENT WINDOW even easier - right click on the long white column (where breakpoints are set) then select Show Line Numbers.

enter image description here

Red dot on the screenshot is a place where you have to click

pleerock
  • 18,322
  • 16
  • 103
  • 128
52

All the guys are right. I am just bringing the the current soultion with the images.

  1. Go to File-> Settings

enter image description here

  1. In the box in the top right corner type in line numbers, just below that choose Editor->Appearance, from the right checkboxes, find Show line numbers and check it.

  2. After that hit Apply and OK

enter image description here

That should do the trick.

My version of PhpStorm is 6.0.3

Matija
  • 17,604
  • 2
  • 48
  • 43
15

If you're on a Mac:

PhpStorm -> Preferences... -> Editor -> Appearance -> Show Line Numbers

main menu inner menu

Michel Ayres
  • 5,891
  • 10
  • 63
  • 97
  • 1
    This is the best answer for MAC! Currently (in PhpStorm 8) I found it in `PhpStorm -> Preferences... -> Editor -> Appearance -> General -> Show Line Numbers` – Pathros Jun 14 '15 at 05:29
15

just double tap 'Shift'
and search for 'Line Numbers'
and there you will see a toggle option on or off

TV-C-1-5
  • 680
  • 2
  • 13
  • 19
alamin
  • 2,377
  • 1
  • 26
  • 31
8

In PHPStorm 8 this setting is no longer under 'Appearance' but now in:

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

JDGalway
  • 91
  • 1
  • 3
7

Follow the below steps:

  • Click on File->Settings->
  • In the Settings dialog box Expand Editor under IDE Settings
  • Click Apperance - > select Show line numbers.
  • Click Apply->Ok.
Unni Kris
  • 3,081
  • 4
  • 35
  • 57
Scott
  • 71
  • 1
  • 1
7

Simplest solution for line numbers in php storm..There are many other solutions but i think A big picture a good from 1000 words.

Simplest solution for line numbers in php storm..There are many other solutions but i think A big picture a good from 1000 words.

6

File -> Settings -> Editor -> General -> Appearance check "Show Line Numbers"

This is the current location as of phpStorm 8.0.2 on Ubuntu 14.04

Ryan
  • 5,959
  • 2
  • 25
  • 24
  • Thanks It worked for me too. The setting is in the right place that has been stated. However I have to restart my PHPstorm to show the line numbers. – Jnanaranjan Feb 18 '15 at 12:41
4

Settings -> editor | appearance | Show line numbers

Ankur
  • 2,171
  • 23
  • 29
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
3

Just right click on left side where line numbers generally show, select "show line numbers"

Nasir Ahmed
  • 501
  • 2
  • 14
  • This solution has already been provided by @pleerock. Please don't post duplicate answers here. – honk Oct 30 '14 at 18:42
3

In PHPStorm 2016: File > Settings > Editor > General > Appearance > check "Show line numbers"

Andrew Koper
  • 6,481
  • 6
  • 42
  • 50
3

By typing command + shift + A you will get a search prompt and write line numbers . Now you can trigger button on or off

phpstorm

Momin
  • 3,200
  • 3
  • 30
  • 48
2

For PhpStorm version 9 on Windows.
FileSettingsEditorGeneralAppearence then check Show line numbers

Shannon Matthews
  • 9,649
  • 7
  • 44
  • 75
2

in the top right corner is a search button type show line numbers and you will see a toggle option. this way you never have to do it yourself. :)

croxy
  • 4,082
  • 9
  • 28
  • 46
1
File->settings->IDE Settings->Editor->Appearance

And just check the "Show line numbers" works with 8.0.1

komu_Mkeya
  • 404
  • 4
  • 5
0

On the Mac version 8.0.1 has this setting here:

PhpStorm > Preferences > Editor (this is in the second section on the left - i.e. IDE Settings NOT Project Settings) > Appearance > Show line numbers

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
0

You should go to: File -> Settings -> Editor -> General -> Appearance -> Show Line Numbers

Tai Christian
  • 654
  • 1
  • 10
  • 21
0

As of the latest version:

PhpStorm > Preferences.. > Editor > General > Appearance > Show line numbers

PHPstorm line numbers

Pang
  • 9,564
  • 146
  • 81
  • 122