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.)

Stuart P. Bentley
  • 10,195
  • 10
  • 55
  • 84

4 Answers4

3

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 <myemail@nowhere.com>
;
; 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
Community
  • 1
  • 1
Chris Fewtrell
  • 7,555
  • 8
  • 45
  • 63
  • 1
    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 Fewtrell Aug 26 '10 at 08:05
  • This doesn't work so well with VS2017, which doesn't work with SendInput mode, and therefore doesn't actuate the change fast enough (if you are a speedy typist) and you end up with `cchanges`. I would recommend these two changes: `WinActivate, ahk_exe devenv.exe` which will limit the macro to working with VS. `::seperator::separator` (not using an asterisk, which will cause execution only after the space-bar is hit (this being the key I type too fast), and possibly `:?:seperator::separator` - the query will allow replacement after other alpha chars. (I use vim plugin). – Orwellophile Sep 20 '17 at 10:55
0

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

dirkgently
  • 108,024
  • 16
  • 131
  • 187
0

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
  • 64,563
  • 18
  • 145
  • 216
0

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
  • 42,637
  • 17
  • 112
  • 171