LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-12-2015, 05:42 AM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 505

Rep: Reputation: 37
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.
 
Old 09-12-2015, 05:59 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,400
Blog Entries: 9

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
$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.
 
Old 09-12-2015, 07:40 AM   #3
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
all I have in nanorc is:
set fill -8
and
# set nowrap
 
Old 09-12-2015, 08:05 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,479

Rep: Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095Reputation: 3095
Double negative - you want "unset nowrap" to override /etc/nanorc (probably).
You can always test by passing command options (-r -8)
 
Old 09-12-2015, 08:27 AM   #5
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
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?
 
Old 09-15-2015, 07:36 AM   #6
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
bump

can anyone please help on this, I cannot get nano to wrap text no matter what I do.
 
Old 09-18-2015, 12:46 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,400
Blog Entries: 9

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
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?
 
Old 09-18-2015, 02:15 PM   #8
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
break the remaining text (off screen) and wrap it to the next line
 
Old 09-21-2015, 04:04 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,400
Blog Entries: 9

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
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.

Last edited by ondoho; 09-21-2015 at 04:05 PM.
 
Old 09-21-2015, 05:32 PM   #10
zuikway
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Rep: Reputation: 2
What about the -w flag?
nano -w
is supposed to prevent wrapping long lines.
Wayne
 
Old 12-08-2016, 10:26 AM   #11
22nds
LQ Newbie
 
Registered: Dec 2016
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 12-08-2016, 11:05 AM   #12
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
thanks for your feedback 22nds, that seems to work (in a way)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Force nano to word wrap? Calab Linux - General 2 09-23-2007 04:50 PM
"enscript --word-wrap" does not wrap line of text file powah Linux - General 3 05-16-2006 10:12 PM
is it possible to do this in VIM with line wrap on? hedpe Linux - Software 5 04-19-2006 07:19 PM
VI wrap line Ephracis Linux - Newbie 4 11-17-2005 06:46 PM
Setting Nano to wrap at 72 cols, fails macondo Debian 2 11-09-2004 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration