4

When using Nano text editor, how can I display line numbers so I can see the lines that I am getting error messages about. I have a lengthy program and am getting an error message for line 95 and 125 for example.

dufte
  • 12,772
  • 5
  • 38
  • 43
Robert W.
  • 41
  • 1
  • 1
  • 3

2 Answers2

9

Ctrl+C will show the current line/column once, and Meta+C (usually Alt+C) will toggle a continuous line/column display on and off.

Ctrl+_ (that's underscore, so on most keyboard layouts that's Ctrl+Shift+-) will prompt you to jump to a specific line number.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
JustinB
  • 351
  • 1
  • 6
4

Non permanent

nano -c /path/to/file

Permanent

edit ~/.nanorc and add the following

set const

For more details - as mentioned by Nick - check this perfect answer.

dufte
  • 12,772
  • 5
  • 38
  • 43