14

Sometimes I browse a repository and want to look at some files there, without checking them out (let's say I'm looking for a particular file). I've got three choices

  • double clicking the file opens the default editor. For .cs files that would be the big and slow Visual Studio. And, naturally, it has to open a fresh copy.
  • Right-clicking also offers the option to "Open With..." and then I can select what program I want
  • Right clicking also offers the option to "Edit" which then opens Notepad.

I'd like to use Notepad++ as the default editor. Or it can be the "Edit" entry on the context menu that opens it, but not the full and lengthy "Open with..." dialog. Can I do that? I haven't yet found such a setting, but maybe there's some hidden option or something.

2 Answers 2

20

Like Mand Beckett said, and this is the full registry path:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command

Change (Default) value in this key. Remember to leave %1 there.

The problem with solution above is that it will only handle files that are perceived as text (have value PerceivedType=text in registry). Most text files are already perceived as such in the registry, but you can't open, for instance, a .lib file in this manner. To be able to open really all files from repository browser with Notepad++ edit (Default) value in the following key (add the key if not there):

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\edit\command

NOTE: In registry editor new key will have (Default) value of type REG_SZ, not REG_EXPAND_SZ. If you want REG_EXPAND_SZ you must create a key with .reg file.

Another option is to set all relevant file types to open from Notepad++ by default instead from Visual Studio. Start Notepad++ as administrator and in Settings > Preferences > File Association just add those file associations that you use.

2
  • Oh, so TortoiseSVN simply calls the default "Edit" command on the file? How... disappointing. :P Well, thanks for the detailed explanation! :)
    – Vilx-
    Commented Apr 20, 2012 at 15:37
  • Solution worked for me with many different file types - except .csv, which seems very weird to me.
    – Moni
    Commented Aug 3, 2017 at 11:24
1

You need to change the Windows registry options to do that. You can change the default open program from within the Tortoise settings, but it is the edit function you want. Look for

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations

in regedit.

Not the answer you're looking for? Browse other questions tagged or ask your own question.