from Hacker News

Espanso Cross-Platform Text Expander

by enbugger on 8/26/22, 9:31 AM with 41 comments

  • by albertzeyer on 8/26/22, 11:19 AM

    I was wondering how this was done technically, i.e. how it gets the current text content, and how it would do the text replacement.

    From a quick glance, it looks like for getting the text, it listens to all the keyboard events globally. I can imagine many potential problems and shortcomings with this approach, but on the other side, this is probably the most simple and most generic solution, working for almost every application.

    For sending the text, it does sth similar, i.e. it just injects global key events. Probably first some key backspace events to delete the old text, and then the keys for the replacement text.

    https://github.com/espanso/espanso/blob/dev/espanso-inject/s...

    But maybe I understand the code wrong. I did not delve too deep into it.

  • by kretaceous on 8/26/22, 12:55 PM

    Long time Espanso user (1+ year). It is one of those things I will lose my mind because my muscle memory is tuned to its shortcuts.

    I often type the same shortcuts in my Android device out of habit. So you can tell that I'm waiting for an Android version! I'm working around it by adding words to custom dictionary in Google Keyboard. But I'd love to be able to use the same .yaml file for my phone. I'm not necessarily talking about sync as I don't change the file often.

    One more thing about is the GUI search bar they have added. It has rough edges (doesn't react to my shortcut, etc.) but I'm sure it will get better.

    Love Espanso! Thanks and all the best to Federico, the creator and maintainer.

  • by sciuromorpha_ on 8/26/22, 10:07 AM

    I'm forever surprised how much this has improved my day to day working life. Simple things like having to input test email addresses and passwords on our dev environment repeatedly, or typing out addresses, or scaffolding basic scripts and code, or massively speeding up note taking. Genuinely worth digging in to.
  • by jdoss on 8/26/22, 1:59 PM

    Long time Espanso user and supporter of Federico's work. It is fantastic FOSS and it helps me get stuff done everyday. His project was the first one that I sponsored on GitHub which he recently discontinued using for donations. I have to figure out how to buy him a monthly coffee now.

    Also, here is a gist of my non-work specific Espanso snippets. I share (overshare??) what I am listening to on Spotify many times a day with my friends and coworkers, so the Spotify specific one gets used a lot!

    https://gist.github.com/jdoss/64c663e24cca2052842701e13db77d...

  • by anyfactor on 8/26/22, 6:53 PM

    I have been a long time user of Espanso. It is an absolute godsend.

    I used to work in social media management, I used to have bunch of `insert_generic_response` for birthdays to weddings to inquiries. I would have a random response generated with an Espanso hotkey for each purpose.

    Now, I store my token, curl commands, documentation, code snippets well.... being a DevRel I still use `insert_generic_response` but with more technical content!

  • by elesbao on 8/26/22, 12:25 PM

    Looks like a neat idea but having any kind of keylogger installed in my machine gives me second thoughts(a keylogger has the same principle of intercepting typed words and tags but instead of replacing them according to a backend system it sends the text away or store so some other party can read)
  • by n8henrie on 8/26/22, 12:23 PM

    I'm a big fan of espanso! I use it on my MacBook, my Linux desktop, and on Windows at work. Works very well on all three. I use many plain / dumb snippets, a few forms and date-based ones, and a few shell and Powershell scripts.

    I also would feel bad if I didn't mention that the main developer seems incredibly nice. I looked at this as a rust project to which I might be able to make minor contributions as a newb (which I still haven't done unfortunately). Federico goes out of his way to respond (quickly) to GH issues or posts on the subreddit in the kindest way imaginable.

  • by majkinetor on 8/26/22, 1:11 PM

    Autohotkey has this, called hotstrings, and you can even bind functions and much more. Not cross platform tho.
  • by sanketpatrikar on 8/26/22, 11:24 AM

    I love Espanso! I've been using it for inserting everything from email addresses to site:reddit.com

    I wish it was available for Android. For now, I use the text expansion feature built into Gboard, but it has a short text limit, which limits its usefulness.

  • by adhesive_wombat on 8/26/22, 5:38 PM

    This is a way better configuration system than AutoKey's (not AutoHotKey[1]) clunky GUI.

    [1]: also this is not easily confused with another similar program when searching like AK/AHK.

  • by smcn on 8/26/22, 12:16 PM

    Ha, I wrote something like this previously which I called Rabbit. It was in scheme, and would essentially watch for text between two carets (hence Rabbit, because it ate carets) and then the first word would be the function to run, with each subsequent word its argument.

    It was cool to use and show off to colleagues but it was such a hacky piece of work as I used xev to grabs a windows input and worked off of that.

    This looks _much_ better!

  • by yewenjie on 8/26/22, 12:19 PM

    What do people use Espanso for? I like the idea of the project but never really found a good use case for? The only thing I expand so far (using custom QMK setup on the keyboard itself) is my email.

    Also, is there any package that lets you cycle between your clipboard as you type anywhere?

  • by rabbitofdeath on 8/26/22, 5:15 PM

    I absolutely ADORE Espanso - I use it for stupid stuff, but for note taking and formatting dates I love it. I just have simple expansions `:gp` does `git pull` `:dcd` does `docker-compose down` and for common tasks, you can do alot!
  • by desireco42 on 8/26/22, 1:48 PM

    I don't mind listening to my typing, I do get concerns... what I can't think of, is how I would use it, can you please share more examples of your day to day usage, as current day... I really don't need that as much.

    Thanks

  • by fire on 8/27/22, 12:17 AM

    Really hoping for an android version some day, even if it has to use a kind of janky spell checker service to do so
  • by subpixel on 8/26/22, 12:06 PM

    I share an Espanso package with my team of juniors and it is awesome.
  • by throwaway888abc on 8/26/22, 4:33 PM

    Syncing across devices and Android, please. With love
  • by memorable on 8/26/22, 2:02 PM

    Just tried this! Really awesome and cool!
  • by riffic on 8/26/22, 7:54 PM

    espanso is a lovely tool.