How do I uncomment lines in an XML file using Notepad++

The Notepad++ comment/uncomment functionality is not really intuitive. Here's a list of the comment shortcuts and related operations that Notepad++ provides:

  • Ctrl-Q
    Toggle line comment on current line / selection

  • Ctrl-Shift-Q
    Create block comment on current line / selection (no toggle!)

  • Ctrl-K
    Create line comment on current line / selection

  • Ctrl-Shift-K
    Remove line comment from current line / selection

Now, since XML only has block comments and no line comments, the only way to create a comment is to use Ctrl-Shift-Q and there is no way to remove a comment as Notepad++ does not provide a Remove block comment feature.

Igor


If you have the XML Tools plug-in, you can use the following shortcuts for block commenting/uncommenting:

  • Ctrl+Alt+Shift+C — comment selection

  • Ctrl+Alt+Shift+R — uncomment selection.

As for the Ctrl+Shift+K shortcut not working, you should probably report the problem to the Notepad++ developer.

Edit: Looks like the standard Block comment (Ctrl+K), Block uncomment (Ctrl+Shift+K) and Toggle block comment (Ctrl+Q) commands don't work with XML at all. (I'm using v. 5.5 by the way.)