Menu

How do I enforce an automatic line-break?

2008-09-11
2012-11-13
  • r. stephen newberry

    I've been plodding through my MS, line-by-line, installing line breaks at column 67  (my preference), and THERE MUST BE AN EASIER WAY!!!

    Macros?

    But I don't see a way to define the default line-length, and in an editor as smart as this one, I'm sure therre IS a way. 

    HelloOO?

    [stevnewb@att.net]

     
    • pshute

      pshute - 2008-09-16

      The TextFX Edit Plugin has an option to wrap all the text at whatever column you want.  It's a one off process, so if you add lines you'll have to do it again, but better than doing it by hand.

      Are there any editors that actually insert a newline when they wrap?

       
    • Airdrik

      Airdrik - 2008-09-11

      Are you just adding a line break every 67 characters, or are you going to the 67th character, backing up to a break point (e.g. after a white space character or puntuation mark)?

      If you are just adding a line break every 67 characters you can do a regex replace of:
      (..............................................)  #using 67 '.'s, each '.' represents any character
      with:
      \1\n
      (and then change EOL style from unix to whatever platform you are using)

      If you are going to the 67th character then backing up to a break point, I don't know how to do that using regex (or even if you can in regex).  Instead I would write a script (perl/python/ruby/pick your favorite scripting language) to break up the text in the file.