Line Number Starting at Zero

  • TheTallest

    I cannot seem to find any help on this issue anywhere. So it either is not an option YET or I am missing it in the settings menu. I am needing for the line numbering in Notepad ++ to start at zero if possible. The reason for this is because I have several scripts that are built in linux that start at line number 0. So when I went to alter these scripts in NP++ I have to be aware of where my line numbers are at so as not to mess up the script. Yes this script depends on the line numbering. Is there way to do this either in the settings or a plugin ?


    Hello TheTallest,

    I'm using N++ since the v4.9.2 version, but I've never heard of such a possibility , even with a specific plugin :-(

    I do agree, with you, that it'll be a pertinent option for some people, but I don't know if this, apparently, tiny feature would need lot of re-coding ?!

    But, in the meanwhile, perhaps, it would be possible, on the opposite, to change your Linux scripts for line numbering to begin with 1, instead of 0 ?

    You could, also, use the Column Editor feature of Notepad++, as an UGLY work-around :

    • Go back, first, to the beginning of your file ( CTRL + Origin )

    • Open the Column Editor panel ( ALT + C )

    • Click on the Text to Insert radio button

    • Type in one space

    • Click on the OK button

    => A space begin each line of your file

    • Open, again, the Column Editor panel ( ALT + C )

    • Click on the Number to Insert radio button

    • Type in 0 in the Initial number zone

    • Type in 1 in the Increase by zone

    • Check the Leading zeros square box, if necessary

    • Select the Dec format radio button

    • Click on the OK button

    => An ascending list of numbers, beginning with 0, is added, in front of each line of your file !



    Last edit: THEVENOT Guy 2014-05-15
  • Fool4UAnyway

    It's not a perfect solution, of course, but you could just temporarily change your files.

    1. Remove the first line, edit your file, replace the first line.

    2. Remove the newline character(s) at the end of the first line, edit your file, split line 0/1 again.