views:

287

answers:

7

By instant AutoCorrect macros, I mean like a list of common typos I do and what to replace them with. For instance, every time I try to type Layer it comes out "LAyer". I'm not using anything by the name of "LAyer", so I'd like it to just automatically replace every instance of LAyer with Layer after I type it.

(As an example of what I mean, go into Word and type something like "Recomend". It will instantly replace it with "Recommend" without prompting by matching it on a list of common mispellings that can be found under AutoCorrect Options.)

A: 

Write a Visual Studio plug-in? It's easy to load Office's spell-check and use it in a VS plug-in.

dirkgently
A: 

try the free coderush version from developer express. Its macro language should let to recreate this easily. I use the paid version but I would have thought that the free one would still have this functionality

Preet Sangha
A: 

I wonder, then what correction will visual studio suggest for declarations like int

suhair
+1  A: 

Get a better keyboard that has a lighter/less sticky shift key

redwyre
A: 

It still sounds like you have LAyer declared somewhere which is causing it to correct itself to LAyer.

I know you mentioned you searched for it but have you tried searching through the full project solution for 'LAyer' to make sure it isnt declared that way? (If thats what you done then apologies)

Just that Layer to my knowledge is not a visual studio command. It sounds like its been declared and spelt wrong in your application. Maybe via a plug in/object library?

kevchadders
A: 

There is an add-in that uses Office spell checking on the Visual Web Developer Team Blog:

http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx

jrummell
This plugin does not have the autocorrect feature that Stuart is after.
Chris F
True, but its the closest thing that I've seen.
jrummell
A: 

I have exactly the same problem (except I commonly mistype a whole bunch of words). Recently I have been typing "chnage" instead of change a lot. (In the code I am working on right now I have classes called ChangedRecord and ChangedDatum and the number of typos I am making is just not funny anymore)

In another thread someone posted a link to AutoHotkey.

I thought I would give it a go and I must say I think it is a great little application (it can do a whole lot more than what we want it to do.

Below is a AutoHotKey script file that should replace the "hotstring" "LAyer" with "Layer" as soon as you type it. I have defined it so that it will only correct if you match case exactly - so it will leave "layer" and "LaYeR" etc.

Also in the script is the hotstring "chnage". This is defined so that it matches the case of the typed word - i.e. "Chnage" becomes "Change" and "ChnagedRecord" becomes "ChangedRecord" (Note that it will change "CHnaGe" to "Change").

An added benefit (most of the time - see comment below) is that these replacements are made in all applications and not just in Visual Studio.

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
;   Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

:*:chnage::change
:c1*:LAyer::Layer
Chris F
I starting typing this answer with my script running - only when I read it back did I notice that all my "chnages" had been autocorrected to "changes" - this is probably the only time where I actually wanted to type "chnage" :)
Chris F