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.<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'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.
I've been using Espanso for about a month and it'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've just set it to a snippet and it ends up saving me quite a lot of time. I'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
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://github.com/autokey/autokey" rel="nofollow">https://github.com/autokey/autokey</a><p>It will let you bind custom Python scripts to any mouse/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'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/$ phone present me with a list of email addresses/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't have automated fields set up.<p>- $paste paste the clip board content, by passing any UI preventing me to do so, and screen/tmux limitations.<p>- I'm a heavy dynalist users (dynalist.io/) 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.
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/dmenu to select "arguments" in those scripts.<p>It uses `rofi` and `xdotool`:<p><pre><code> #!/bin/bash
SNIPPET_DIR="${HOME}/.config/snipex"
DMENU="rofi -dmenu -b -p Snippet:"
XSEL="/usr/bin/xsel --clipboard --input"
SNIPPET=$(ls -1 "${SNIPPET_DIR}" | ${DMENU})
FILE="${SNIPPET_DIR}/${SNIPPET}"
STRIP_NEWLINE="head -c -1"
if [ -x "${FILE}" ]; then
# snippet is executable -> run it and copy the result
${FILE} | ${STRIP_NEWLINE} | ${XSEL}
elif [ -f "${FILE}" ]; then
# copy the contents of the file
${STRIP_NEWLINE} ${FILE} | ${XSEL}
else
# clean clipboard
echo "" | ${XSEL}
fi
xdotool key --clearmodifiers "Shift+Insert"
</code></pre>
edit: and I have an xbindkeys config to run this script when I press Meta+,<p>[0]: <a href="https://help.gnome.org/users/zenity/stable/forms.html.en" rel="nofollow">https://help.gnome.org/users/zenity/stable/forms.html.en</a>
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.
I used to use TextExpander, but their app started to feel unpolished and was a bit expensive for my tastes. I've been using Espanso now for the most of the last year and I've been enjoying it. I even made a video about it [0].<p>My favorite "feature" is the fact that it works so easily cross-platform.<p>[0]: <a href="https://www.youtube.com/watch?v=RjXohQcuZyk" rel="nofollow">https://www.youtube.com/watch?v=RjXohQcuZyk</a>
Ahh, so it has a built-in prank mode. Don't leave your workstation unlocked :)<p><pre><code> show_icon: false
show_notifications: false</code></pre>
As someone with quite a few AHK hotstrings, and who does almost all of their day-to-day in Windows, what'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?
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://github.com/jeremy21212121/linux_accent_hotkeys" rel="nofollow">https://github.com/jeremy21212121/linux_accent_hotkeys</a><p><a href="https://jeremypoole.ca/posts/windows_keyboard_shortcuts_on_linux/" rel="nofollow">https://jeremypoole.ca/posts/windows_keyboard_shortcuts_on_l...</a>
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?
Cool. Any thoughts on how it compares to Clavier? <a href="https://gryder.org/software/clavier-plus/?lang=en" rel="nofollow">https://gryder.org/software/clavier-plus/?lang=en</a>
Looks really cool, but isn't this literally a key logger.<p>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