Lurker News
I've been using this for about a year now - I parsed 6 months of my messages on slack and found the most common phrases I use and generated keyboard shortcuts for them.

Comments (313) 91 threads

Earlier comments
eschluntz2 replies#
Also the most surprising part of doing this was seeing that abbreviating super short words like "the" -> "t" actually saves far more characters overall than abbreviating long words and phrases that are less common, like "what do you think" -> "wdytk".
GuB-421 reply#
It would be interesting to see how much time you save.

I guess average typists will type "the" much faster than a complex word. Through muscle memory. I think it will be less noticeable for fast typists, who get their speed by being consistently fast.

eschluntz#
I thought a bit about this... I feel like for me most of my slowdown comes from needing to get timing correct between my right and left hand. When I go too fast I start to get the letters in the wrong order, which isn't as much of a risk for letters all coming from the same hand (for me at least shrug)

I might go look for some research on typing times for different kinds of words beyond letter count!

LanternLight83#
I think you'd dig Ikcelaks Magic Sturdy layout, which has a dedicated Adaptive Key (ie. morphing based on your last keypress, while fitting in with the overall layout by keeping finger usage and comfortable motions in mind). I mention it here because it expands to "the" if your last "letter" was space.

https://github.com/Ikcelaks/keyboard_layouts/blob/main/magic...

edanm1 reply#
This is really cool!

I did something similar on Mac, but completely manually. I'm using Espanso now, but I suffix every shortcut with an ";" character which causes the expansion. Since it's home row, it's incredibly easy to actually type it right after typing some letters, making it ideal, cause then I can use whatever shortcuts I want and very rarely have collisions.
I do think this automated generation of suggestions is a great idea, and I it made me realize I hadn't thought enough about the amount of times I type something vs. how big the word is. Since I have an extra letter, I don't want to do this for very very short words, but possibly something I type a lot is still worth it even if it's very short. I tend to use it for semi-long words that I have a hard time typing for whatever reason.
Anyways, very cool, I'll probably be running this script sometime soon to get a list of suggestions, then converting them into Espanso scripts!

eschluntz1 reply#
if you write a script to generate the Espanso scripts I'd love a PR!
edanm#
Haha I was going to do this manually but I just might turn it into a script.
codedokode3 replies#
I use similar abbreviations in code editor, for example:

    r0 -> return false
    rn -> return null
    t -> this
    puf -> public function
You can easily find the opportunities for saving typing by analyzing existing code and most used words there.
heyjamesknight2 replies#
Possibly a dumb question but: why not rf for the first one?
lights01231 reply#
r and f are usually pressed with the left index finger, which would have to move between keypresses. With r0, your right hand could align to press the 0 while the r is being pressed, saving time.
hatthew1 reply#
Solution: press both keys with a single "rolling" motion of one finger. I don't do that very often while typing, but when playing some games I'll hold down shift with the tip of my pinky and tap ctrl at the same time by flexing the middle of my pinky downwards.

Continue this thread — 1 reply

codedokode#
Because `return true` is `r1`, so it only makes sense to use `r0` for `false`. Regarding `rt`, it is used for `return this`.
eschluntz#
I tried for a bit using abbreviations while coding as well, but I kept running into variable names that I wanted to use
Alekhine3 replies#
What editor are you using to do this? I assume it's vim or emacs.
RheingoldRiver#
I don't do anything remotely this elaborate, for me it's a couple phrases to bring up the URLs of public discord servers I have to link to frequently. But for this, I use Autohotkey in Windows. It works really well.
codedokode#
Sublime Text allows to add arbitrary abbreviations, but I assume almost any code editor supports it.
globular-toast#
I have this with yasnippet in emacs. It's more than just simple expansion too. It expands to a skeleton to fill in the blanks, so f expands to a function definition and then allows you to put in parameters, return type, then body or whatever makes sense in the current language.

Load more comments