How to make PyCharm always show line numbers

110,747

Solution 1

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

Solution 2

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"

Solution 3

For version 3.0 (Community Edition):

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

Solution 4

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

Solution 5

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

Share:
110,747

Related videos on Youtube

Kimvais
Author by

Kimvais

Updated on December 27, 2020

Comments

  • Kimvais
    Kimvais over 3 years

    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?

    • sudo
      sudo about 8 years
      Ugh, why would they make them disabled by default? It's like that in Xcode and Vim too.
  • BluesRockAddict
    BluesRockAddict about 12 years
    PyCharm also has search bar at the left top corner of the Settings dialog, very useful.
  • Zrax
    Zrax almost 10 years
    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.
  • Celik
    Celik almost 10 years
    yes u are right, I have just realized that; but it might be helpful. Thanks for your warning.
  • Bruce Dean
    Bruce Dean over 9 years
    On Mac OSX Ver. 4.0 it was: PyCharm-->Preferences-->Editor-->General-->Appearance-->chec‌​kbox: "Show line numbers"
  • jsh
    jsh almost 9 years
    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...
  • m3nda
    m3nda almost 9 years
    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.
  • mtnpaul
    mtnpaul over 7 years
    It shows them. But then when I click in the editing window they disappear. So ......
  • Vineesh TP
    Vineesh TP almost 5 years
    Not displaying the 'Show line numbers' option. Pycharm version 2019.1.2