3

I am writing long lines of data to a text file using Python. But when I open the text file using gedit, I don't find that the lines that I wrote are displayed into one line each (i.e every line from the data that I wrote is divided into one or more lines in the file as shown in the photo).

screenshot with line wrap

What I want is to be able to scroll horizontally with gedit so that the lines that I write will be displayed in one line each.
Is it possible to scroll horizontally in gedit?

  • Try holding Shift and scrolling. That's how horizontal scrolling works in most modern apps – Sergiy Kolodyazhnyy Dec 21 '18 at 11:28
  • @SergiyKolodyazhnyy The scroll bar doesn't appear until you turn off Text Wrapping. Please see my answer below. Thanks :) – WinEunuuchs2Unix Dec 21 '18 at 12:23
5

On the window bottom of gedit click on the Line number / Column number section:

gedit text wrapping.png

Uncheck the Text wrapping option and a horizontal scroll box will then appear. Lines will no longer be wrapped.


If you want the setting to be permanent change your preferences. Use: Edit => Preverences => View => Enable text wrapping:

gedit preferences menu.png


You can't access preferences if you are using sudo -H gedit though. You need to do this with regular user using gedit only. Then you can have sudo inherit your user preferences with a script such as this: How can I sync my root gedit with my user gedit's preferences?

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.