How to auto

Is there a way khổng lồ re-indent a block of code? I"m looking for something similar khổng lồ Ctrl+Shift+F in Eclipse (Auto-Format/Indent).

Bạn đang xem: How to auto

To be clear,

I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don"t need a bunch of links to other XML-formatting tools. I"m specifically working with XML and HTML.Ideally, there"s a keybinding as convenient as the one in Eclipse, so I don"t have lớn break my workflow.

I already know about NppAutoIndent - it won"t work, as I"m working with XML, HTML và CSS.



Since I upgraded lớn 6.3.2, I use XML Tools.

install XML Tools via the Plugin Admin (Plugins → Plugins Admin... Then tìm kiếm for "XML Tools", check its box and click the "Install" button).use the shortcut Ctrl+Alt+Shift+B (ormenu → Plugins → XML Tools → Pretty Print)



In older versions:menu → TextFX → HTML Tidy → Tidy: Reindent XML.




For those who don"t know, npp has a lot of tư vấn from plugins and other projects. You can download those plugins from SourceForge.


You need XML Tools to lớn format your text in n++

After you have downloaded XML Tools ..

Exit Notepad++

Go khổng lồ C:Program FileNotepad++ .... Your N++ installed folder.

Place below files from xml tools which you downloaded in the npp root thư mục by copy replace


Go to lớn ..Plugins subfolder & place below downloaded file


Restart and enjoy!!!

Ctrl + alt + Shft + B to lớn format.

It"s been the third time that I install Windows & npp & after some time I realize the tidy function no longer work. So I google for a solution, come to lớn this thread, then with the help of few more so threads I finally fix it. I"ll put a summary of all my actions once & for all.

Xem thêm: Cách Xuất Bản Vẽ Cad Sang Pdf Hiệu Quả Và Đơn Giản, Xuất File Cad Sang Pdf Cực Dễ Ai Cũng Làm Được

Install TextFX plugin: Plugins -> Plugin Manager -> Show Plugin Manager. Select TextFX Characters và install. After a restart of npp, the menu "TextFX" should be visible. (credits:

After having a Config folder in your latest npp installation destination (typically C:Program Files (x86)Notepad++plugins), npp needs write access to lớn that folder. Right click Config folder -> Properties -> Security tab -> select Users, click Edit -> check Full control khổng lồ allow read/write access. Cảnh báo that you need administrator privileges to vì that.

Restart npp & verify TextFX -> TextFX HTML Tidy -> Tidy: Reindent XML works.

Not exactly a solution but a workaround.

Notepad ++ doesn"t provide any such feature by default. But you can use some online tools lớn autoformat text like

I had lớn update the proxy settings under Plugins -> Plugin Manager -> Show Plugin Manager -> Settings to lớn see any PlugIns in the "Available" list.

After that, installing "XML Tools" was easy and did the requested job as described above.

To directly answer the OP, take a look at this guy"s site: Thomas Hunter Notepad++ Tidy for XML. Simple steps khổng lồ follow & you get very nice formatting of your XML right inside NPP. So far the only anomaly I"ve found is with nested self closing elements EG:

Text for outer elementWill be tidied up to:

Text for outer elementThere may be a way to lớn fix this, but for the time being, it"s managed to reduce the number of lines in my document by 300k & this particular anomaly can be worked around.

Just install the latest notepad++ và install indent By fold. On the menu bar select Plugins -> Plugins Admin và selct indent By fold and the install. Works finest

I"m using Notepad 7.6 with "Plugin Admin" & I could not find XML Tools.I had to lớn install it manually lượt thích
some-java-guy did in his answer except that my plugins thư mục was located here: C:Users\AppDataLocalNotepad++pluginsIn that directory I created a new directory (named XmlTools) & copied XMLTools.dll there. (And I copied all dependencies khổng lồ the Notepad++ directory in Program files.)

Highly active question. Earn 10 reputation (not counting the association bonus) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.

Not the answer you're looking for? Browse other questions tagged html xml notepad++ auto-indent autoformatting or ask your own question.

site design / biểu tượng logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. Rev2021.12.22.41046

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.