274

I cannot seem to be able to find the setting to enable line numbers for all files, but I have to always right click and enable this on per file basis.

There must be a global setting for this, right?

Pat Myron
  • 4,437
  • 2
  • 20
  • 39
Kimvais
  • 38,306
  • 16
  • 108
  • 142
  • 7
    Ugh, why would they make them disabled by default? It's like that in Xcode and Vim too. – sudo May 26 '16 at 19:39

7 Answers7

353

Version 2.6 and above:
PyCharm (far left menu) -> Preferences... -> Editor (bottom left section) -> General -> Appearance -> Show line numbers checkbox

enter image description here

Version 2.5 and below:
Settings -> Editor -> General -> Appearance -> Show line numbers checkbox

mikeDOTexe
  • 487
  • 5
  • 14
BluesRockAddict
  • 15,525
  • 3
  • 37
  • 35
  • 16
    PyCharm also has search bar at the left top corner of the Settings dialog, very useful. – BluesRockAddict Apr 17 '12 at 08:03
  • 2
    How did you miss it? Categorized as Appearance??! This is a must-have for most programmers and it's hidden where one would expect to find color schemes and such... – jsh Jul 14 '15 at 09:10
  • 1
    I miss it too ¬¬ ... what i see is View->Active editor->Line numbers, but that is only for current document :D and tried on the options but didn't focus into Appearance item. – m3nda Aug 22 '15 at 06:45
67

For version 4.0, 4.5 on Windows

File -> Settings

Then,

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

For version 4.0 on Mac OSX

PyCharm-->Preferences

Then,

Editor-->General-->Appearance-->checkbox: "Show line numbers"

Chris Halcrow
  • 28,994
  • 18
  • 176
  • 206
kmasif
  • 793
  • 6
  • 5
36

For version 3.0 (Community Edition):

File -> Settings -> Editor (under IDE Settings) -> Appearance -> check 'Show line numbers'

jcalazan
  • 361
  • 3
  • 4
25

PyCharm Version 3.4.1(For all files in the project):

File -> Preferences -> Editor (IDE Settings) -> Appearance -> mark 'Show line numbers'

PyCharm Version 3.4.1(only for existing file in the project):

View -> Active Editor -> Show Line Numbers

image

Celik
  • 2,311
  • 2
  • 32
  • 54
  • 1
    The original question was about how to enable it globally (i.e. for all newly opened files). The menu item you have highlighted only enables line numbers for the currently open file. – Zrax Jul 27 '14 at 22:34
  • yes u are right, I have just realized that; but it might be helpful. Thanks for your warning. – Celik Aug 11 '14 at 06:10
16

For version 2.6 and up, the dialog is in the "Preferences" dialog, access using Cmd ',':

PyCharm (far left menu) -> Preferences... -> Editor (bottom left section) -> Appearance -> Show line numbers checkbox

brunobowden
  • 1,492
  • 19
  • 37
3

v. community 5.0.4 (linux): File -> Settings -> Editor -> General -> Appearance -> now check 'Show line numbers', confirm w. OK an voila :)

fanny
  • 1,373
  • 12
  • 25
2

Using Search bar

  1. Press 2 times Shift
  2. Paste /editor /appearance/ and then
  3. Click on Show line numbers toggle button

For Windows and Linux

File | Settings | Editor | General | Appearance 

For macOS

IntelliJ IDEA | Preferences | Editor | General | Appearance 

Using shortcut

Ctrl+Alt+S

Then

Editor > General > Appearance

Click on Show line numbers toggle button.


Pycharm Official Doc (Appearance)