LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04:42 AM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 546

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, 04:59 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
$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, 06:40 AM   #3
tonj
Member
 
Registered: Sep 2008
Posts: 546

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

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
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, 07:27 AM   #5
tonj
Member
 
Registered: Sep 2008
Posts: 546

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, 06:36 AM   #6
tonj
Member
 
Registered: Sep 2008
Posts: 546

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, 11:46 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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, 01:15 PM   #8
tonj
Member
 
Registered: Sep 2008
Posts: 546

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

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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 03:05 PM.
 
Old 09-21-2015, 04: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, 09: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, 10:05 AM   #12
tonj
Member
 
Registered: Sep 2008
Posts: 546

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


Reply



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 03:50 PM
"enscript --word-wrap" does not wrap line of text file powah Linux - General 3 05-16-2006 09:12 PM
is it possible to do this in VIM with line wrap on? hedpe Linux - Software 5 04-19-2006 06:19 PM
VI wrap line Ephracis Linux - Newbie 4 11-17-2005 05:46 PM
Setting Nano to wrap at 72 cols, fails macondo Debian 2 11-09-2004 12:18 PM

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

All times are GMT -5. The time now is 10:56 AM.

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
Open Source Consulting | Domain Registration