Can I assign a system-wide external editor in Windows?
March 4, 2010 9:57 AM   Subscribe

I've been force-migrated from Mac to Windows. Is there anything like QuickCursor for Windows XP, so I can assign a preferred external editor for browsers, text areas, etc.?

My company's new corporate parents have migrated me to a Windows laptop and will not allow me to keep using my personal computer (a Mac) for a lot of day-to-day stuff. I have a little flexibility in terms of software I can put on the computer: We have two weeks to load up our preferred apps, then some sort of management iron curtain is going to come down and we'll be audited for stuff IT doesn't want us to have (e.g. instant messaging clients).

I've solved some of the problem by installing Synergy, which lets me keep using my Mac for a lot of routine tasks, switching over to the Windows laptop but using the same keyboard/mouse as my Mac and sharing a clipboard between the two computers.

On my Mac, I was using a program called QuickCursor, which makes it possible to invoke a preferred text editor (TextMate, for instance) with a hotkey in a lot of applications. I didn't use it that much because the Mac has plenty of support for basic Emacs navigation keys, but with Windows I don't really have that luxury.

I'm currently getting by with xkeymacs under Windows, which works o.k. but I'd really like to be able to drop out of a given text field and into a full-featured editor (like Komodo, Emacs or E) when composing longer e-mail messages (mandatory Outlook) or similar tasks.

The "It's All Text" add-on for Firefox is similar to what I'm after, I would just like it system-wide.

I've found a lot of stuff about switching from Windows to Mac, but very little about the reverse, so I'll take just about any related tip.
posted by mph to Computers & Internet (2 answers total)
 
Best answer: Unfortunately it is not possible to assign a system-wide external editor in Windows; there's no setting for this, so I don't believe a simple solution like QuickCursor is possible on your new system.

However – since what you appear to want is the ability to invoke the editor of your choice with a hotkey and to (er, I guess) use Emacs navigation keys, and especially because you finished off your question by saying you'd take any related tip, I'm going to recommend that you try AutoHotkey. Autohotkey is a simple scripting language for all Windows variants; it even includes the ability to compile scripts into executables, so it's as powerful as a scripting language really needs to be while being simple and high-level enough to basic everyday stuff with it.

You mention Komodo, which makes me think you must be familiar with coding at least a little bit; if so, you'll find AutoHotkey ridiculously simple. It is a simple procedural language, using a keyboard hook at the beginning of each subscript and then listing statements in the form command, parameter. So an AutoHotkey script which opens Emacs whenever you press the combination control-shift-e looks like this:

^+e::
Run, C:\Program Files\emacs-22.3\bin\runemacs.exe
return


... or, if you wanted to get a little fancier, you could write an AutoHotkey script which copies the text you're editing, opens Emacs, and pastes it there for editing when you press control-shift-e:

^+e::
Send, ^a
Send, ^c
Run, C:\Program Files\emacs-22.3\bin\runemacs.exe
Sleep, 3000
Send, ^v
return


A sort of expert-level version of that script, which would also preserve the current clipboard and probably run a little more smoothly, would probably look like this:

^+e::
Clip = %Clipboard%
Clipboard =
Send, ^a
KeyWait, a
Send, ^c
ClipWait
Run, C:\Program Files\emacs-22.3\bin\runemacs.exe
Sleep, 3000
Send, ^v
Sleep, 500
Clipboard = %Clip%
return


These are pretty direct, input-level scripts. AutoHotkey also allows more filesystem-level stuff - looping through files and folders, variable and text manipulation, etc. Of course it's really basic, but it's a neat way to directly manipulate what happens in Windows without having to learn COM objects and all that. And honestly the best thing about it is that it's superbly documented – the linked command reference there is probably the most complete and helpful I've seen for any scripting language, and it makes using AutoHotkey very easy. And AutoHotkey can easily map over other key bindings, so if you want to institute certain global combinations (like the emacs navigation keys) AutoHotkey can do that simply.

Though it sounds like you're not necessarily looking for a text editor, I might also recommend Notepad++, simply because I think it's one of the nicest Windows-specific programs, and because it's my own editor of choice. Seriously - I run a Linux system, but my favorite text editor is Notepad++ running through WINE! It's that good. And though it's firmly in the Windows aesthetic - the web site is ugly as sin - the program works fantastically, with an incredible number of features and many plugins available.

Hope some of this helps.
posted by koeselitz at 5:24 PM on March 4, 2010


Response by poster: Thanks, koeselitz. AutoHotKey looks like it could solve a lot of annoyances, and it doesn't look any more painful than UI scripting in AppleScript.
posted by mph at 8:52 AM on March 7, 2010


« Older Excel Checkbox Dilemna   |   How to label electrical in basement? Newer »
This thread is closed to new comments.