How to indent HTML tags in Notepad ++

I installed Notepad ++. How to indent tags automatically, especially when nested? All tags seem to line up to the left of the screen.

+71
notepad ++
Jan 28 '15 at 18:05
source share
8 answers

Use the XML Tools plugin for Notepad ++, and then you can Auto-Indent the code with Ctrl + Alt + Shift + B. For greater point and click inclination, you can also go to plugins -> XML Tools -> Pretty Print.

+72
Jan 28 '15 at 18:10
source share
β€” -

The answers to this question are not only erroneous, but also dangerous. CTRL + ALT + SHIFT + B will not indent HTML, but XML. Consider the following HTML code:

<span class="myClass"></span> 

The function 'Notepad ++ β†’ Plugins β†’ XmlTools β†’ Pretty Print (Xml only with line breaks)' (CTRL + ALT + SHIFT + B) converts this value to:

 <span class="myClass"/> 

which will no longer be displayed by your browser! I highly recommend using this function to indent HTML.

Use the Tidy2 plugin instead . This will cause the HTML to be formatted correctly without bad side effects (but it will also create <html>, <head>, <body>, ... elements around your code if they are not there).

+41
Jun 03 '16 at 2:33
source share

Step 1: Open the plugin manager in notepad ++

Plugins β†’ Connection Manager β†’ Show Connection Manager.

Step 2: Install the XML Tool Plugin

Find "XML TOOLS" from the "Available" option, then click "Install."

Now you can use the key combination CTRL + ALT + SHIFT + B to indent the code.

+21
Sep 24 '15 at 8:00
source share

I have a solution for you.

You just need to install the plugin named Indent By Fold .

You can install this by going through Plugins β†’ Plugin Manager β†’ Show Plugin Manager . OR Plugins β†’ Plugins Admin β†’ chekmark Indent By Fold from list than install

Then just select the list item and all you need to do is type the first word, after which you get it.

You can use this plugin from the plugin in the menu bar.


+8
May 4 '17 at 18:50
source share

Based on Konstantin’s answer , here is the essence of what I learned when I switched to Notepad ++ as the main HTML editor.

Install Notepad ++ 32-bit

There is no 64-bit version of Tidy2 and some other popular plugins. The 32-bit version of NPP has several practical drawbacks, so let's focus on the 64-bit version.

Install Plugin Manager

The plugin manager is not strictly necessary for using plugins. It makes things a lot easier though.

The plugin manager has been removed from the main package, apparently because the developer did not like some attribution links.

You may notice that the Plugin Manager plugin has been removed from the official distribution. The reason is because the Plugin Manager contains ads in its dialog. I hate advertising in applications and guarantee that it was not there, and in Notepad ++ there will never be advertising.

This is a manual installation, but it is not difficult.

  1. Download the UNI package (32-bit) and unzip it. Inside you will see folders called plugins and updates. Each contains one file.
  2. Drag these two files into the corresponding folders with the same name in the Notepad ++ installation directory. This is usually C:\Program Files (x86)\Notepad++ .
  3. Restart Notepad ++ and follow all installation / upgrade instructions.

Now you will see a new entry in the "Plugins for Plugin Manager" section.

Install Tidy2 (or your preferred alternative)

In the plugin manager, check the box for Tidy2. Click Install. Reboot when prompted.

To use Tidy2, select one of the pre-configured profiles in the "Plugins" submenu or create your own.

+1
Dec 28 '17 at 21:41
source share

On Notepadd ++ v7.5.9 (32-bit), the Bend Indent plugin works fine with HTML content.

  1. Search and installation in the plugin manager
  2. Use Plugins> Bend Indent> Reindent File

https://www.fesevur.com/indentbyfold/

0
Mar 19 '19 at 15:54
source share
  1. open your favorite idea
  2. drag your html file to the copied piece
  3. format!

Use this development tool!

-four
Mar 25 '19 at 16:48
source share

Notepad ++ v6.6.3 with the XML Tools plugin and the CTRL + ALT + SHIFT + B shortcut works fine. refer to this article.

-7
Jan 28 '15 at 18:10
source share



All Articles