Community
    • Login

    HTML Auto-indent

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 6.1k Views
    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.
    • Chema RamosC
      Chema Ramos
      last edited by

      Hi,

      I’d like to set Auto-indentation for HTML coding. That would mean that as I’m typing the text is formatted:

      <!DOCTYPE html>

      <html>

      <head>
      	<title>A web</title>
      </head>
      
      <body>
      	<p>View</p>
      	<p>Another View</p>
      	
      </body>
      

      Rather than
      <html>
      <head>
      <title>A web</title>
      </head>

      I have auto-indent selected under MISC but doesn’t seem to do anything of this and by using Plug-in Tidy2 you get that, but it adds some code too. Is there any way to get that automatically?
      Thanks in advance

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Chema Ramos
        last edited by Claudia Frank

        Hello @Chema-Ramos,

        npp’s auto-ident does ident to current level, which means you do the first indent
        and npp keeps doing it for the nex lines but only at this level.

        In regards to your wish having this automatically indented for all levels,
        there is also an UniversalGuiIndent plugin - but I don’t have any information
        about it, never used it.

        Regarding tidy2, you know that you can configure the settings to your needs, don’t you?
        Check Show Config Help to get the information what can be done.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Chema RamosC
          Chema Ramos
          last edited by

          Thanks Claudia,

          I knew about tidy2 config but even I can edit that, it still adds several things I don’t wish.
          Anyway thank you because the explanation about you can indent first lines and then npp keeps doing it.

          Also playing with it, I’ve found very useful XML Tools plug-in, with Pretty print (text indent) function leaves the code very nice.

          Thank you very much Claudia!!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors