Q: Creating a shortcut for "content:"?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Bamsen
Posts: 22
Joined: Thu Dec 09, 2021 9:16 am

Q: Creating a shortcut for "content:"?

Post by Bamsen »

Hi,

I am using content: quite often and would like to shorten it..
So I created a filter containing "content:" with the Macro of "c".
Now when I type c: content is active, but when I type what content to search for, it just searches in the filenames as normal

So I want the search ".txt c:morten" to act as ".txt content:morten" instead it acts as ".txt content: morten"

Am I going about this the wrong way?
What is the correct way to create an 'alias' for content:?

---
Regards
Morten A. Steien
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Q: Creating a shortcut for "content:"?

Post by NotNull »

Everything 1.5 has a new search command, /define, which is ideal for creating aliases/shortcut.

However, c: might not be the best alias -- or any one-letter alias for that matter -- as the they also refer to drive letters.


To create an alias cc for content:
  • Type or paste the following in the search bar and press ENTER

    Code: Select all

    /define cc=content:
    The result of that command will be shown in the statusbar for a couple of seconds
  • Done
Now you can search for
.txt cc:morten



To show a list of all aliases:
Type the following in the addressbar and press ENTER:
/define

The list will be shown in the statusbar. Items are separated by a semicolon.


To show the definition of the cc alias:
Type the following in the addressbar and press ENTER:
/define cc

The definition will be shown in the statusbar


To remove the cc: alias:
Type the following in the addressbar and press ENTER:
/undef cc

The result will be shown in the statusbar

/undef


P.S. Don't forget to remove your filter :D
Massor
Posts: 17
Joined: Sat Sep 03, 2022 3:27 pm

Re: Q: Creating a shortcut for "content:"?

Post by Massor »

Just about your last word ("filter"). Can be created a working filter for "content:"? Like:
Snap20230621205558.png
Snap20230621205558.png (27.71 KiB) Viewed 1610 times
void
Developer
Posts: 15488
Joined: Fri Oct 16, 2009 11:31 pm

Re: Q: Creating a shortcut for "content:"?

Post by void »

To create a content filter:
  • In Everything, from the Search menu, click Organize filters....
  • Select your content filter and click Edit.
  • Change the Search to: content:search:
  • Change the Macro to: c<search>
  • Click OK.
Bamsen
Posts: 22
Joined: Thu Dec 09, 2021 9:16 am

Re: Q: Creating a shortcut for "content:"?

Post by Bamsen »

Wonderful! That works perfectly!!
I do prefer the Filter option as it is more 'visible' :)

BTW I was trying to find a description in the documentation for how the "search:" and "<search>" part of the filter works but I was not able to find it.
Could you point me to the correct section? I am just curious to learn more about the syntax. :)
Massor
Posts: 17
Joined: Sat Sep 03, 2022 3:27 pm

Re: Q: Creating a shortcut for "content:"?

Post by Massor »

void wrote: Wed Jun 21, 2023 11:33 pm To create a content filter:
  • In Everything, from the Search menu, click Organize filters....
  • Select your content filter and click Edit.
  • Change the Search to: content:search:
  • Change the Macro to: c<search>
  • Click OK.
Thanks Void. It works! (...still to figure out how to use the Macro)
void
Developer
Posts: 15488
Joined: Fri Oct 16, 2009 11:31 pm

Re: Q: Creating a shortcut for "content:"?

Post by void »

There's no official support for macro parameters.


The macro syntax is:
marco-name<parameter-name>

The filter's search can recall the captured parameter with parameter-name:



For example:

c:abc

abc is stored in parameter-name.
Any references to parameter-name: are replaced with: abc
The entire macro is substituted with:

content:abc
Post Reply