Lately I've been doing a lot of work with Notepad++ and Subversion, however I was surprised to find that there are no plugins available that integrate the two. At least, no plugins Google could easily find for me. Due to the nature of my project, a lot of commits are required, and I was wasting a lot of time switching between Notepad++ and Windows Explorer in order to commit changes. Being a software engineer, I figured out a good solution: I'll write my own Subversion plugin for Notepad++.
Notepad++ has a good plugin system, however it's very poorly documented. I relied mostly on looking at the source code for plugins that shipped with the application in order to figure out how to do things. Maybe there's a mystical page somewhere full of explanations and examples, but I definitely missed it.
In this first version, I implemented the basic update/commit commands that I needed for my own development. Depending on whether or not anyone else finds this plugin useful, or if I find extra time, I might slowly expand the features.
The plugin simply uses the command line features of TortoiseSVN, so you'll have to install it before the plugin will work.
Update: January 3rd, 2009
I incorporated some code sent to us by Douglas Phillips, which opens the plugin up to more systems than just Windows Vista. It now definitely works under Windows XP. I also added the ability to Commit and Update all opened files, instead of just the currently visible one.
Update: November 29th, 2009
As a lot of people discovered, version 1.0 of this plugin didn't work with the 64 bit version of TortoiseSVN. This was because Notepad++ is only available as a 32 bit application, which caused Windows to redirect its registry requests to a different key. Therefore, it could not determine where Tortoise was installed. The fix was very simple and a new version has been created that addresses the bug. Thanks to everyone that reported the error and especially those who posted fixes in the comments.
Update: February 17th, 2010
The user, ursolouco, requested what is essentially the ability to revert. So I've created a new version (1.2) that adds this functionality. Just like with update and commit, you can revert either your current file or all opened files.
Installation Instructions
Make sure TortoiseSVN is installed and you've installed the latest version of Notepad++.
The plugin comes in the form of a zipped, dll. Simply unzip the dll and place it in the Notepad++ plugins directory. For a typical install, it will be located here: "C:\Program Files\Notepad++\plugins". Next time you launch Notepad++, the plugin will automatically be loaded.
The plugin should work under Windows XP, Vista, and 7. Both 32 bit and 64 bit operating systems are supported. If you find any bugs on these systems or others, drop a comment and I'll see if I can address them.
I've noticed that sometimes Notepad++'s auto-updater thinks the plugin needs to be updated. This usually results in a new version being overwritten by version 1.0. If you update to 1.1 or 1.2, do not use Notepad++'s auto-update feature when it prompts you for this plugin.
If you're interested in the source code for this plugin, you can download a Visual Studio 2010 RC project here.
12/25/2008 - 19:49
Hi~
I used this plugin with notepad++ v5.1.2 on my XP sp2. When I open notepad++,it showed
“The procedure entry point RegGetValueW could not be located in the dynamic link library ADVAPI32.dll”. After confirmed that message,it pops up a box said “Load library is failed.Make “Runtime Library” setting of this project as “Multi-thread(/MT)” may cure this problem ……” .
How could I solve this problem?
My CPU is P4 3.0 with HT support.
Regards,
James
12/27/2008 - 16:40
The function RegGetValueW, which I use to determine where TortoiseSVN is installed, is located in the DLL advapi32.dll, which apparently only ships with Vista or XP Pro x64 edition. I’ll change the code to something that supports more systems. The update should be available in the next couple of days.
12/29/2008 - 19:24
I just got the same message on a similar system. I’m looking forward to this. Good luck with it. I’ll check the rss and back here.
Happy new year!!
12/29/2008 - 20:39
If anyone is interested, I have compiled a modified version with the correct API call which should work against 32-bit and Non-Vista systems. I have no way of testing to be entirely sure (I’m running Vista x64), but it compiles cleanly and finds the registry entry appropriately.
If anyone wants to test it out on an XP or 2000 system, drop me an email at doug at sbscomp dot com and I’ll send it to you.
Hope this is useful to someone!
04/09/2009 - 08:25
I'd be very interested in a 32 bit version. I am using XP, and use NPP for all source code editing. I also use SubVersion, so would be keen to test this out.
Mike
04/09/2009 - 09:31
The current version available for download will work on 32 bit systems.
04/09/2009 - 10:24
I get the same problem as James - is there a download location for the fix for that?
04/09/2009 - 10:29
Actually it may be a different error - I get:
Load Library is failed.
Make "Runtime Library" setting of this project as "Multi-threaded(/MT)" may cure this problem.
This plugin is not compatible with current version of Notepad++
I am running npp v5.3.1
04/09/2009 - 14:30
I was using v5.2, so I upgraded to v5.3.1 and the plugin loaded without problem. I'm on a 32bit XP machine. Unfortunately I don't have any insights. If you get any more errors, please let me know.
08/08/2009 - 04:12
If you want to recompile using the project provided, it's fairly simple. In the NPPSvn.cpp file, there's a function called 'getTortoiseLocation'. That function calls a windows function called 'RegOpenKeyEx'. In that call, replace the parameter 'KEY_READ' with 'KEY_READ | KEY_WOW64_64KEY' for 64-bit operating systems, recompile, and it should run fine.
01/03/2009 - 15:59
I’ve updated the download link to a new version, which incorporates Doug’s source. I’ve also added some new features. I’ve modified the post to describe them. Thanks for the feedback!
01/05/2009 - 00:45
It does work perfectly on my XP now ~~
Thanks very much.
01/07/2009 - 00:02
I have installed the plugin with NPP v5.1.3 Unicode and it works as advertised - Kudos!!!
My question: Is it reasonable to request that you consider doing up an NPP v5.1.x ANSI version of your SVN plugin?
I am requesting this as Jens is buried with other activities. So much so that he is not going to be able to port his Function List v2 plugin over to Unicode any time soon. The v2 Function List Plugin is a big part of what makes NPP so useable for me in my operating environment (custom language for embedded micro-controllers). Regex is so brutal (;-) and I have invested a lot of time in the creation of parsing rules for same. So much so that I am uncomfortable not leveraging my efforts in my daily use of NPP.
So, if you would be so kind to consider porting your plugin over to the latest ANSI NPP versions, it would be greatly appreciated. Thank you, in advance, for your time.
Donations will definately be considered for same.
Regardless of your decision, thank you for your time and effort. It is much appreciated!
-t
01/07/2009 - 00:44
There is the Explorer plugin (NOT the LightExplorer). Among other things it gives you access to the standard Windows Explorer context menu for files and folders. That’s what I use to issue TortoiseSVN commands from Notepad++.
02/25/2009 - 21:21
I just tried installing this into Notepad++ v5.0.3, but all that shows up on my Plug-Ins menu is an "S" for this item. The submenu then only has "Crtl+Alt+Shift+Unlisted" and if I click on that Notepad++ crashes with the following error:
An exception occured. Notepad++ cannot recover and must be shutdown. The exception details are as follows:
Code: 0xC0000005
Type: Access violation
Exception Address: 0x006F0055
The Visual Studio debugger then opens and displays lines like this:
0187DDDF ???
0187DDE0 ???
0187DDE1 ???
0187DDE2 ???
0187DDE3 ???
0187DDE4 ???
.
.
.
Any ideas what is happening?
I'm running Windows XP SP2, Notepad++ v5.0.3, and TortoiseSVN 1.5.0, Build 13316 - 32 Bit , 2008/06/21 07:55:29
Subversion 1.5.0,
apr 1.2.12
apr-utils 1.2.12
berkeley db 4.4.20
neon 0.28.2
OpenSSL 0.9.8g 19 Oct 2007
zlib 1.2.3
Thanks,
Ryan
02/25/2009 - 21:32
Nevermind. Notepad++ update checker wasn't working, so I thought I was using the lastest version, but wasn't. I upgraded and it is working great now! Thanks for this contribution!
One feature request would be to checkout directly from Notepad++. Others may not find this too helpful, but I tend to use Notepad++ to do quick updates to files in different SVN repos (and use Eclipse and Subclipse for the long-running projects), so this would be helpful.
Thanks,
Ryan
02/26/2009 - 04:22
This plugin isn't working for me. In the Plugins menu it just shows up as "S", and in the submenu of that there are only two entries "Ctrl+Alt+Shift+Unlisted" and blank. Selecting either of these entries causes a crash.
I am using Windows Vista 64 and Notepad++ 5.0.3.
Any ideas?
02/26/2009 - 04:25
NVM, dupe of Ryan's problem.
03/25/2009 - 22:26
I sure hope to find it useful - I have no idea what I'm doing with svn yet, but I used Notepad++ for all the coding I do in any language.
Thanks - I'm going to give it a shot.
-[[Neo]]
05/16/2009 - 12:01
Added "add" and "diff" functionalities.
I also made the code more general and easy to change.
DLL can be downloaded here: http://www.shererim.com/downloads/NPPSvn.zip
Sources here:
http://www.shererim.com/downloads/NPPSvn-source.zip
06/01/2009 - 09:29
Hey,
Recently I've started experiencing problems with what is otherwise a fantastic plugin, I wonder if anyone else has come across these issues and knows a fix?
When I use the keyboard shortcut for update file I get a black blob insert where the cursor is currently positioned with the letters EOT in it. Similarly, when I use the keyboard shortcut to commit a file i get another black blob, this time with the letters SOH.
However, if I use the menu to perform these actions, the plugin behaves as expected.
I've tried uninstalling and reinstalling to no avail.
Any help would be appreciated.
Cheers, Dan.
06/01/2009 - 10:43
It sounds like NP++ is interpreting the keystrokes as something it's supposed to put in the document. I tried to use a combination that wasn't used by something else and wouldn't put a character in the document. Maybe the newest version of NP++ is using this character. I'll do some testing to figure it out. What version of NP++ are you using?
06/01/2009 - 11:10
Thanks, I'm currently using NP v5.4 and like I mentioned I did a complete fresh install to ensure it wasn't a problem that I had created for myself. The only difference that I have made to the installation is that I told it not to use %APDATA during the installation.
Hope that helps, and thanks for your reply.
06/02/2009 - 13:18
I think I found the problem. I believe you're using the keystroke control-shift instead of control-Alt. If you use control-shift, you get the EOT and SOH characters. If you use control-Alt, everything seems to work fine.
06/12/2009 - 01:27
Hi,
Can we do a comparison between the SVN version of the file and the local(edited) version of the file, via this plugin?
And also how about check-out and check-in?
Thank you very much!
06/22/2009 - 10:32
win7 7232 x64
TortoiseSVN-1.6.3.16613-x64-svn-1.6.3.msi
Could not locate tortoiseSVN
i need help
07/21/2009 - 09:14
I had the same problem on Vista. Just add a new string value under HKEY_LOCAL_MACHINE\Software\TortoiseSVN\ with the key name of ProcPath and the value of C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe (or wherever that executable lives).
09/04/2009 - 13:33
I am sorry, can you explain in more detail?
06/25/2009 - 11:48
having same problem with winxp x64
TortoiseSVN-1.6.3.16613-x64-svn-1.6.3.msi installed
06/25/2009 - 14:55
The plugin uses a registry key to determine where Tortoise is installed. I've installed 1.6.3 and the key exists, so the function call requesting the registry value might not work under a 64 bit OS. Unfortunately, I don't have access to a 64 bit OS to test. I'll hunt one down and try to find the problem.
06/26/2009 - 18:35
gracias, muchas gracias amigo.
07/11/2009 - 14:47
Thank you so much for this plugin.
Just what I was looking for!
Valentina
08/08/2009 - 09:21
Gracias por el plugin desde Chiapas, Mexico (y)
09/30/2009 - 11:55
My Tortoise window will not auto-close after a successful Commit using this plugin. However, a Commit from shell extension auto-closes. How can I fix this? Thanks!
10/07/2009 - 21:57
p.s. I am running XP
09/30/2009 - 19:02
hey i just installed the notepad++ on my vista 64 bit and when i tried to update it it shows the error of required elevation, any solution to that cuz i can't update my notepad anymore,is it a bug?? plz help me out here!
10/04/2009 - 04:11
There is an bug in this plugin when runing it on Windows 7 64bit. The plugin is searching for TortoiseSVN in the fallowing key:
11:02:27,7018262 notepad++.exe 2480 RegOpenKey HKLM\Software\Wow6432Node\TortoiseSVN NAME NOT FOUND Desired Access: Read
10/11/2009 - 07:24
samo problem with windows seven
10/16/2009 - 23:44
I installed your plugin and am currently waiting for an update to allow it to work with 64-Bit TortoiseSVN.
10/28/2009 - 15:17
Same problem, need 64-bit support
11/03/2009 - 08:46
when trying to update file or check in, I get a screen long message full of Chinese characters. help is much appreciate.
11/13/2009 - 18:22
I am using FTP_Symchronise plugin to access my Subversion workspace, which is on different workspace.
Is there a way I can use this plugin to do commit/updates for the ftped file.
When I try to do that it looks at a different file path, is there a way I can set the path?
11/22/2009 - 06:36
notepad++ current is only availabe for 32bits version, if use 64bits TortoiseSVN, it need add registry to make it running:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TortoiseSVN]
"ProcPath"="C:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe"
11/29/2009 - 23:37
All right everyone. I've finally got my hands on a 64 bit OS and fixed the bug. The post has been updated with links to the new version. The source has also been updated, however it's now a Visual Studio 2010 Beta 2 solution.
01/08/2010 - 03:34
Thank you for this, google("notepad++ subversion") brought your post up right away, just what I was hoping for.
02/10/2010 - 11:05
Please do not notice my English.
Congratulations for the plugin. He's great.
I am a Brazilian developer and would like to register a suggestion.
A very used in the SVN is the option to reverse (back) the content
a particular file and it would be very interesting to have this option in
plugin.
What do you think about it?
Best wishes,
02/10/2010 - 13:37
I think it would be pretty simple to add the SVN revert functionality. Thanks for the suggestion!
02/12/2010 - 13:01
Does this plugin only support the latest version of TortoiseSVN? I believe I'm using 1.4 as that's the only version currently available at my company (we've asked for them to push out the latest version to us). I'm not a developer however we use TortoiseSVN for our version control and this plugin would certainly come in handy (particularly if a few features are added in the future).
The error I'm getting when I attempt to Commit a File is:
'◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘' is not a working copy
Can't open file
'◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘\.svn\entries': The system cannot find the path specified.
Any help would be appreciated. I'm using the latest version of Notepad++, and I received the error with both 1.0 and 1.1 versions of the plugin. (First installed using the built-in plugin manager, then downloaded it from here and updated it).
02/12/2010 - 13:37
This plugin uses Tortoise commands that have been there for a very long time. I cannot say for sure if 1.4 is supported, but I don't know why it wouldn't be. It looks to me like whatever file you're attempting to commit is not actually within an SVN repository. If you attempt to use Tortoise directly to commit the file, do you receive the same error?
02/16/2010 - 17:23
I will have to revisit this to see if it is still a problem. Perhaps the issue was exclusive to the demo we were performing at the time.
02/17/2010 - 18:57
Hey everyone. I've created a new version, 1.2, that provides the ability revert files.
Add Comment
[language] [/language]
Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]
See here for supported languages.
Javascript must be enabled to submit anonymous comments - or you can login.