How to show line numbers in Gedit

In the GNOME Shell desktop environment, accessing gedit is fairly straightforward. Click the Activities icon in the upper-right corner of the desktop window. When the search bar appears, click within the bar to access it, type gedit or text editor, and then click Text Editor.

If desired, you can start gedit from the command-line prompt in a GUI terminal emulator:

$ gedit myfile.txt

If we want every line in the text file to be shown with a line number automatically, we can do so by enabling it in the preferences.

1. Open the preferences as shown below.

2. On the view tab, select the Display line numbers and close the preferences window.

3. Now as you type in the file, each line will be shown with a line number.

But note that this is just to display and the line numbers are not part of the file that gets saved.

Conclusion

The GNOME Project also provides a graphical text editor for programmers. The gedit editor provides some advanced features such as code syntax highlighting and line numbering, but it was designed to be a bare-bones editor. To spruce up the gedit editor, developers created plugins, which expand the features available in gedit. Plugins include a spell-checker, a terminal emulator, and a file browser.

Related Post