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

Show all comments

Showing thread 15 of 91

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.
jayshua#
I use a similar technique for typing all the symbols. If I press f I get f, r gives me r, but if I press f and r at the same time with my left index finger positioned between the two keys I get $. w and s are {, e and d are }.

All the other symbols, parens, etc. are mapped to similar one-finger-two-key shortcuts.
Significantly cut down on finger stretching which used to cause me mild pain.

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.