Long line wrapping in Nano
Clash Royale CLAN TAG#URR8PPP
up vote
45
down vote
favorite
When editing an authorised_keys file in Nano, I want to wrap long lines so that I can see the end of the lines (i.e tell whose key it is). Essentially I want it to look like the output of cat authorised_keys
So, I hit Esc + L which is the meta key for enabling long line wrapping on my platform and I see the message to say long line wrapping has been enabled but the lines do not wrap as I expect.
I'm using Terminal on OSX 10.8.5
ubuntu nano
add a comment |Â
up vote
45
down vote
favorite
When editing an authorised_keys file in Nano, I want to wrap long lines so that I can see the end of the lines (i.e tell whose key it is). Essentially I want it to look like the output of cat authorised_keys
So, I hit Esc + L which is the meta key for enabling long line wrapping on my platform and I see the message to say long line wrapping has been enabled but the lines do not wrap as I expect.
I'm using Terminal on OSX 10.8.5
ubuntu nano
add a comment |Â
up vote
45
down vote
favorite
up vote
45
down vote
favorite
When editing an authorised_keys file in Nano, I want to wrap long lines so that I can see the end of the lines (i.e tell whose key it is). Essentially I want it to look like the output of cat authorised_keys
So, I hit Esc + L which is the meta key for enabling long line wrapping on my platform and I see the message to say long line wrapping has been enabled but the lines do not wrap as I expect.
I'm using Terminal on OSX 10.8.5
ubuntu nano
When editing an authorised_keys file in Nano, I want to wrap long lines so that I can see the end of the lines (i.e tell whose key it is). Essentially I want it to look like the output of cat authorised_keys
So, I hit Esc + L which is the meta key for enabling long line wrapping on my platform and I see the message to say long line wrapping has been enabled but the lines do not wrap as I expect.
I'm using Terminal on OSX 10.8.5
ubuntu nano
ubuntu nano
asked Apr 2 '14 at 16:23
codecowboy
93051127
93051127
add a comment |Â
add a comment |Â
6 Answers
6
active
oldest
votes
up vote
58
down vote
accepted
To see the word wrapping you are expecting, use Esc+$.
This is called "soft wrapping." The L operator you used is called "hard wrapping."
If you are a new user to nano, note that the notation Esc+$ does not mean hold down escape while pressing $. It means press and release Esc and then press $. The full key press sequence would Esc+Shift+4.
Further, and especially if you are a new user to nano, be careful of softwrap! If you are editing a configuration file, code or something that is sensitive to newlines and/or indents, I suggest making sure "soft" line wrapping is off in those cases.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
add a comment |Â
up vote
14
down vote
Just searched for nano line wrapping and this came high in results, so I'll post my findings for GNU nano 2.2.6 on the Raspberry Pi, Raspbian GNU/Linux 7: Esc+L gave me the same message; but for the line wrapping to take effect I had to modify the line. As soon as I typed another character on the long line, wrapping kicked in.
add a comment |Â
up vote
12
down vote
I'm reading the replies here and need to set this straight!
Nano supports two different forms of line wrapping, and it can be essential to know the difference!
First, the Meta key below is often the Alt key, but not necessarily.
Soft line wrapping is activated with Meta-$. Wraps lines without inserting line break characters into the file. That is, the effect is purely visual.
Hard line wrapping is activated with Meta-L. Wraps lines by inserting line breaks into the file. The file is physically changed.
So if you activate it in a file where wraps are meaningful (configuration files, programming languages, scripts), you basically never want the hard line wraps or it'll change the meaning of the code.
Also, you'd have found these shortcuts with ^G (i.e. Ctrl-G) in Nano.
3
Meta
$
=Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
add a comment |Â
up vote
4
down vote
Setting a short alias for your nano editor also works well.
I normally use:
alias e='nano -$cwS'
alias se='sudo nano -$cwS'
(Set these in ~/.bashrc
(or .bash_aliases
on some systems) or your favorite shell startup)
Flags/Options used:
$
= Enable soft-wrapping of lines (escaped using backslash)c
= Show constant cursor position (at bottom)w
= Disable any 'hard wrapping'S
= Smooth scrolling
And (as already mentioned) once in editor, use Esc, $ to toggle soft-wrapping ON/OFF.
add a comment |Â
up vote
1
down vote
Mac users be advised the version of Nano shipped with High Sierra (v2.0.6) or earlier doesn't support soft line wrapping as described here. You'll get an unknown command error. v2.2 is the earliest version with mention of soft wrap in the man pages. So don't spend an hour trying all these solutions like I did.
Esc+L does work as expected.
add a comment |Â
up vote
0
down vote
Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line
set nowrap
And uncomment line
set softwrap
Hope it helps.
add a comment |Â
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
58
down vote
accepted
To see the word wrapping you are expecting, use Esc+$.
This is called "soft wrapping." The L operator you used is called "hard wrapping."
If you are a new user to nano, note that the notation Esc+$ does not mean hold down escape while pressing $. It means press and release Esc and then press $. The full key press sequence would Esc+Shift+4.
Further, and especially if you are a new user to nano, be careful of softwrap! If you are editing a configuration file, code or something that is sensitive to newlines and/or indents, I suggest making sure "soft" line wrapping is off in those cases.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
add a comment |Â
up vote
58
down vote
accepted
To see the word wrapping you are expecting, use Esc+$.
This is called "soft wrapping." The L operator you used is called "hard wrapping."
If you are a new user to nano, note that the notation Esc+$ does not mean hold down escape while pressing $. It means press and release Esc and then press $. The full key press sequence would Esc+Shift+4.
Further, and especially if you are a new user to nano, be careful of softwrap! If you are editing a configuration file, code or something that is sensitive to newlines and/or indents, I suggest making sure "soft" line wrapping is off in those cases.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
add a comment |Â
up vote
58
down vote
accepted
up vote
58
down vote
accepted
To see the word wrapping you are expecting, use Esc+$.
This is called "soft wrapping." The L operator you used is called "hard wrapping."
If you are a new user to nano, note that the notation Esc+$ does not mean hold down escape while pressing $. It means press and release Esc and then press $. The full key press sequence would Esc+Shift+4.
Further, and especially if you are a new user to nano, be careful of softwrap! If you are editing a configuration file, code or something that is sensitive to newlines and/or indents, I suggest making sure "soft" line wrapping is off in those cases.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
To see the word wrapping you are expecting, use Esc+$.
This is called "soft wrapping." The L operator you used is called "hard wrapping."
If you are a new user to nano, note that the notation Esc+$ does not mean hold down escape while pressing $. It means press and release Esc and then press $. The full key press sequence would Esc+Shift+4.
Further, and especially if you are a new user to nano, be careful of softwrap! If you are editing a configuration file, code or something that is sensitive to newlines and/or indents, I suggest making sure "soft" line wrapping is off in those cases.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
edited May 5 at 22:32
answered Jul 23 '15 at 18:14
coreyt
69663
69663
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
add a comment |Â
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
This was my biggest pet peeve in nano. Thanks for sorting this out.
â user208145
Mar 10 '17 at 5:36
add a comment |Â
up vote
14
down vote
Just searched for nano line wrapping and this came high in results, so I'll post my findings for GNU nano 2.2.6 on the Raspberry Pi, Raspbian GNU/Linux 7: Esc+L gave me the same message; but for the line wrapping to take effect I had to modify the line. As soon as I typed another character on the long line, wrapping kicked in.
add a comment |Â
up vote
14
down vote
Just searched for nano line wrapping and this came high in results, so I'll post my findings for GNU nano 2.2.6 on the Raspberry Pi, Raspbian GNU/Linux 7: Esc+L gave me the same message; but for the line wrapping to take effect I had to modify the line. As soon as I typed another character on the long line, wrapping kicked in.
add a comment |Â
up vote
14
down vote
up vote
14
down vote
Just searched for nano line wrapping and this came high in results, so I'll post my findings for GNU nano 2.2.6 on the Raspberry Pi, Raspbian GNU/Linux 7: Esc+L gave me the same message; but for the line wrapping to take effect I had to modify the line. As soon as I typed another character on the long line, wrapping kicked in.
Just searched for nano line wrapping and this came high in results, so I'll post my findings for GNU nano 2.2.6 on the Raspberry Pi, Raspbian GNU/Linux 7: Esc+L gave me the same message; but for the line wrapping to take effect I had to modify the line. As soon as I typed another character on the long line, wrapping kicked in.
edited Nov 17 '14 at 13:27
slmâ¦
239k65494665
239k65494665
answered Nov 17 '14 at 12:31
chainsawmascara
14114
14114
add a comment |Â
add a comment |Â
up vote
12
down vote
I'm reading the replies here and need to set this straight!
Nano supports two different forms of line wrapping, and it can be essential to know the difference!
First, the Meta key below is often the Alt key, but not necessarily.
Soft line wrapping is activated with Meta-$. Wraps lines without inserting line break characters into the file. That is, the effect is purely visual.
Hard line wrapping is activated with Meta-L. Wraps lines by inserting line breaks into the file. The file is physically changed.
So if you activate it in a file where wraps are meaningful (configuration files, programming languages, scripts), you basically never want the hard line wraps or it'll change the meaning of the code.
Also, you'd have found these shortcuts with ^G (i.e. Ctrl-G) in Nano.
3
Meta
$
=Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
add a comment |Â
up vote
12
down vote
I'm reading the replies here and need to set this straight!
Nano supports two different forms of line wrapping, and it can be essential to know the difference!
First, the Meta key below is often the Alt key, but not necessarily.
Soft line wrapping is activated with Meta-$. Wraps lines without inserting line break characters into the file. That is, the effect is purely visual.
Hard line wrapping is activated with Meta-L. Wraps lines by inserting line breaks into the file. The file is physically changed.
So if you activate it in a file where wraps are meaningful (configuration files, programming languages, scripts), you basically never want the hard line wraps or it'll change the meaning of the code.
Also, you'd have found these shortcuts with ^G (i.e. Ctrl-G) in Nano.
3
Meta
$
=Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
add a comment |Â
up vote
12
down vote
up vote
12
down vote
I'm reading the replies here and need to set this straight!
Nano supports two different forms of line wrapping, and it can be essential to know the difference!
First, the Meta key below is often the Alt key, but not necessarily.
Soft line wrapping is activated with Meta-$. Wraps lines without inserting line break characters into the file. That is, the effect is purely visual.
Hard line wrapping is activated with Meta-L. Wraps lines by inserting line breaks into the file. The file is physically changed.
So if you activate it in a file where wraps are meaningful (configuration files, programming languages, scripts), you basically never want the hard line wraps or it'll change the meaning of the code.
Also, you'd have found these shortcuts with ^G (i.e. Ctrl-G) in Nano.
I'm reading the replies here and need to set this straight!
Nano supports two different forms of line wrapping, and it can be essential to know the difference!
First, the Meta key below is often the Alt key, but not necessarily.
Soft line wrapping is activated with Meta-$. Wraps lines without inserting line break characters into the file. That is, the effect is purely visual.
Hard line wrapping is activated with Meta-L. Wraps lines by inserting line breaks into the file. The file is physically changed.
So if you activate it in a file where wraps are meaningful (configuration files, programming languages, scripts), you basically never want the hard line wraps or it'll change the meaning of the code.
Also, you'd have found these shortcuts with ^G (i.e. Ctrl-G) in Nano.
edited Mar 4 '17 at 12:39
Thomas
3,63141124
3,63141124
answered Mar 4 '17 at 12:33
Jonas
22123
22123
3
Meta
$
=Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
add a comment |Â
3
Meta
$
=Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
3
3
Meta
$
= Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
Meta
$
= Alt
+Shift
+4
â JamesTheAwesomeDude
Apr 25 '17 at 1:13
add a comment |Â
up vote
4
down vote
Setting a short alias for your nano editor also works well.
I normally use:
alias e='nano -$cwS'
alias se='sudo nano -$cwS'
(Set these in ~/.bashrc
(or .bash_aliases
on some systems) or your favorite shell startup)
Flags/Options used:
$
= Enable soft-wrapping of lines (escaped using backslash)c
= Show constant cursor position (at bottom)w
= Disable any 'hard wrapping'S
= Smooth scrolling
And (as already mentioned) once in editor, use Esc, $ to toggle soft-wrapping ON/OFF.
add a comment |Â
up vote
4
down vote
Setting a short alias for your nano editor also works well.
I normally use:
alias e='nano -$cwS'
alias se='sudo nano -$cwS'
(Set these in ~/.bashrc
(or .bash_aliases
on some systems) or your favorite shell startup)
Flags/Options used:
$
= Enable soft-wrapping of lines (escaped using backslash)c
= Show constant cursor position (at bottom)w
= Disable any 'hard wrapping'S
= Smooth scrolling
And (as already mentioned) once in editor, use Esc, $ to toggle soft-wrapping ON/OFF.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Setting a short alias for your nano editor also works well.
I normally use:
alias e='nano -$cwS'
alias se='sudo nano -$cwS'
(Set these in ~/.bashrc
(or .bash_aliases
on some systems) or your favorite shell startup)
Flags/Options used:
$
= Enable soft-wrapping of lines (escaped using backslash)c
= Show constant cursor position (at bottom)w
= Disable any 'hard wrapping'S
= Smooth scrolling
And (as already mentioned) once in editor, use Esc, $ to toggle soft-wrapping ON/OFF.
Setting a short alias for your nano editor also works well.
I normally use:
alias e='nano -$cwS'
alias se='sudo nano -$cwS'
(Set these in ~/.bashrc
(or .bash_aliases
on some systems) or your favorite shell startup)
Flags/Options used:
$
= Enable soft-wrapping of lines (escaped using backslash)c
= Show constant cursor position (at bottom)w
= Disable any 'hard wrapping'S
= Smooth scrolling
And (as already mentioned) once in editor, use Esc, $ to toggle soft-wrapping ON/OFF.
edited May 15 '17 at 14:35
answered May 10 '17 at 14:12
bshea
1505
1505
add a comment |Â
add a comment |Â
up vote
1
down vote
Mac users be advised the version of Nano shipped with High Sierra (v2.0.6) or earlier doesn't support soft line wrapping as described here. You'll get an unknown command error. v2.2 is the earliest version with mention of soft wrap in the man pages. So don't spend an hour trying all these solutions like I did.
Esc+L does work as expected.
add a comment |Â
up vote
1
down vote
Mac users be advised the version of Nano shipped with High Sierra (v2.0.6) or earlier doesn't support soft line wrapping as described here. You'll get an unknown command error. v2.2 is the earliest version with mention of soft wrap in the man pages. So don't spend an hour trying all these solutions like I did.
Esc+L does work as expected.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Mac users be advised the version of Nano shipped with High Sierra (v2.0.6) or earlier doesn't support soft line wrapping as described here. You'll get an unknown command error. v2.2 is the earliest version with mention of soft wrap in the man pages. So don't spend an hour trying all these solutions like I did.
Esc+L does work as expected.
Mac users be advised the version of Nano shipped with High Sierra (v2.0.6) or earlier doesn't support soft line wrapping as described here. You'll get an unknown command error. v2.2 is the earliest version with mention of soft wrap in the man pages. So don't spend an hour trying all these solutions like I did.
Esc+L does work as expected.
answered Sep 5 at 22:11
lodeOfCode
111
111
add a comment |Â
add a comment |Â
up vote
0
down vote
Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line
set nowrap
And uncomment line
set softwrap
Hope it helps.
add a comment |Â
up vote
0
down vote
Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line
set nowrap
And uncomment line
set softwrap
Hope it helps.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line
set nowrap
And uncomment line
set softwrap
Hope it helps.
Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line
set nowrap
And uncomment line
set softwrap
Hope it helps.
answered Aug 24 at 10:25
Prashant Shubham
112
112
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f122795%2flong-line-wrapping-in-nano%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password