The limitations of notepad in Windows are really quite annoying.  When I was at Microsoft working on Windows Vista, Jeff Miller spent some time adding some very nice improvements to notepad but had to remove them for some reason (I’m confident it was a good reason; I just don’t know what it was).

The main feature I was looking for was Ctrl-Backspace to delete the previous word.  I suspect this is actually a limitation of the Windows control used by notepad, but it would have been very simple to fix in the app.  Another feature I wanted was for the cursor to remember its current horizontal location when moving the cursor up or down in the file.

I first tried an application called Win32Pad by Gennady Feldman.  This is a very nice application with a bunch of features.  There are two features I found myself missing from Visual Studio, however - being able to see tabs and spaces, and syntax coloring.

Notepad++ by Don Ho takes notepad to the next level and beyond.  It does all the things I’ve already mentioned and more, plus a bunch I haven’t discovered yet.  It displays files in tabbed windows, remembers your session, offers auto-completion, supports multiple languages, and more.  It seems pretty fast as well, which is pretty impressive for such a feature-laden application.

Exposing in the Windows Shell

I wanted to be able to invoke the editor against files of any type, so I added it to the context menu for all files.  Here’s how to do that.  Because the application is installed in Program Files, I wanted to use the %ProgramFiles% environment variable rather than hard-coding the location.  That means that I had to define the default registry value of type REG_EXPAND_SZ.  For some reason this can’t be done from within RegEdit.


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Notepad++]
  @="Notepad++"

[HKEY_CLASSES_ROOT\*\shell\Notepad++\command]
  @=hex(2):25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,\
  00,73,00,25,00,5c,00,4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,\
  5c,00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,\
  00,65,00,20,00,22,00,25,00,31,00,22,00,00,00

If you’re running a 64-bit version of Windows, you’ll want to refer to the %ProgramFiles(x86)% environment variable instead.


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Notepad++]
  @="Notepad++"

[HKEY_CLASSES_ROOT\*\shell\Notepad++\command]
  @=hex(2):25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,\
  00,73,00,28,00,78,00,38,00,36,00,29,00,25,00,5c,00,4e,00,6f,00,74,00,65,00,\
  70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,\
  00,2b,00,2b,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,00,22,00,00,00

Save the appropriate version to a file with a .reg extension and execute it at the command line or double-click it from with the Windows Shell.  The result of running the script is that when you right-click on a file, you’ll see Notepad++ underneath Open on the context menu.