My most frequent typing error is to transpose tow letters, like taht. I’m happy to move the cursor to where it needs to be, and looking to save some keystrokes.
I’m looking to automate a script that would:
select one letter back
cut
move one letter forward
paste
I’m certain Keyboard Maestro could do something as trivial as that, but I don’t have it and right now could not justify getting it.
What other options can you suggest? I have Alfred and the usual OSX tools. I should note, this is for working in plain text files.
Not the answer to your question I know, but for the simple but frequent ones you can always put them in keyboard maestro or the native text replacement options. I have several of there (including taht (that), hre (her) and iclpud (icloud) to correct me while I’m typing. The advantage of using the default text replacement in macOS/iOS is it works across devices.
Sorry, KeyBindings would be overkill for this request. Just place the cursor in between the letters and use Control-T
KeyBindings will allow you to do more advanced text manipulations like this. I thought your original request said you wanted similar keyboard shortcuts to the transpose shortcut.
That link I posted about KeyBindings will start you in the right direction. Lots of useful text manipulation stuff. One of my favorites is moving a line of text up/down. The real power is in the fact that you don’t need to highlight any text for these to work.
The strange thing is, when I looked for /Library/KeyBindings as Brett suggests, I couldn’t find it under either in my Home or anywhere else. But at some point I must have downloaded it from Brett when I downloaded Cheaters. But I never really paid attention to any of the actual key bindings.
Now I really need to take the time to learn just a few.
I do this with Keyboard Maestro (unsurprising, since I wrote it).
Typed String trigger for “taht”, turn off the option to delete the characters.
Explicitly type three Deletes
Insert Text by typing “hat”
System Beep (to get me out of the habit).
Note that you are probably better off changing it to "taht " (including a space at the end). The reason is that people tend to type words quickly followed by the space, buy then pause before the next word, so it works better that way.
Yes, but I only have a very few ones that I commonly do, like dont ➤ don’t and quiting ➤ quitting and a handful of other spelling mistakes I commonly make and want to train myself out of.