Menu

Help with syntax bracket indenting

2009-05-08
2012-11-13
  • Devon Elliott

    Devon Elliott - 2009-05-08

    It's hard to try and explain what I'm getting at, but...

    I've been using Crimson Editor, and while it lacks in features compared to Notepad++, the one thing that I cannot live without in my editor is the auto de-indenting of completed brackets when coding... I know that probably does not make sense, and that's probably because I'm not sure how to word it...

    This is how Notepad++ functions for me...

    ---
    body {
         background:url('image.jpg') #fff top left no-repeat;
         font-family:Verdana,Tahoma,Sans-Serif;
         color:#000;
         }
    ---

    This is how I want it to be...

    ---
    body {
         background:url('image.jpg') #fff top left no-repeat;
         font-family:Verdana,Tahoma,Sans-Serif;
         color:#000;
    }
    ---

    I want Notepad++ to automatically take the closing bracket back to the beginning of the line of the opening bracket, as I've displayed directly above... I realize my syntax might be different than:

    ---
    body
         {
              background:url('image.jpg') #fff top left no-repeat;
              font-family:Verdana,Tahoma,Sans-Serif;
              color:#000;
         }
    ---

    But CrimsonEditor does this, and it's something I've become dependent on. It takes too much time and ruins my "flow," so to say, if I have to stop coding and backspace after every closing bracket to make sure it's properly aligned...

    Any help on how to get Notepad++ to do this would be greatly appreciated.

     
    • cchris

      cchris - 2009-05-10

      You can always TextFX -> TextFX Edit -> Reindent C++ code after the facts. Or Surround and indent { text lines }, on the same menu section.

      But I don't think it is done in real time. I always want to disable the distracting feature in other editors which have it, anyway...

      Perhaps try to formalise your feature request on IdeaTorent, so that there is a chance to gauge how popular it would be. The tool is new, so the pages aren't too much visited so far.
      You still may have to use some visible character instead of leading tab/spaces though

      CChris

       
    • Devon Elliott

      Devon Elliott - 2009-05-08

      You apparently cannot use tabs or multiple spaces...

      Lets try this again...

      This is how Notepad++ functions for me...

      ---
      body {
      [tab]background:url('image.jpg') #fff top left no-repeat;
      [tab]font-family:Verdana,Tahoma,Sans-Serif;
      [tab]color:#000;
      [tab]}
      ---

      This is how I want it to be...

      ---
      body {
      [tab]background:url('image.jpg') #fff top left no-repeat;
      [tab]font-family:Verdana,Tahoma,Sans-Serif;
      [tab]color:#000;
      }
      ---

      I'm failing miserably and getting my request across... I'm sorry if I've confused you.

       
    • Devon Elliott

      Devon Elliott - 2009-05-08

      I really wish there was an edit ability on these posts...

      Also, on the same note, I was wondering how to get Notepad++ to auto tab after opening bracket on the new line, as such...

      body {
      [autotab]content
      [autoDEtab?]}

      If that makes sense, lol.

       
MongoDB Logo MongoDB