[HN Gopher] Show HN: I automated 1/2 of my typing
       ___________________________________________________________________
        
       Show HN: I automated 1/2 of my typing
        
       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.
        
       Author : eschluntz
       Score  : 211 points
       Date   : 2023-08-30 18:40 UTC (4 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | habitue wrote:
       | This seems like a really good way to make it so you have a hard
       | time typing on anyone's computer but your own.
        
         | sodapopcan wrote:
         | If that's something you do then obviously this isn't for you. I
         | personally haven't typed on someone else's computer in at least
         | 13 years. Since whenever I got my first laptop.
        
           | wizofaus wrote:
           | You've never had to help someone do something on their own
           | computer that required typing something in?
        
         | albert_e wrote:
         | I use a trackball and find it makes me more productive and
         | causes less strain
         | 
         | Most other people use a normal mouse
         | 
         | Since I also have a lot of muscle memory using normal mice, I
         | am able to quickly adjust to working on a new PC
         | 
         | Others struggle when they have to take over my PC and show me
         | something by navigating with my trackball
         | 
         | I am guessing this might be similar -- since OP does have years
         | or muscle memory with normal keyboards anyway to back them up
        
       | h1fra wrote:
       | Neat! Reminds me of stenography keyboards
        
       | felipesabino wrote:
       | this reminded me of speed writing [1]
       | 
       | [1] https://www.reddit.com/r/Classic_Speedwriting/wiki/list108/
        
       | UtopiaPunk wrote:
       | I use a tool called "Espanso" to accomplish something similar at
       | work. It only runs locally, so no weird data scraping issues to
       | worry about. And it's easy to update as things changes becauase
       | everything lives in a simple yml file.
       | 
       | https://espanso.org/
       | 
       | It can do simple text replacement, so I have words, phrases, and
       | sentences I use frequently compressed into a few keyboard clicks.
       | It can also grab what is in your clipboard, so that can be
       | incorporated into responses, which is simple but very handy.
       | 
       | A simple text replacement looks like this in the yaml file: -
       | trigger: ":espanso" replace: "Hi there!"
       | 
       | But it can even work with a shell, which I think is amazing! For
       | example, I have a particular task at work where I often need to
       | insert a random number into a text document. I can have Espano
       | run PowerShell behind the scenes to run a simple PowerShell
       | command, and that looks something like:                 -
       | trigger: ";rand"         replace: " {{output}}"         vars:
       | - name: output             type: shell             params:
       | cmd: "Get-Random -Minimum 100000"               shell: powershell
        
         | eschluntz wrote:
         | That is cool! I use Autokey under the hood, but I'll check out
         | Espanso as well
        
       | zerojames wrote:
       | I _love_ to see projects like this.
       | 
       | I was working on a similar problem this weekend, but with whole
       | words instead of abbreviations I had made in a dictionary, and in
       | the general case, fine-tuned on any given corpus of text.
       | 
       | I wanted to know: could I write an autocorrect that is "fine-
       | tuned" on a given corpus of text? Use case: I write a lot of docs
       | with long phrases (i.e. "data augmentation"). Could I automate
       | them?
       | 
       | I arrived at:                   1. Calculate "surprisal" of
       | unigrams and bigrams (entropy) from a general dataset (an NYT
       | corpus), give a boost to words in the "fine-tuned" index;
       | 2. Create a trie data structure that is weighed by surprisals.
       | The more surprising a word, the more weight it gets.         3.
       | Use that as advanced autocomplete.
       | 
       | I got a working solution here:
       | https://github.com/capjamesg/autowrite/blob/main/autocomplet...
       | 
       | (No docs yet -- coming in the next few days. Leave a GitHub Issue
       | if you want to chat about it!)
        
       | ReD_CoDE wrote:
       | Cool, thinking how can use it in programming, or other
       | conditions?
        
         | [deleted]
        
       | eschluntz wrote:
       | I also wrote a blog post with video about the project:
       | https://erikschluntz.com/software/2023/08/26/compressing-my-...
       | 
       | This has been one of the rare side projects that has actually
       | saved me more time than I've put in :)
        
         | KomoD wrote:
         | Have you checked how much faster this makes your typing? I can
         | imagine it speeds it up quite a bit
        
       | MobiusHorizons wrote:
       | I feel like typing is never really the bottleneck for me except
       | maybe in some chat interactions would have benefited from the
       | extra bandwidth of video or audio. Do you actually save time on
       | task with these kinds of shortcuts?
        
       | eschluntz wrote:
       | 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-42 wrote:
         | 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.
        
         | aaron695 wrote:
         | [dead]
        
       | Xenoamorphous wrote:
       | This is cool but I see so many posts in HN about "hacks" that
       | increase productivity/save time that it makes me anxious.
       | 
       | I don't know if it's our field or just life these days but I
       | would really love a more relaxed approach to work (or life in
       | general?). It feels like I'm in a race and struggling to keep up
       | with the pack.
        
         | [deleted]
        
         | gamerDude wrote:
         | I have found that I am spending more and more time thinking
         | about my solution before implementing. Life is definitely more
         | enjoyable and probably about equally as productive. You just
         | have to carve out that time. Go for a walk and take intentional
         | breaks from the keyboard.
        
         | rpmisms wrote:
         | It's not healthy to always be running around like a headless
         | chicken. I want well-paced work to become normal.
        
         | nonameiguess wrote:
         | Hopefully, this is most often just an excuse for someone with
         | the hacker spirit to figure out how to automate something
         | because it's fun. If you're really spending that much time
         | replying to Slack and e-mail that making yourself an
         | arbitrarily fast typist puts a meaningful dent in what would
         | otherwise be work blockages, I think there are organizational
         | problems there that you can't solve by being a faster typist.
        
       | mikysco wrote:
       | https://kapeli.com/dash
       | 
       | Somewhat similar tool to Autokey for MacOS that I use as a text
       | expander.
       | 
       | Allows for great customization - appending ; to a phrase ensures
       | you don't accidentally expand a keystroke into a phrase/URL/etc
       | 
       | ";url" expands into "whatever string you configure"
        
         | [deleted]
        
       | jawns wrote:
       | If you're going to use models, why not models all the way
       | through?
       | 
       | In other words, rather than using them merely to identify words
       | to abbreviate and suggested abbreviations, why not use an LLM
       | that can take a bunch of abbreviated text and infer what you're
       | trying to abbreviate?
       | 
       | Tht wy, u dn't hv 2 mem lsts f abbrs ahd f tm.
       | 
       | ChatGPT was able to successfully guess that last sentence in
       | abbreviated form:
       | 
       | That way, you don't have to memorize lists of abbreviations ahead
       | of time.
        
         | zogrodea wrote:
         | "That way, you don't have to remember lists of abbreviations"
         | and... I can't seem to guess the last few words. Would you mine
         | typing it out in full?
         | 
         | Edit: Oh, "That way, you don't have to remember lists of
         | abbreviations ahead of time". ChatGPT must be something
         | impressive if it can beat me at some linguistic games.
        
           | maest wrote:
           | "ahead of time"
        
         | xmprt wrote:
         | ChatGPT is much slower and much more expensive. You don't have
         | to use LLMs for everything.
        
         | [deleted]
        
         | input_sh wrote:
         | Ah yes, I'd love to wait about five seconds every time I type
         | some text for ChatGPT to return some output, worrying about
         | boilerplate text around the actual answer, and to introduce
         | unpredictability into the mix.
        
           | tshaddox wrote:
           | I'd probably try using ChatGPT to suggest the specific
           | abbreviations for the most common phrases.
        
       | 1729__iykyk wrote:
       | [flagged]
        
       | 1729__iykyk wrote:
       | [flagged]
        
       | KomoD wrote:
       | Pretty cool and very useful, as long as you can remember all of
       | the shortcuts (I guess it comes with time!)
       | 
       | It kind of reminds me of stenography in a way
        
       | tikkun wrote:
       | Idea for extending this: keylogger (yeah, that's a downside...)
       | that'll watch what you type, learn common phrases, identify
       | common ones, then come up with shortcuts, then each time you type
       | the full phrase it gently reminds you of the shortcut.
       | 
       | Then anyone can install it, no friction, and over time it'll
       | slowly start making you gently more productive.
        
         | quadrature wrote:
         | Its not a keylogger in itself, its a tool to configure your
         | keylogger.
        
           | MobiusHorizons wrote:
           | I guess you are half right, the tool this repo configures is
           | a shortcut engine (autokey). It has access to the key
           | presses, but afaik does not log them.
        
         | rohitpaulk wrote:
         | I once built a typing tutor that did something like this - it
         | monitored all the mistakes I'd make, and would surface the most
         | typo-ed words for practice.
        
         | kzrdude wrote:
         | Would it be better to have some standardized abbreviation? It
         | could gravitate towards those. That should help consistency
         | between different computers (also helps if you have multiple
         | computers..)
        
         | langsoul-com wrote:
         | I wonder how that's work?
         | 
         | Something like auto export slack history each week, get a word
         | frequency. Then mantually assign a bunch of expansions based on
         | what you see?
        
           | tikkun wrote:
           | I'm imagining it would be a native desktop app, so that it
           | goes across all apps.
        
       | codedokode wrote:
       | 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 wrote:
         | Possibly a dumb question but: why not rf for the first one?
        
       | manx wrote:
       | Very interesting. I once recorded all my vim keypresses to do
       | something similar for vim, but never actually did anything with
       | the data. Seems like it should be easily doable with this project
       | now.
        
       | Nowado wrote:
       | I was thinking about similar solution (actually, textblaze funded
       | by YC is pretty much that) but I didn't like remembering the
       | shortcuts part. So I made a different kind of indexing for it:
       | https://discu.space/ Presentation uses 'what are you answering
       | to' as a key, but you can use anything.
       | 
       | It currently exists as (hopefully working for everyone, could use
       | more testing) Chrome extension, but there's a universal API
       | underneath. It could be run entirely locally if one was to give
       | up portability.
        
       | [deleted]
        
       | dapookster wrote:
       | Very cool!
        
       | jaxrtech wrote:
       | I wish there was a way to just repurpose existing operating
       | system support for CJK language IME for English.
        
         | crazygringo wrote:
         | Could you elaborate?
         | 
         | I'm aware of CJK input methods, but it's not immediately clear
         | how/why you could repurpose them for English. Not to mention
         | there are several types.
        
       | svennidal wrote:
       | I use the native feature for this in macOS and iOS a lot!
        
       | hello456 wrote:
       | This is neat! I've thought about doing something similar with my
       | shell history to help me figure out which shell aliases I should
       | create.
        
       | mtlynch wrote:
       | This is neat!
       | 
       | I've thought about doing something similar with my shell history
       | to help me figure out which shell aliases I should create.
        
         | KomoD wrote:
         | > I've thought about doing something similar with my shell
         | history to help me figure out which shell aliases I should
         | create.
         | 
         | Same here, I end up doing `h | grep "(something about the
         | command)` a lot to get commands with specific options, etc. and
         | think "damn i should really make an alias for this" every
         | single time, but never get around to it
        
           | yorwba wrote:
           | How about fzf? https://github.com/junegunn/fzf
        
             | jll29 wrote:
             | There's also Flexpansion for Android (no training
             | required): https://flexpansion.com/wp/
        
           | ellieh wrote:
           | You might like Atuin*! It fuzzy searches your shell history +
           | optionally syncs it between machines
           | 
           | https://github.com/atuinsh/atuin
           | 
           | *: shameless plug, I'm one of the maintainers
        
             | KomoD wrote:
             | Yeah wow, I do like that, I'll definitely use it a lot, the
             | full-screen thing on "up" keeps taking me by surprise
             | though
             | 
             | Ps. one of the links in the docs is dead, "see the
             | supported shells" on the page
             | https://atuin.sh/docs/commands/shell-completions
        
               | ellieh wrote:
               | Glad to hear it! You can disable the arrow key binding if
               | you want, and/or make it only use part of the screen :D
               | 
               | Fixed it - thanks for the catch!
        
       | IntToDouble wrote:
       | Self plug but high relevancy - measuring keystrokes-per-second to
       | convert the characters saved into actual $TIME.
       | 
       | Calculation for "the" from the screenshot in the repo:
       | 
       | 9933 characters saved / 8 kps = ~20 minutes
       | 
       | https://www.inttodouble.com/explore/keystrokes-per-second
        
       | JohnFen wrote:
       | I did this sort of thing quite a lot early in my career, but
       | stopped quite a long time ago. The problem is that I started
       | using multiple machines running different OSes, and not all of
       | those machines are "mine", so I couldn't have these sorts of
       | specializations everywhere.
       | 
       | That turned a positive into a negative when using machines that
       | didn't have these optimizations.
        
         | [deleted]
        
         | lainga wrote:
         | For a similar reason, I did my best to get comfortable with
         | default vim rather than purtying it up with a long .vimrc.
        
         | absoluteunit1 wrote:
         | I haven't done what you or the author have, but one workaround
         | this is using something like QMK or ZMK. Especially the Leader
         | key on QMK.
         | 
         | Thanks for the post though, I need to do some analysis of my
         | own typing habits to automate them
        
           | davidtos wrote:
           | This is exactly what i do. Pressing the leader key and
           | another key to let it type sentences and boiler plate code.
           | 
           | Creating a layer for this sort of typing would also be really
           | cool and not having to use that leader key the entire time.
        
           | JohnFen wrote:
           | Interestingly enough, I have a macro keyboard I built myself
           | that I use at home. It never occurred to me to use it
           | professionally until you brought it up. Hmmm. Thank you!
        
       | majkinetor wrote:
       | On Windows, better fit is Autohotkey and its hotstrings for
       | people wanting to use this. It's much better for that as it
       | supports full programming language so you could use function
       | results and similar to produce abbreviations.
       | 
       | https://www.autohotkey.com/docs/v1/Hotstrings.htm
        
       | crazygringo wrote:
       | This is a very clever idea.
       | 
       | However, I realize that I would never want to use something like
       | this that would change over time. E.g. if I ran it every 6 months
       | and last year "db" produced "debug", while this year it produces
       | "database". Because talk about messing up my muscle memory and
       | habits. And the language I write changes very much over time.
       | 
       | So I'd actually be much more interested in a "universal" version
       | of this -- if you ran it across books and e-mails and text
       | messages from thousands of authors covering diverse backgrounds
       | and contexts, then what would most reliably help _everyone_?
       | 
       | E.g. expanding "t" to "the" seems like a no-brainer, just like
       | "st" to "something". Is there a minimal set of, say, 200-500 of
       | these that could simply be turned into a "standard keyboard" that
       | everyone could learn?
        
         | calvinmorrison wrote:
         | Congrats you just invented shorthand!
        
         | IanCal wrote:
         | You could make it append only by default. Only ever add new
         | shortcuts - if db was debug for you before then database would
         | have to take on a new shortcut (e.g. dtb)
        
         | kulikalov wrote:
         | A simple ngram index can address your concern
        
         | sosodev wrote:
         | Is the universal version of this stenotype?
        
           | NateEag wrote:
           | More or less, yeah.
           | 
           | There are different stenography systems, each with their own
           | shortcuts and abbreviations, but at core they're all about
           | producing large volumes of text with minimal physical effort
           | at very high speeds.
           | 
           | Those interested should check out
           | http://www.openstenoproject.org/.
           | 
           | A good mechanical keyboard (e.g. the ErgoDox EZ) and Plover
           | mean the only thing standing between you and >200 WPM typing
           | is the time and effort to learn it.
        
         | capableweb wrote:
         | > However, I realize that I would never want to use something
         | like this that would change over time. E.g. if I ran it every 6
         | months and last year "db" produced "debug", while this year it
         | produces "database". Because talk about messing up my muscle
         | memory and habits. And the language I write changes very much
         | over time.
         | 
         | > However, I realize that I would never want to use something
         | like this that would change over time.
         | 
         | > And the language I write changes very much over time.
         | 
         | Sounds like exactly you want something that evolves after time,
         | since how you write changes over time.
         | 
         | An universal version would maximize the amount of helpfulness
         | on an average for everyone, but a tool that learns from your
         | individual actions, can be much better improvement for you. And
         | by making the tool available to everyone, more people could get
         | bigger benefits from it, rather than just "average" benefits.
        
           | crazygringo wrote:
           | > _Sounds like exactly you want something that evolves after
           | time, since how you write changes over time._
           | 
           | No, because I don't want the shortcuts to be changing on me.
           | That would drive me nuts. The whole point for me would be to
           | establish new habits and then keep them. To turn into muscle
           | memory, not something to be thinking about.
           | 
           | It's like toolbars that "learn" which actions you're
           | currently using the most, but the buttons are constantly
           | moving around and are never where they were last week. It's
           | an exercise in frustration.
        
             | esquivalience wrote:
             | I think it's built and fixed until you decide to extend or
             | modify it.
        
       ___________________________________________________________________
       (page generated 2023-08-30 23:00 UTC)