Changing the View Source Editor for IE

Everytime you want to view the source code for a HTML page you get it in Notepad. And Notepad isn’t exactly the “nicest” text editor to be viewing HTML source code in.

Do you want coloured syntax highlighting?

What is your favourite text editor?

Mine is TextPad.

So, let’s go about changing our “View Source Editor” for Internet Explorer, it’s not hard to do, just have to do a few things inside the registry.

Please, only do the following if you know what you are doing, and it’s a good idea to do a backup of the registry before proceeding.

By doing any of the following “tweaks” you take full responsibility of your own action.

1) Ok, let’s start off with going into your Registry editor.
Click on the start button, and select Run.

In the Run dialog type in “regedit” without the quotes of course. :)

2) You will now be presented with your Registry editor, and you’ll see 5 folders.
They should be, HKEY_CLASSES_ROOT [HKCR], HKEY_CURRENT_USER [HKCU], HKEY_LOCAL_MACHINE [HKLM], HKEY_USERS [HKU], HKEY_CURRENT_CONFIG [HKCC].

I won’t go along and explain them all, but the one we are concerned with for this “tweak” is the HKLM.

i) Ok, now we are going to open up HKLM and browse to the SOFTWARE folder and open that up.
ii) You will now see under the SOFTWARE folder many diffrent company names (these are names of companies who develop software that is installed on your system).
iii) Navigate your way to the folder called Microsoft, and proceed to open up the folder under Microsoft called “Internet Explorer” (without quotes of course!)
iv) Right-clicking on the Internet Explorer folder, you will see a context menu.
v) Select New and then Select Key.
vi) There will now be a visual indicator for you to add a new Name for the Key (folder). Type in View Source Editor
vii) Now, let’s create another Key underneath the one that we just created. This can be done by repeating the process we just went through. Right-Click on View Source Editor, and New -> Key.
viii) Call this new Key Editor Name.
ix) Okay, click on Editor Name and you will see in the right hand pane something that says: (Default) REG_SZ
x) Now double click on the (Default) and a dialog box will prompt you for a Value data:
xi) For the Value data, type in the location for your favourite text editor. For me, that would be c:textpadtextpad.exe

3) You are now done, close all your internet explorer browser windows, and open up a new internet explorer browser window. Go load up any website (best to use your own one) and then do a View Source.

Note: I have only done this on my Windows 2000 and Windows XP computers, so be careful what you do if you are running something diffrent and the instructions don’t match what you have in your own registry.

Hope this post ends up someone out there! I’ve had my IE setup this way for quite sometime, and find it most useful because Notepad is a bit hard to read (once you’ve gotten used to some of the other text-editors out there). But it is a matter of personal choice though, which one you end up using :)

20 Responses to “Changing the View Source Editor for IE”

  1. Will's Blog - Adventures of an IT Grad » Managing IE Add-Ons in SP2 vai Registry Tweaks Says:

    [...] ; Altering the registry to manage add-ons in IE under SP2 As I mentioned the last time I posted a tip that may damage the system registry [...]

  2. charlene Says:

    Yes..i used TextPad from the start am writing program and as well as compiling code..you see..it’s much more easier compared with notepad..

  3. Geoff Appleby Says:

    TextPad? Bleh :P *grin* For the last 5 years, nothing has steered me straighter than UltraEdit.

    Hey, just a thought, it’s good to do a post like this one talking about how to do a registry mod (and describing it in easy steps), and you have a the usual disclaimer of ‘don’t do it if you don’t know what you’re doing’ etc etc…you should write an entry on _how_ to back up your registry, for those people who got scared off by the disclaimer :)

  4. William Luu Says:

    Geoff, yeah, I could do that as a follow-up blog post. And perhaps a few other neat registry “hacks” that I’ve been using on my PC to make life easier :)

  5. Bill Dunn Says:

    Thanks for the tweak. One thing I’ve noticed is that the temp htm file does not have an extension so my editor (EditPlus) loads without text coloring. Is this something I need to change in EditPlus, or is there a way around this? Thanks.

  6. Hans Raj Kasana Says:

    Hi, thanks for yr code/help for changing the default editor to view source.

    with me everything gone fine Buuuuuuuuut.
    ….. now when i tries to open/view source, it gives error related to the path/location for that temp file as in WIN2k path is ‘c:\documents and…..’
    and there is space after documents which creates problem while mapping to open (….. what i thinks !!!)

    any help

    Hans raj Kasana

  7. danla Says:

    Thanks for the tweak too – never actually added a reg key before :D , but I also got the same problem as Bill Dunn mentions, but a few clicks will sort of hack through it; right click in the opened source document, access ‘properties’, choose ‘syntax’, check the ‘enable syntax highlighting’ box and then choose ‘html.syn’ from the drop-down list. It’s a bit less elegant than what I’m after, but it saves cut ‘n’ paste circus.

  8. chowderhead Says:

    Point 1:
    Hans Raj Kasana: you are right… put quotes around your string that may have spaces in them (“C:\Documents and Settings\Administrator”);

    Point2:
    Just wanted to let everyone know it also works if you use Win2003 Server

  9. Tovarish Says:

    EditPlus is a very clean, lite, and nice overall editor.
    And it has an internal option in preferences:
    Use with IE – does the same thing – no manual registry editing needed !

  10. Morten Hattesen Says:

    Notepad++ http://notepad-plus.sourceforge.net does a fairly good job, as a high-end text-editor with syntax highlighting, auto-indentation etc. And it allows you to configure it as “view source” editor during installation.

    Best thing, though … it’s freeware!

  11. Steve Canino Says:

    Thanks for this useful tip. I couldn’t believe there was no Windows entry into this setting other than the registry. Of course, I believe it now. Internet Options, Programs would be the obvious place to put it, but that would be too easy.

    Tnanks again.

  12. Amit Says:

    Thanks a lot !!!

  13. Nico Westerdale Says:

    Will,

    We have a simple little tool that automates the process of changing the editor into a free tool available here:
    [url]www.iconico.com/viewSourceEditor/[/url]

  14. Nikolay Simeonov Says:

    Didn’t work for me. I’m using Windows 64 and this doesn’t seem to do the trick. Oh well.

  15. James Says:

    thanks, an easy way for xp (not sure other platforms)

    1. write a file with content :

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name]
    @=”\”C:\\Program Files\\UltraEdit\\uedit32.exe\”"

    2. save it as filename.reg
    3. right click on the file
    4. choose ‘merge’

    done

    (change the path if you use a different one)

  16. will Says:

    Good tip James (regarding the .reg file).

  17. RammsteinTR Says:

    I use EditPlus v2.10c for text editor. So editplus show source of file without syntax color. To solve this problem, i found a solution with some clicks. After you have add the reg key, when you click the “View Source” option in the the context menu on the ie, editplus will be opened with the temp file which has no any extension. Then click “Document” from toolbar and select “Change File Type…” and select “HTML” from list then click “OK” button. Now it is colored like a rainbow :)

    ps: i used will’s tweak with ie, version 7.0.5730.11 and it works fine.