Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I define instant AutoCorrect macros in Visual Studio?

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

like image 415
Stuart P. Bentley Avatar asked Mar 12 '09 10:03

Stuart P. Bentley


1 Answers

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
like image 106
Chris Fewtrell Avatar answered Nov 18 '22 21:11

Chris Fewtrell