Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format a document in Notepad++

Tags:

notepad++

I noticed other questions about Notepad++ on this site, so I figured this was the appropriate place to ask. Mods, if this isn't the right place, please relocate.

How do you format your document in Notepad++? I'm looking for something similar to Visual Studio's Edit > Advanced > Format Document

I have a large xml document that is all on one line, I would like it to be formatted with the proper indents/whitespace and only one element per line.

Edit: Using the stock version 5.9.5 with no plug ins.

like image 297
Meyer Denney Avatar asked Apr 09 '12 21:04

Meyer Denney


2 Answers

Download XML Tools plugin from NotePad++->Plugins->XML Tools.. Use Ctrl+Alt+Shift+B to format your XML document..

like image 172
Chandra Shekhar Sengupta Avatar answered Dec 14 '22 03:12

Chandra Shekhar Sengupta


+1 for XML Tools.

You can download the plugin from the Plugin Manager and then use ":

  1. Plugins > Plugin Manager > Show Plugin Manager
  2. Select XML Tools and install
  3. Plugins > XML Tools > Pretty Print (XML only - with line breaks).

This corresponds to the shortcut Ctrl+Alt+Shift+B.

If this does not work with your version of Notepad++ (damn, you have an old old one!), you can download the plugin and install it yourself:

  1. Go to http://sourceforge.net/projects/npp-plugins/files/XML%20Tools/
  2. Put the dll file in /plugins
  3. Restart Notepad++ and that's it
like image 30
Jean-Francois T. Avatar answered Dec 14 '22 03:12

Jean-Francois T.