How to Disable Wrapping Lines in Nano?

My nano did not wrap long lines automatically at first, they just kept going. I do not know what I did but now the automatic wrapping is enabled.

I want to know how to reconfigure nano to disable automatic line wrapping, this has bothered me a lot.

I've seen the nano -w command that it comes without wrapping, but what I want is to disable it by default and run nano without having to worry about wrapping.

2 Answers

To change persistent settings for nano, we can edit the user-specific .nanorc file (/home/user/.nanorc). This file contains configuration settings that nano loads on start-up.

To disable line-wrapping, we need to specify the nowrap directive. Add this line to .nanorc:

set nowrap 

We may need to create this file if it doesn't exist. For more information about the available settings in this file, see the .nanorc man page:

$ man nanorc
5

For others like me that hit this question from google and only want to disable wrapping temporarily, press EscL.

That toggles "Hard wrapping of overlong lines".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest