NotePad++ as the editor for subversion CLI

I use the brilliant NotePad++ editor. It is free and very light weight. So, I wanted to configure svn to call NotePad++.

There are several ways to specify an editor for svn. You can use environmental variables, the registry, specify it on the command line or within the subversion config file.

Specifying it in the config file made the most sense to me. I am using Windows 7 so the config file can be found at:

\Users\YourUserName\AppData\Roaming\Subversion

If you are running with the default windows explorer settings the AppData folder is hidden. Just navigate to your users folder and click on the navigation bar at the top of explorer. It will change to be an editable text box. Just add \AppData to the path that is there and press enter. You will then be able to navigate to Roaming then Subversion.

The way subversion uses the external editor is to create a temp file and pass that to the editor. Since notepad++ is a tabbed browser if you don't specify the "multiInst" (multi instance) switch svn will not see a new process open and think that you are done and remove the file. Notepad++ will then tell you that the file no longer exists and ask you if you want to retain it.

Edit the config file, uncomment the editor-cmd line and specify notepad++ as follows:

editor-cmd = "/Program Files (x86)/Notepad++/notepad++.exe" -nosession -multiInst

Note I am running 64-Bit windows 7. If you are on 32-bit your exe will be in /Program Files without the (x86) part.

The "multiInst" parameter forces notepad++ to open as a new process. So now svn will properly wait for you to exit that window.

The "nosession" parameter tells it not to load up the last session. Even though I have it configured to not use sessions current, I may change my mind and start using them. I wouldn't want a bunch of tabs to open just to edit my svn message or property.

I hope that this saves someone a bit of time.