4 ms·
I use similar abbreviations in code editor, for example: r0 -> return false rn -> return null t -> this puf -> public function You can easily
by codedokode 3y ago
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.
- heyjamesknight 3y agoPossibly a dumb question but: why not rf for the first one?
- lights0123 3y agor 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.
- hatthew 3y agoSolution: 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 3y agoI 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 3y agoBecause `return true` is `r1`, so it only makes sense to use `r0` for `false`. Regarding `rt`, it is used for `return this`.
- eschluntz 3y agoI tried for a bit using abbreviations while coding as well, but I kept running into variable names that I wanted to use
- Alekhine 3y agoWhat editor are you using to do this? I assume it's vim or emacs.
- RheingoldRiver 3y agoI 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 3y agoSublime Text allows to add arbitrary abbreviations, but I assume almost any code editor supports it.
- globular-toast 3y agoI 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.