Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    add line breaks without breaking word

    Help wanted · · · – – – · · ·
    line separator help wanted help me please macros paragraph
    3
    5
    91
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Rose Greene
      Rose Greene last edited by

      i was wondering if there was a way i could add a line break every x amount of characters without breaking words? something kind of like this:

      before

      hello! this is just a fake line of text for this example. have a good day!
      

      after

      hello! this is just a 
      fake line of text for 
      this example. have a 
      good day!
      

      kind of like this website.

      i wanted to record a macro of it so i wouldn’t have to constantly go to the website mentioned.

      thank you!

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @Rose Greene last edited by

        @Rose-Greene ,

        It’s not a macro, because macro won’t change a setting… but if you go to Preferences > Margins/Border/Edge, and change the Vertical Edge Settings to 23 (for your example), then hit Ctrl+I (aka Edit > Line Operations > Split), it will split the line at the margin. So you can pick the appropriate Vertical Edge column and then use the Split command to do what you want.

        There are ways to get regular expression search/replace to do something similar, but this is much simpler, IMO.

        Rose Greene 1 Reply Last reply Reply Quote 4
        • Rose Greene
          Rose Greene @PeterJones last edited by

          @PeterJones This works great thanks!

          1 Reply Last reply Reply Quote 1
          • Abed99
            Abed99 last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Abed99
              Abed99 last edited by Abed99

              PeterJones mention a good way and here is another way using regex:

              search for :(\w+\.?!?\s){2}
              replace with : $&\r\n
              search mode : regular expression
              

              change 2 to the X amount of characters you want
              3.png

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors