How can I show line numbers in Eclipse?

前端 未结 16 1288
无人共我
无人共我 2020-11-30 16:14

How can I show line numbers by default in Eclipse?

相关标签:
16条回答
  • 2020-11-30 16:41

    The top answer is good but you can also bind it to a key ( shorcut ) to toggle it..

    Window > Preferences > Keys then enter "Line Numbers" in filter and bind it to a key.

    I use CTRL + S + L.

    0 讨论(0)
  • 2020-11-30 16:44

    in this file

    [workspace].metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.ui.editors.prefs

    make sure the parameter

    lineNumberColor=0,0,0

    is NOT 255,255, 255, which is white

    0 讨论(0)
  • 2020-11-30 16:46

    As simple as that. Ctrl+F10, then N, to Show or hide line numbers.

    Reference : http://www.shortcutworld.com/en/win/Eclipse.html

    0 讨论(0)
  • 2020-11-30 16:50

    Window → Preferences → General → Editors → Text Editors → Show line numbers.


    Edit: I wrote this long ago but as @ArtOfWarfar and @voidstate mentioned you can now simply:

    Right click the gutter and select "Show Line Numbers":

    0 讨论(0)
  • 2020-11-30 16:50

    the eclipse changes the perferences's position

    to eclipse -> perferences

    0 讨论(0)
  • 2020-11-30 16:51

    If this doesn't work it may be overridden by your current settings. You can right-click in the bar to the left of the code where line numbers would normally appear and turn them on with the context menu.

    Screen showing this context menu

    0 讨论(0)
提交回复
热议问题