TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

127 pointsby HipstaJulesover 4 years ago

20 comments

alpaca128over 4 years ago
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&#x27;s also quick and easy to use.<p>For example I have `;out` defined to expand to the correct stdout print function depending on the programming language used in that file.<p>Espanso looks like it&#x27;s a great way to expand the same concept to the whole system, albeit (I&#x27;m guessing) without the contextual info a text editor can provide.
评论 #26013070 未加载
dafmanover 4 years ago
I&#x27;ve been using Espanso for about a month and it&#x27;s made some tasks in my daily life so much easier. I regularly have to use template text, and instead of having to copy-paste it every time I&#x27;ve just set it to a snippet and it ends up saving me quite a lot of time. I&#x27;ve also taken to using it for URLs, as in some repsects its easier than having something bookmarked.<p>Definitely one of those tools that make me wonder how I got by without it
评论 #26014088 未加载
BiteCode_devover 4 years ago
Bit of a plug, but if you crave for that, and more, you can use AutoKey on Linux (not AutoHotKey which is Windows only): <a href="https:&#x2F;&#x2F;github.com&#x2F;autokey&#x2F;autokey" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;autokey&#x2F;autokey</a><p>It will let you bind custom Python scripts to any mouse&#x2F;keyboard sequence, including words on the fly. It can trigger word replacements just like Espanso (I use it to fill in emails, dates, addresses, timestamps et phone numbers), and of course, Python being Python, it lets you do a lot more.<p>The UI is probably not as good as Espanso&#x27;s, and it may be harder to use (you need to script). On the other hand, it provides an API for prompting you with UI to select dates, files, input, etc., has timers and the whole Python 3 stdlib.<p>Some nice stuff I do with it:<p>- typing $email&#x2F;$ phone present me with a list of email addresses&#x2F;phone num (I have a lot of them) to insert one. Prevents typo. By pass web form limitations.<p>- $now and $date does something similar with dates (listing of various formats for the current date and a calendar). Very handy for documents and file name. Most of them don&#x27;t have automated fields set up.<p>- $paste paste the clip board content, by passing any UI preventing me to do so, and screen&#x2F;tmux limitations.<p>- I&#x27;m a heavy dynalist users (dynalist.io&#x2F;) I love this software, but it lacks a lot of features, which are easy to add with AutoKey: just make a macro that inputs a serie of actions.
评论 #26014792 未加载
felixrover 4 years ago
I have a simple custom solution that works well for me. Snippets are just files in a directory. The filename is the snippet name. If the file is executable, it uses whatever is returned from running it. You can use zenity [0] to create forms or run rofi&#x2F;dmenu to select &quot;arguments&quot; in those scripts.<p>It uses `rofi` and `xdotool`:<p><pre><code> #!&#x2F;bin&#x2F;bash SNIPPET_DIR=&quot;${HOME}&#x2F;.config&#x2F;snipex&quot; DMENU=&quot;rofi -dmenu -b -p Snippet:&quot; XSEL=&quot;&#x2F;usr&#x2F;bin&#x2F;xsel --clipboard --input&quot; SNIPPET=$(ls -1 &quot;${SNIPPET_DIR}&quot; | ${DMENU}) FILE=&quot;${SNIPPET_DIR}&#x2F;${SNIPPET}&quot; STRIP_NEWLINE=&quot;head -c -1&quot; if [ -x &quot;${FILE}&quot; ]; then # snippet is executable -&gt; run it and copy the result ${FILE} | ${STRIP_NEWLINE} | ${XSEL} elif [ -f &quot;${FILE}&quot; ]; then # copy the contents of the file ${STRIP_NEWLINE} ${FILE} | ${XSEL} else # clean clipboard echo &quot;&quot; | ${XSEL} fi xdotool key --clearmodifiers &quot;Shift+Insert&quot; </code></pre> edit: and I have an xbindkeys config to run this script when I press Meta+,<p>[0]: <a href="https:&#x2F;&#x2F;help.gnome.org&#x2F;users&#x2F;zenity&#x2F;stable&#x2F;forms.html.en" rel="nofollow">https:&#x2F;&#x2F;help.gnome.org&#x2F;users&#x2F;zenity&#x2F;stable&#x2F;forms.html.en</a>
magnioover 4 years ago
I used Espanso a while back on my Win 10 machine. It was nice, but I got noticeable lag compared to the smooth replacing of AutoHotKey (AHK also uses less resources).<p>I might switch to Espanso in the future though, given that AHK is not available on Linux.
评论 #26013395 未加载
federicoterziover 4 years ago
(Author here)<p>Feel free to ask any question, I&#x27;ll be happy to answer them :)
评论 #26014384 未加载
评论 #26013548 未加载
评论 #26012980 未加载
评论 #26013636 未加载
评论 #26019123 未加载
评论 #26012906 未加载
moltarover 4 years ago
First I thought “oh yet another expander”. Then I saw forms! I wanted this for ages. Take my money! :D
评论 #26012995 未加载
ivanbakelover 4 years ago
Last (big) discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22191794" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22191794</a>
justindiroseover 4 years ago
I used to use TextExpander, but their app started to feel unpolished and was a bit expensive for my tastes. I&#x27;ve been using Espanso now for the most of the last year and I&#x27;ve been enjoying it. I even made a video about it [0].<p>My favorite &quot;feature&quot; is the fact that it works so easily cross-platform.<p>[0]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=RjXohQcuZyk" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=RjXohQcuZyk</a>
评论 #26014671 未加载
tyingqover 4 years ago
Ahh, so it has a built-in prank mode. Don&#x27;t leave your workstation unlocked :)<p><pre><code> show_icon: false show_notifications: false</code></pre>
评论 #26014680 未加载
评论 #26014603 未加载
snet0over 4 years ago
As someone with quite a few AHK hotstrings, and who does almost all of their day-to-day in Windows, what&#x27;s the selling point for this software vs AHK? Looks like a great and useful piece of software, but is there a reason to prefer this in cases where AHK is viable?
评论 #26019825 未加载
评论 #26019530 未加载
ficklepickleover 4 years ago
This is really cool. I just made a keyboard shortcut tool and I wish I had known about this.<p>Basically, I brought some Windows keyboard shortcuts to linux. Specifically, Alt + 0,N,N,N to type accented characters. For example, è is Alt + 0,2,3,2.<p>Autokey was too slow, I ended up using a hacky OS keyboard shortcut + bash script approach. Ugly but it works! I should see if I can use espanso for this.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jeremy21212121&#x2F;linux_accent_hotkeys" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jeremy21212121&#x2F;linux_accent_hotkeys</a><p><a href="https:&#x2F;&#x2F;jeremypoole.ca&#x2F;posts&#x2F;windows_keyboard_shortcuts_on_linux&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jeremypoole.ca&#x2F;posts&#x2F;windows_keyboard_shortcuts_on_l...</a>
bryanrasmussenover 4 years ago
when it says: Works with almost any program - what programs is it not working with, and are they OS specific? From what I know of text expansion on Windows I would expect every program on Windows works and it is Mac and Linux that gives the problems?
评论 #26012858 未加载
temp0826over 4 years ago
I’ve been looking for a system-level “cloud” -&gt; “butt”. Thanks!
评论 #26013830 未加载
nojaover 4 years ago
Cool. Any thoughts on how it compares to Clavier? <a href="https:&#x2F;&#x2F;gryder.org&#x2F;software&#x2F;clavier-plus&#x2F;?lang=en" rel="nofollow">https:&#x2F;&#x2F;gryder.org&#x2F;software&#x2F;clavier-plus&#x2F;?lang=en</a>
评论 #26013152 未加载
dlkmpover 4 years ago
I use QMK macros&#x2F; tap dances for the same thing as a 100% platfrom independent solution (albeit being also a 100% hardware dependent solution).
jijjiover 4 years ago
This is pretty awesome....For windows and DOS there has always been a program called Shorthand and PRD+, but nothing has existed for Linux.
评论 #26013949 未加载
jhunter1016over 4 years ago
I used TextExpander every day at an old job and it saved me a ton of time. This looks really nice. Congrats!
评论 #26013029 未加载
Kaze404over 4 years ago
I thought about making something like this once. Seems incredibly useful, thank you!
评论 #26014736 未加载
offtop5over 4 years ago
Looks really cool, but isn&#x27;t this literally a key logger.<p>I prefer this to be built in to maybe vs code, at least then I won&#x27;t have to worry about accidentally capturing my passwords
评论 #26013558 未加载
评论 #26015490 未加载
评论 #26013014 未加载