Menu

word-wrap block indent?

2008-01-23
2012-11-13
  • Nobody/Anonymous

    is there a way to do this? to automatically block indent normal text on a wordwrap?

    all i want to do is take a long string, say 500 characters long and put it in a text document that will only handle 200 characters wide, with a tab in front. i would then want n++ to wrap line of text starting where i tabbed that first word in. if that doesn't make sense, i'll make an example below, i hope it helps. please note that "<tab>" equals an actual tab. thanks in advance guys and gals!

    Heading 1 - A new way...
    <tab>This is really
    <tab>just a long string
    <tab>of words, but is
    <tab>wrapped up nicely.

     
    • pshute

      pshute - 2008-01-25

      "I would like it to be dynamic"

      If you want it to be dynamic then I too really think you're asking too much of a text editor.  That kind of thing (dynamic wrapping) is a basic function of a word processor.  Unless you have a special reason to use Notepad++ for this then I wouldn't even consider it.

       
    • fidvo

      fidvo - 2008-01-23

      So if I understand you correctly, you want to have it automatically cut the lines at 200 characters (adjusting for word boundaries), then put tabs at the beginning of only the lines that were previously the middle of the lines?

      e.g.

      This is a long line.  I am splitting it arbitrarily, but pretend that it's being split at 200 characters.
      This is another long line.  I'm also splitting this one arbitrarily.

      would become:

      This is a long line.  I
      <tab>am splitting it
      <tab>arbitrarily, but pretend that it's
      <tab>being split at 200 characters.
      This is another long
      <tab>line.  I'm also splitting
      <tab>this one arbitrarily.

      Is this right?

      I don't know if there's a quick and easy way to do it, but I think you might be able to accomplish it with the Simple Script plugin.  I'll have to think about it for a bit.  If I figure out a script that would do it, I'll post it here.

       
    • fidvo

      fidvo - 2008-01-23

      Okay, this script almost gets you what you want.

      It adds a marker at the beginning of the line.  I arbitrarily chose "ÿ" (ASCII 255) because I'm assuming you don't have any lines that begin with it already, but you can use any character you want.

      It wraps at 200, adds tabs to the beginning of every line, then removes the tabs and markers from any line that has the marker.

      The only problem, and this may or may not be important, is that because it added the marker, each of the un-tabbed lines will be at most 199 characters instead of 200.  If you're not too worried about that, it should work.

      Here is the script:

      BeginLine("\#255 ")
      Wrap(200,0)
      BeginLine("\t")
      StripLeft("\t\#255 ")

       
    • Nobody/Anonymous

      Okay this is almost what I want... To give you the bigger picture, I want to use this for writing notes for university, and I'm anal when it comes to formatting.

      I will use these 3 sentences in the examples below, each of them are on one single line:

      .

      1) Heading 34 - The wonders of the universe.

      2) Oh, the wonders of the universe, how brave it is, sitting out there, all alone...

      3) - Definition: Universe: In economics and marketing a universe is a population to be studied or measured.

      .

      Okay, so the third line is a "subsection" of the second line, therefore every wrap it has to make, I would like it to be automatically indented.

      So, normal text editors do this all the time:

      .

      Heading 34 - The wonders of
      the universe.

      Oh, the wonders of the universe,
      how brave it is, sitting out
      there, all alone...

      <tab>- Definition: Universe: In
      economics and marketing a
      universe is a population to be
      studied or measured.

      .

      While this is what I want N++ to do:

      .

      Heading 34 - The wonders of
      the universe.

      Oh, the wonders of the universe,
      how brave it is, sitting out
      there, all alone...

      <tab>- Definition: Universe: In
      <tab>economics and marketing a
      <tab>universe is a population to be
      <tab>studied or measured.

      .

      Now, maybe this is impossible with N++, I don't know, but I wouldn't want the "width" set to a fixed value, I would like it to be dynamic, so depending on how big the N++ window is, or when I go to print the document, I get the exact same effect...

      One thing to perhaps note, is I will always, when starting a "subsection", start it off with a "-". You can see this in the examples above, so if that helps, great!

      So again, if this is a simple script that someone can whip up really quick, that'd be awesome... But if anyone knows of a program that will do this (I did find one called Textpad 5) easier, if you could relay the name of the program to me, that'd be great. One of the biggest things I need in a program is for it's preferences to be written in the program directory, as this program will sit on a USB drive, which I will move to many computers for usage.

      Thanks in advance, all!

       
    • fidvo

      fidvo - 2008-01-23

      I understand now.  Unfortunately, I don't think it can be done in Simple Script.  Also, you want it just to be wrapped on the display, not to change the actual document itself.

      I think your request is, sad to say, impossible in Notepad++.  I'd be happy to be proven wrong, though.