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...
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
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".