For your Text Editor(gedit), select edit...

then preferences...

and finally check box beside display line numbers.