Live data from Hacker News

Show HN: Espanso: detect a typed keyword and replace it while you're typing

espanso.org

11–20 of 77 posts

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#12

(Author here) Feel free to ask any question, I'll be happy to answer them :)

It's very nice that this is done with Rust, because I'd love to get rid of AutoHotkey in Windows (which also trivally support this kind of expansions). Do you plan to release individual components as crates?

I don't see myself using single program to do just expansions, but instead building my own program with Rust that has all sort of shortcuts like in AutoHotkey. I could use your expansion code as crate instead.

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#13

Earlier quoted context omitted.

(Author here) As long as the program accepts keyboard input or clipboard pasting, espanso should work correctly. There are some programs that behave a little bit differently (such as Thunderbird on Linux), that require a couple of configuration changes to work as expected (for example, slowing down the injections if the program is slow to process input). Happy to answer any other question :)

> for example, slowing down the injections if the program is slow to process input It's 2021 and some people still don't separate UI into its own non-blocked thread. E.g. When crunching a big dataset in QGIS (on Win10), every digit I type into "Classes" box [1] blocks everything and I have to wait. [1] https://i.stack.imgur.com/oddT7.jpg

Yep, that often happens! I sometimes experience this behavior on Google Docs, especially on slower machines

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#14
post #11

First I thought “oh yet another expander”. Then I saw forms! I wanted this for ages. Take my money! :D

Thanks, and by the way, espanso is completely free and open-source! Though if you like it, a donation is always welcomed :)

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#15
post #10

Looks really cool, but isn't this literally a key logger. I prefer this to be built in to maybe vs code, at least then I won't have to worry about accidentally capturing my passwords

Good point, I've wrote a short section to detail the security aspects: https://github.com/federico-terzi/espanso/blob/master/SECURI...

TLDR: It's not a keylogger, because it doesn't log anything :)

Moreover, on macOS the detection mechanism is automatically disabled on password fields

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#16
post #10

Looks really cool, but isn't this literally a key logger. I prefer this to be built in to maybe vs code, at least then I won't have to worry about accidentally capturing my passwords

Good point, I've wrote a short section to detail the security aspects: https://github.com/federico-terzi/espanso/blob/master/SECURI... TLDR: It's not a keylogger, because it doesn't log anything :) Moreover, on macOS the detection mechanism is automatically disabled on password fields

Also, the biggest benefit of this approach compared to a VSCode-only snippet, is that it works on any application and also between different operating systems, which makes it easier to collaborate and reuse them :)

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#17
Interesting, I built a similar system for my Vim setup that I slowly adopted over time. I realised that semicolons are almost always followed by whitespace or newlines in normal use, so I started defining a whole range of shortcuts with `;` as a prefix. As the key is directly on the homerow it's also quick and easy to use.

For example I have `;out` defined to expand to the correct stdout print function depending on the programming language used in that file.

Espanso looks like it's a great way to expand the same concept to the whole system, albeit (I'm guessing) without the contextual info a text editor can provide.

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#18

I used TextExpander every day at an old job and it saved me a ton of time. This looks really nice. Congrats!

Thanks! TextExpander is a great product indeed, but it did not work on Linux and that's one of the reasons why I originally created espanso :)

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#19
post #12

(Author here) Feel free to ask any question, I'll be happy to answer them :)

It's very nice that this is done with Rust, because I'd love to get rid of AutoHotkey in Windows (which also trivally support this kind of expansions). Do you plan to release individual components as crates? I don't see myself using single program to do just expansions, but instead building my own program with Rust that has all sort of shortcuts like in AutoHotkey. I could use your expansion code as crate instead.

Hey, It's unlikely that espanso will become a library anytime soon, but I'm currently refactoring the core into separate crates to follow a more modular "workspace" approach. So if you want to write your own standalone program, you could just pick the modules you need!

Started the refactor a few days ago so it's still in the early stage, but it's happening here: https://github.com/federico-terzi/espanso/tree/dev-1.x

Re: Show HN: Espanso: detect a typed keyword and replace it while you're typing

#20

Interesting, I built a similar system for my Vim setup that I slowly adopted over time. I realised that semicolons are almost always followed by whitespace or newlines in normal use, so I started defining a whole range of shortcuts with `;` as a prefix. As the key is directly on the homerow it's also quick and easy to use. For example I have `;out` defined to expand to the correct stdout print function depending on t…

> Espanso looks like it's a great way to expand the same concept to the whole system, albeit (I'm guessing) without the contextual info a text editor can provide.

That's right, out of the box espanso does not have any access to the contextual information, but with some "script gymnastics" [1] you can do plenty of interesting things :)

[1]: https://espanso.org/docs/matches/#shell-extension

Post reply on HN