LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   nano and line wrap (https://www.linuxquestions.org/questions/linux-software-2/nano-and-line-wrap-4175553284/)

tonj 09-12-2015 04:42 AM

nano and line wrap
 
I'm going nuts trying to get nano to wrap long lines, I've been trawling google for ages and nothing works. I've using nano-2.0.9-7.el6.x86_64 on centos 6.7. I've tried so many different things but nano will not wrap the text in the console screen and stuff in the nano manual is out of date.
I've tried editing nanorc, doesn't work. If I do esc -L in a file it says 'long line wrapping enabled', problem is the text stays the same and nothing wraps. I've always liked nano and used it for ages but this has got me growling. Thanks for any help.

ondoho 09-12-2015 04:59 AM

$HOME/.nanorc has no effect on your nano?
strange, works on my system.
what did you adjust to make it wrap and what is the current/desired behavior?
Code:

man nanorc
says there's nowrap and softwrap.

tonj 09-12-2015 06:40 AM

all I have in nanorc is:
set fill -8
and
# set nowrap

syg00 09-12-2015 07:05 AM

Double negative - you want "unset nowrap" to override /etc/nanorc (probably).
You can always test by passing command options (-r -8)

tonj 09-12-2015 07:27 AM

I don't understand (sorry).
do I need to put unset nowrap' into nanorc. or do I somehow put 'unset nowrap' into the nano command?

tonj 09-15-2015 06:36 AM

bump

can anyone please help on this, I cannot get nano to wrap text no matter what I do.

ondoho 09-18-2015 11:46 AM

what is the desired behavior? "wrap" allows multiple interpretations. what do you want nano to do exactly when a line is longer than your terminal?

tonj 09-18-2015 01:15 PM

break the remaining text (off screen) and wrap it to the next line

ondoho 09-21-2015 03:04 PM

Code:

#set nowrap
set softwrap

in ~/.nanorc.
i think it doesn't matter whether nowrap is set or commented out, it's the "set softwrap" that creates your desired behavior.

zuikway 09-21-2015 04:32 PM

What about the -w flag?
nano -w
is supposed to prevent wrapping long lines.
Wayne

22nds 12-08-2016 09:26 AM

I had the same problem with Esc + L, but then when I have edited the line (pressing space or any other key) the wrap jumped into action. I hope this helps somebody.

tonj 12-08-2016 10:05 AM

thanks for your feedback 22nds, that seems to work (in a way)


All times are GMT -5. The time now is 01:55 AM.