Fuzzy Search for Live Templates by Abbreviation or Description

Is there any way to fuzzy search for live templates to insert by abbreviation or description?

I have a number of live templates for the Foundation Framework, but it's hard keeping track of all of them. I've been using option+j to insert the templates, but it seems as soon as I skip a letter in the abbreviation all is lost.

Thanks

5 comments
Comment actions Permalink
Official comment

Christian, apparently there's no request explicitly for LiveTemplate search, you can submit one at http://youtrack.jetbrains.com/issues/WI#newissue=yes

 

There are couple of similar requests though: one, two, three and four

Comment actions Permalink

Hello!

 

I've just tried Ctrl(Opt)+J > started typing a LiveTemplate name I'm looking for and PhpStorm filtered out all of them except ones I was looking for. I was also able to use backspace to clear the search and do it again.

Important thing here: make sure you've defined your custom templates under Settings > Editor > Code Style > Live Templates > "Define" button on a bottom > select context this template could be applied under.

 

Thanks!

Dmitry

0
Comment actions Permalink

Thanks for your response, things do work as you've mentioned, but what I'm concerned about is dealing with large collections of components that are often prefixed.

For instance for Foundation 6 plugin the Live Template the accordion component abbreviation is "zf-ctacd". The way things are currently setup, I'd either have to type it exactly to filter the list, or scroll through the list and select it. On the other hand if the lookup was done with fuzzy matching I could type something like "zac" and that would filter down to the accordion Live Template faster.

 

0
Comment actions Permalink

Thanks, got it. We have some requests for fuzzy matching, I'm checking if there's an existing request for it or we should submit a new one.

I'll post an update here later.

1
Comment actions Permalink

I would also be interested in functionality like this since remembering so many random abbreviations is a pain.

I do have  workaround for now which I thought would be worth sharing. You can create a macro which simply types out the abbreviation and expands it. You use the macro by searching for the macro with the navigate to action command, this by default is fuzzy matching.

For example if I named the macro "javascript typeof undefined" I could fuzzy search for the macro by typing "tyun" or "type un" or any other characters that would fuzzy match it. This allows you to make the description as brief or descriptive as you need it to be without the need to remember random useless abbreviations. 

Relevant links:

https://www.jetbrains.com/help/phpstorm/2017.1/using-macros-in-the-editor.html

https://www.jetbrains.com/help/phpstorm/2017.1/navigating-to-action.html

0

Please sign in to leave a comment.