Help me correct my most frequent mistyping

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.

Thanks

Jeremy

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.

1 Like

You need to fall down the rabbit hole of KeyBindings.

1 Like

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.

Good heavens! I had no idea CTRL-T even existed. What magic is this? Where would I look for other similar things?

Thanks a lot.

Jeremy

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.

1 Like

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.

Thanks again.

Jeremy

Have you tried setting up some replacements in System Preferences › Keyboard › Text?

Thanks, but too many for that, and the ^T solution works a treat.

I think you may have to create the file manually in that directory, but I could be mistaken. It’s been a while since I dug into all of that.

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.

2 Likes

I’m sure you don’t have those for every transposition you make. :slight_smile:

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.

I still use TypeIt4Me.

You don’t have to do anything apart from switch on AutoCorrect and select either the TidBITSAutoCorrect Dictionary or AppleSpell (or both).