How to configure clips so it insert the previous selected text?

I want to the snippet to warp a bunch of code in a try .. catch

From the Snippets docs we can see that:

  • PREVIOUS_TEXT : The word directly preceding the cursor or the empty string
  • SELECTED_TEXT : The currently selected text or the empty string
  • PASTEBOARD_TEXT : The text that is currently on the user’s pasteboard or the empty string

PASTEBOARD_TEXT - is the current workaround but ideally SELECTED_TEXT should be used.

For example with this setup

When I have a nova text selected and type eng I get:

howdy eng
howdy eng
howdy nova
howdy 23.05.21

Instead of

howdy nova
howdy nova
howdy nova
howdy 23.05.21

It seems that SELECTED_TEXT behaves like PREVIOUS_TEXT which shouldn’t be the case

SELECTED_TEXT will not work with trigger, you need to define a shortcut like so inside the Clips.json file "shortcut" : "alt-t"

1 Like