Y'know how sometimes you go to hit the Home key and you accidentally catch the Insert key too, but you don't realize it until you've typed over something, because suddenly you are in "overstrike" mode rather than "insert" mode? I wanted to kill the Insert key, and immediately thought of my favorite utility, AutoHotKey (upon which I built that Wikipedia AutoCorrect thing). But instead of just killing the Insert key, I thought perhaps I could make it do something useful. So I took the "append" script from here and just changed it to fire whenever I hit Insert, like so:
bak = %clipboard%
clipboard = %bak%`r`n%clipboard%
This has two effects:
- Hitting Insert no longer puts me in "overstrike" mode.
- If I have text selected, it is appended to the clipboard (unlike CTRL+C, which replaces whatever is on the clipboard with your new selection).
UPDATE: I added another script, this one for CTRL-Insert. As a web programmer, I'm sometimes faced with a specific repetitive task of going through text and putting stuff around little chunks of text. In this case, I had a bunch of questions on a page that needed to be emphasized, so I needed to wrap them in STRONG tags. Each question was different, so I couldn't do a find/replace with regular expressions. What I wanted was to select the question, hit CTRL-Insert, and have it automatically put the tags around whatever I had selected. My solution is kinda convoluted, and nobody will care about it but me, but here goes anyway. First, the script:
bak = %clipboard%
StringReplace, clipboard, bak, @@, %clipboard%
clipboard = %bak%
Then, once you have it installed, the steps:
- First, type out your "template". You just need to put @@ wherever you want the selected text to be inserted. For my example, the template looks like this:
<STRONG> @@ <STRONG>
- Next, select your template text and copy it to the clipboard.
- You're all set. Select a question (or whatever you want between STRONG tags) and hit CTRL-Insert. Continue selecting and CTRL-Inserting as needed. So in my example, if you select "my dog has fleas" and CTRL-Insert it, it is instantly replaced with
<STRONG> my dog has fleas <STRONG>
Your IDE might do something like this already, but I like that AHK makes this functionality available in any application. And I can bring it along on my USB key, making me more at home on foreign machines.