Hello fellow expanders!
Version 0.4.1 brings some interesting new features, as well as many bug fixes.
New features
Experimental: preserve clipboard
Espanso now supports a way to partially preserve your previous clipboard when expanding a match instead of overwriting it. At the moment, it only preserve text-based clipboards, so if you had pasted an image, espanso will overwrite it even with this option enabled.
Because this is still experimental, you will need to enable it manually by adding the following line in your default.yml
config:
preserve_clipboard: true
In the next release, unless any problems arise, the feature will be turned on by default.
A great thank you to @matt-h, who laid the foundations of this new feature.
Random Extension
You how have the possibility to write non-deterministic replacement texts. Said in other words, you can now specify a set of possible expansions for a match, useful to avoid repetitions.
This feature works as any other extension. You declare a variable of type random
and then pass a number of choices
as a parameter:
- trigger: ":quote"
replace: "{{output}}"
vars:
- name: output
type: random
params:
choices:
- "Every moment is a fresh beginning."
- "Everything you can imagine is real."
- "Whatever you do, do it well."
In this case, typing :quote
will expand randomly to one of the tree quotes.
Minor changes
- You can now specify the
trim: true
parameter in a shell extension to trim the output from any space/newline character. For example:
- trigger: ":shell"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "echo Hello from your shell"
trim: true