• Login
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.
  • C
    Chema Ramos
    last edited by Mar 10, 2016, 7:19 PM

    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

    C 1 Reply Last reply Mar 10, 2016, 8:23 PM Reply Quote 0
    • C
      Claudia Frank @Chema Ramos
      last edited by Claudia Frank Mar 10, 2016, 8:23 PM Mar 10, 2016, 8:23 PM

      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
      • C
        Chema Ramos
        last edited by Mar 11, 2016, 2:42 PM

        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
        3 out of 3
        • First post
          3/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors