Easy negation of expressions?

General discussion related to "Everything".
Post Reply
meteorquake
Posts: 495
Joined: Thu Dec 15, 2016 9:44 pm

Easy negation of expressions?

Post by meteorquake »

Hello all!
What is the simplest practical way to negate an OR expression, or in fact any other expression, as it is a common task you look for something and then want to see the remainder.
For example, suppose I have
jo|sam|kim|...
The natural wish is to do something like (which won't work)
!(jo|sam|kim|...)
or perhaps
not:jo|sam|kim|...
not:(jo|sam|kim|...)
as those involve little typing, rather than
!jo !sam !kim !...
which involves altering all the terms, of which there may be many

Thanks in advance!
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Easy negation of expressions?

Post by void »

Code: Select all

!<jo|sam|kim|...>
< > = grouping
meteorquake
Posts: 495
Joined: Thu Dec 15, 2016 9:44 pm

Re: Easy negation of expressions?

Post by meteorquake »

Many thanks!!
I definitely need to get into a habit of using angled brackets, I'm sure that will help! I'm rather habituated to thinking in terms of round brackets. I see it's on the right-click.

Whilst we're on the concept the following enhancement ideas come to mind -

* In the search box, you can highlight an area, right-click it, and click invert; this adds !< ... > around your selection (modifying the selection to include it) or removes it if already present.

* Have a command that inverts the entire result list (i.e. effectively an invisible !< ... > or inversion of the resulting search boolean calculation result), then a shortcut could be assigned to it. Typically this would be useful when you're in a folder on the folder bar.

Thanks again, David
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Easy negation of expressions?

Post by void »

There's Search box -> Right click -> Search Operator -> NOT

I will make this use !< ... > when you have selected text that has an operator.

Thank you for the suggestion.
meteorquake
Posts: 495
Joined: Thu Dec 15, 2016 9:44 pm

Re: Easy negation of expressions?

Post by meteorquake »

Thanks, that's a good idea.
I suppose the shortcode it gives
!
might also be replaced with
!, !< >
to explain what it will do
David
Post Reply