Community
    • Login

    HTML Auto-indent

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 6.4k Views 2 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors