Long line wrapping in Nano

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
45
down vote

favorite
13












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










share|improve this question

























    up vote
    45
    down vote

    favorite
    13












    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










    share|improve this question























      up vote
      45
      down vote

      favorite
      13









      up vote
      45
      down vote

      favorite
      13






      13





      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










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 2 '14 at 16:23









      codecowboy

      93051127




      93051127




















          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)






          share|improve this answer






















          • This was my biggest pet peeve in nano. Thanks for sorting this out.
            – user208145
            Mar 10 '17 at 5:36


















          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.






          share|improve this answer





























            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.






            share|improve this answer


















            • 3




              Meta $ = Alt+Shift+4
              – JamesTheAwesomeDude
              Apr 25 '17 at 1:13


















            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.






            share|improve this answer





























              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.






              share|improve this answer



























                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.






                share|improve this answer




















                  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',
                  convertImagesToLinks: false,
                  noModals: false,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: null,
                  bindNavPrevention: true,
                  postfix: "",
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  );



                  );













                   

                  draft saved


                  draft discarded


















                  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






























                  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)






                  share|improve this answer






















                  • This was my biggest pet peeve in nano. Thanks for sorting this out.
                    – user208145
                    Mar 10 '17 at 5:36















                  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)






                  share|improve this answer






















                  • This was my biggest pet peeve in nano. Thanks for sorting this out.
                    – user208145
                    Mar 10 '17 at 5:36













                  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)






                  share|improve this answer














                  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)







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  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

















                  • 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













                  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.






                  share|improve this answer


























                    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.






                    share|improve this answer
























                      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.






                      share|improve this answer














                      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.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 17 '14 at 13:27









                      slm♦

                      239k65494665




                      239k65494665










                      answered Nov 17 '14 at 12:31









                      chainsawmascara

                      14114




                      14114




















                          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.






                          share|improve this answer


















                          • 3




                            Meta $ = Alt+Shift+4
                            – JamesTheAwesomeDude
                            Apr 25 '17 at 1:13















                          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.






                          share|improve this answer


















                          • 3




                            Meta $ = Alt+Shift+4
                            – JamesTheAwesomeDude
                            Apr 25 '17 at 1:13













                          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.






                          share|improve this answer














                          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.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          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













                          • 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











                          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.






                          share|improve this answer


























                            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.






                            share|improve this answer
























                              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.






                              share|improve this answer














                              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.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited May 15 '17 at 14:35

























                              answered May 10 '17 at 14:12









                              bshea

                              1505




                              1505




















                                  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.






                                  share|improve this answer
























                                    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.






                                    share|improve this answer






















                                      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.






                                      share|improve this answer












                                      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.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Sep 5 at 22:11









                                      lodeOfCode

                                      111




                                      111




















                                          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.






                                          share|improve this answer
























                                            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.






                                            share|improve this answer






















                                              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.






                                              share|improve this answer












                                              Open the nanorc generally at ~/.nanorc or /etc/nanorc, comment out the line



                                              set nowrap


                                              And uncomment line



                                              set softwrap


                                              Hope it helps.







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Aug 24 at 10:25









                                              Prashant Shubham

                                              112




                                              112



























                                                   

                                                  draft saved


                                                  draft discarded















































                                                   


                                                  draft saved


                                                  draft discarded














                                                  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













































































                                                  Popular posts from this blog

                                                  How to check contact read email or not when send email to Individual?

                                                  Bahrain

                                                  Postfix configuration issue with fips on centos 7; mailgun relay