Long line wrapping in 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
add a comment |
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 |
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
99051228
99051228
add a comment |
add a comment |
7 Answers
7
active
oldest
votes
To see the word wrapping style you described, use nano's "soft wrapping": Esc+$.
The Esc+L command you (and everyone) tried does "hard wrapping."
Note on keystroke notation - if you are new to Linux or nano, 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 then is Esc, Shift+4.
Note on softwrap and formatting mistakes - Further, and especially if you are a new user to nano, be careful of softwrap. If you are editing a configuration file or something else that is sensitive to newlines or indents, formatting mistakes can be made. Until you get comfortable with softwrap’s behaviors, I suggest doing a quick check with softwrap off (do the key sequence again) before saving.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
nano linewrap
2
This was my biggest pet peeve in nano. Thanks for sorting this out.
– user208145
Mar 10 '17 at 5:36
add a comment |
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 |
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 |
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 |
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 |
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 |
The configuration settings for nano 1, nano 2, and nano 3 are different.
On nano 1, you only have the set nowrap
setting which disables all wrapping.
On nano 2, set softwrap
enables softwrapping and disables hardwrapping.
On nano 3, set softwrap
is ignored and nano continues to hardwrap unless you also set set nowrap
.
On nano 2 and 3, no set nowrap
only disables hardwrapping! and on nano 3 you MUST use it if you want softwrapping.
So if you want text wrapping for long lines that doesn't break your configuration files (softwrapping only), this works for versions 2 and 3: ~/.nanorc
set nowrap
set softwrap
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
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
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
To see the word wrapping style you described, use nano's "soft wrapping": Esc+$.
The Esc+L command you (and everyone) tried does "hard wrapping."
Note on keystroke notation - if you are new to Linux or nano, 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 then is Esc, Shift+4.
Note on softwrap and formatting mistakes - Further, and especially if you are a new user to nano, be careful of softwrap. If you are editing a configuration file or something else that is sensitive to newlines or indents, formatting mistakes can be made. Until you get comfortable with softwrap’s behaviors, I suggest doing a quick check with softwrap off (do the key sequence again) before saving.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
nano linewrap
2
This was my biggest pet peeve in nano. Thanks for sorting this out.
– user208145
Mar 10 '17 at 5:36
add a comment |
To see the word wrapping style you described, use nano's "soft wrapping": Esc+$.
The Esc+L command you (and everyone) tried does "hard wrapping."
Note on keystroke notation - if you are new to Linux or nano, 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 then is Esc, Shift+4.
Note on softwrap and formatting mistakes - Further, and especially if you are a new user to nano, be careful of softwrap. If you are editing a configuration file or something else that is sensitive to newlines or indents, formatting mistakes can be made. Until you get comfortable with softwrap’s behaviors, I suggest doing a quick check with softwrap off (do the key sequence again) before saving.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
nano linewrap
2
This was my biggest pet peeve in nano. Thanks for sorting this out.
– user208145
Mar 10 '17 at 5:36
add a comment |
To see the word wrapping style you described, use nano's "soft wrapping": Esc+$.
The Esc+L command you (and everyone) tried does "hard wrapping."
Note on keystroke notation - if you are new to Linux or nano, 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 then is Esc, Shift+4.
Note on softwrap and formatting mistakes - Further, and especially if you are a new user to nano, be careful of softwrap. If you are editing a configuration file or something else that is sensitive to newlines or indents, formatting mistakes can be made. Until you get comfortable with softwrap’s behaviors, I suggest doing a quick check with softwrap off (do the key sequence again) before saving.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
nano linewrap
To see the word wrapping style you described, use nano's "soft wrapping": Esc+$.
The Esc+L command you (and everyone) tried does "hard wrapping."
Note on keystroke notation - if you are new to Linux or nano, 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 then is Esc, Shift+4.
Note on softwrap and formatting mistakes - Further, and especially if you are a new user to nano, be careful of softwrap. If you are editing a configuration file or something else that is sensitive to newlines or indents, formatting mistakes can be made. Until you get comfortable with softwrap’s behaviors, I suggest doing a quick check with softwrap off (do the key sequence again) before saving.
Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)
nano linewrap
edited Nov 18 at 14:19
answered Jul 23 '15 at 18:14
coreyt
80664
80664
2
This was my biggest pet peeve in nano. Thanks for sorting this out.
– user208145
Mar 10 '17 at 5:36
add a comment |
2
This was my biggest pet peeve in nano. Thanks for sorting this out.
– user208145
Mar 10 '17 at 5:36
2
2
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 |
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 |
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 |
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♦
247k66508675
247k66508675
answered Nov 17 '14 at 12:31
chainsawmascara
14114
14114
add a comment |
add a comment |
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 |
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 |
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,73661225
3,73661225
answered Mar 4 '17 at 12:33
Jonas
23123
23123
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 |
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 |
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 |
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
16016
16016
add a comment |
add a comment |
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 |
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 |
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
312
312
add a comment |
add a comment |
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 |
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 |
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 |
The configuration settings for nano 1, nano 2, and nano 3 are different.
On nano 1, you only have the set nowrap
setting which disables all wrapping.
On nano 2, set softwrap
enables softwrapping and disables hardwrapping.
On nano 3, set softwrap
is ignored and nano continues to hardwrap unless you also set set nowrap
.
On nano 2 and 3, no set nowrap
only disables hardwrapping! and on nano 3 you MUST use it if you want softwrapping.
So if you want text wrapping for long lines that doesn't break your configuration files (softwrapping only), this works for versions 2 and 3: ~/.nanorc
set nowrap
set softwrap
New contributor
add a comment |
The configuration settings for nano 1, nano 2, and nano 3 are different.
On nano 1, you only have the set nowrap
setting which disables all wrapping.
On nano 2, set softwrap
enables softwrapping and disables hardwrapping.
On nano 3, set softwrap
is ignored and nano continues to hardwrap unless you also set set nowrap
.
On nano 2 and 3, no set nowrap
only disables hardwrapping! and on nano 3 you MUST use it if you want softwrapping.
So if you want text wrapping for long lines that doesn't break your configuration files (softwrapping only), this works for versions 2 and 3: ~/.nanorc
set nowrap
set softwrap
New contributor
add a comment |
The configuration settings for nano 1, nano 2, and nano 3 are different.
On nano 1, you only have the set nowrap
setting which disables all wrapping.
On nano 2, set softwrap
enables softwrapping and disables hardwrapping.
On nano 3, set softwrap
is ignored and nano continues to hardwrap unless you also set set nowrap
.
On nano 2 and 3, no set nowrap
only disables hardwrapping! and on nano 3 you MUST use it if you want softwrapping.
So if you want text wrapping for long lines that doesn't break your configuration files (softwrapping only), this works for versions 2 and 3: ~/.nanorc
set nowrap
set softwrap
New contributor
The configuration settings for nano 1, nano 2, and nano 3 are different.
On nano 1, you only have the set nowrap
setting which disables all wrapping.
On nano 2, set softwrap
enables softwrapping and disables hardwrapping.
On nano 3, set softwrap
is ignored and nano continues to hardwrap unless you also set set nowrap
.
On nano 2 and 3, no set nowrap
only disables hardwrapping! and on nano 3 you MUST use it if you want softwrapping.
So if you want text wrapping for long lines that doesn't break your configuration files (softwrapping only), this works for versions 2 and 3: ~/.nanorc
set nowrap
set softwrap
New contributor
New contributor
answered 7 mins ago
x0a
1011
1011
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown