11

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.

Meyer Denney
  • 756
  • 1
  • 9
  • 33
  • 3
    Same as [this](http://stackoverflow.com/questions/3961217/how-to-format-xml-in-notepad) ? – nevets1219 Apr 09 '12 at 21:55
  • You could use sed or vi to do this pretty quickly, but not automatically. – jahroy Apr 09 '12 at 21:56
  • I was looking for a way to do it with the stock setup, not using plug ins. My version of Notepad++ does not have the xml plugin or the pretty print plugin. – Meyer Denney Apr 09 '12 at 21:56
  • Then you should include the exact version you are using – nevets1219 Apr 09 '12 at 21:58
  • Downloaded the minimalist version and I couldn't find that functionality but I don't use Notepad++. The mentioned plugins seems to be available for your version, any reason you can't use those? – nevets1219 Apr 09 '12 at 22:06
  • I was just wondering if there was a way to do it without plug ins. Why take an extra step if you don't need to. But, if there isn't a way to do it without plugins, then I guess I will just go ahead and download them. – Meyer Denney Apr 09 '12 at 22:14

2 Answers2

8

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

Jean-Francois T.
  • 9,065
  • 3
  • 46
  • 79
5

+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
Jean-Francois T.
  • 9,065
  • 3
  • 46
  • 79