How to use snippets?

64 views
Skip to first unread message

Stephen Hawk

unread,
Jun 16, 2019, 12:29:50 AM6/16/19
to CopyQ
Still on a journey to familiarize myself with CopyQ, I saw the Snippets command. However, although I tried various ways to use it, I cannot understand how it works.

I installed the Snippets command, but what do I do next? How and where could I add snippets?

Could I have a step by step example of setting up and using snippets?

M B

unread,
Jun 16, 2019, 6:42:56 AM6/16/19
to CopyQ, Stephen Hawk
Remove me from your list please.
Thanks
MB
--
You received this message because you are subscribed to the Google Groups "CopyQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copyq+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copyq/547d0950-7830-4c13-8a20-0ea3a4dd4ce1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Hawk

unread,
Jun 17, 2019, 7:23:34 AM6/17/19
to CopyQ
Hmm... I discovered that the tab Snippets has to be written exactly as "Snippets". I had entered it as "&Snippets" which apparently doesn't work.

However, I still don't understand how the placeholders should work:

"Items can contain placeholders like
  • ${Name} (default text is empty),
  • ${Name:value} (default text is "value"),
  • ${Name:value1,value2,value3} (default text is "value1"; allows to select from multiple values),
  • ${Name:\n} (multi-line text field)."
How would I use the above, for example, to have a "Fruit" snippet that would let me choose to paste one of apples, oranges or pears?

Lukáš Holeček

unread,
Jun 17, 2019, 7:28:52 AM6/17/19
to Stephen Hawk, CopyQ
To start:
1. create "Snippets" tab,
2. add new item (Ctrl+N) with a snippet:

    You picked ${Fruit:apples,oranges,pears}!

3. set optional snippet title (Ctrl+F2), e.g. "Fruit".

Triggering the Snippets command (with a global shortcut) should show simple dialog where you can pick the snippet by its title.

To pick different tab name, you have to change the command's code.

    var snippetsTabName = '&Snippets'

Lukas

--
You received this message because you are subscribed to the Google Groups "CopyQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copyq+un...@googlegroups.com.

Stephen Hawk

unread,
Jun 17, 2019, 7:43:18 AM6/17/19
to CopyQ
Thank you for the explanation. It's quite simple now and very a very useful feature of CopyQ.
To unsubscribe from this group and stop receiving emails from it, send an email to co...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages