Columns managed by Search Function in Macros

Discussion related to "Everything" 1.5.
Post Reply
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Columns managed by Search Function in Macros

Post by runmode »

I'm going to present a method for managing columns by the search function
columns:
used in macros, which has key advantages over doing it with the search command
/colums:
used in multi-line bookmarks, which I have seen in previous discussions dealing with colums. I want to help others avoid empty miles. Finally I will ask @void to add a few functions, to top off the toolbox for this method.

The purpose of column control is to maintain result views which can be bound to bookmarks, together with the search. Whether you search for documents, pictures, music, recent files or sidecar files, etc., the result gets displayed in a proper way you want it.

Steps to achieve this:

1. Create a macro with the search function for the layout
The search command
/define name=search
creates a macro. A search command is permanent until changed.
Example:
/define layout1=columns:[{"name":"Name","width":350},{"name":"Path","width":350}]
.

Use bookmarks to set and edit macro definitions, which works as a macro editor:
bookmark name: /define layout1
bookmark search:
/define layout1=columns:[{"name":"Name","width":350},{"name":"Path","width":350}]

You can organize all bookmarks with macro definitions in a bookmark folder.

2. Create a bookmark for your search that also calls the macro
Example: search for text files
bookmark name: Text files
bookmark search:
layout1: ext:txt


Advantages of
columns:
in a macro:

1. Set the column layout temporarily for the search avoids to restore the default layout:

The search function
columns:
is active only for the current search, compared to the search command
/columns
which is permanent until changed.
The search function leaves the default layout unchanged, so there is no need to restore the default columns afterwards, which is the issue discussed here: viewtopic.php?t=15288. One reason why the search command was featured in the foregoing discussions might be that multi-line searches accept only search commands but no search functions.

2. Avoid code redundancies in multiple bookmarks, and save space in the search bar

Macros are the one and only way to re-use the column setting in multiple bookmarks, for different searches with the same column layout.

At time of my tests (Version 1.5.0.1408a) this cannot be achieved with filters, because filters work only with the simple column command
columns:name;path;...
, but not with JSON arrays
columns:[{"name":"Name","width":350},{"name":"Path","width":350},...]
. Also nested bookmarks don't work with
columns:
in the search.

A multi-line search as seen in previous discussions have the advantage of hiding the column definition from the search bar, but the downside that they accept only search commands, which means the same search command must be written to all these bookmarks in a redundant way.

3. Macros can be nested,
so it is possible to organize columns: and custom columns in separate macros as well as other temporary layout settings and combine that in a structured way.

Example which shows the last path segment in a column "Folder":
/define mlayout1=columns:[{"name":"Column A","width":500},{"name":"Name","width":500},{"name":"Path","width":40}]

/define mcolumna=a-label:="Folder" a:=regexextract($path:,"\\([^\\]*)$")

/define mlayout2= mlayout1: mcolumna: preview: ?path:

bookmark search:
mlayout2:

Keep macro names short, to minimize the space occupied in the search bar. Macro names are case sensitive.

Finally, my wishlist @void:

- A search function
right_sidebar_wide:
(equivalent to existing search command
/right_sidebar_wide
). In the example above preview: is not Everything.

- A search function
column_colors:
(equivalent to existing INI setting
column_colors
). In the example above I would like to highlite the Path column.

- A key + left mouse to open the path instead of launching the file (this most likely exists and I don't know it). In addition to Open Path in the right mouse context menu which is not so fluent. In the example above I wouldn't need to dedicate space to the path column.

- A search function
tab_colors:
to assign a color to the tab title (but preferably the background color). The idea is that a bookmark assigns a specific color to the tab it is running within, and when many tabs stay open the bookmark is easy to find. I often run into the problem that I close tabs which I need frequently because I cannot tell from the title which bookmark search is hosted thereunder and changing the tab title doesn't do the job.

- Generally, all layout settings should have a search function version for a temporary effect.

- A way to list all macro names defined in "true" macros and also macro names defined in filter/bookmarks, to avoid and track down conflicts. Currently /define does not list macro names set in filters and bookmarks.

Thank you for Everything!
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Columns managed by Search Function in Macros

Post by void »

I have added to my TODO list:

add a right_sidebar_wide: search function to temporarily set the sidebar widths.
add a column_colors: search function to temporarily set column colors like the column_colors INI setting.
add a tab_color: search function to temporarily set the tab color.

Thank you for the good suggestions.


- A key + left mouse to open the path instead of launching the file (this most likely exists and I don't know it). In addition to Open Path in the right mouse context menu which is not so fluent. In the example above I wouldn't need to dedicate space to the path column.
Ctrl + double click is too finicky as it will toggle the selection.
Shift + double click is too finicky as it will extend the selection.
Alt + double click is currently hard coded as Properties.
I will consider an option to override Alt + Double click to open the path.
For now, please try Ctrl + Enter.
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Columns managed by Search Function in Macros

Post by runmode »

This are my perceptions when clicking on a file in the Name column:
void wrote: Sun May 10, 2026 1:55 am Ctrl + double click is too finicky as it will toggle the selection.
Here, Ctrl + single click toggles the selection (expected usage).
Ctrl + double click does the same thing.
With double click recognition on mouse driver/system level it should work.
void wrote: Sun May 10, 2026 1:55 am Shift + double click is too finicky as it will extend the selection.
Here, Shift + double click opens the file,
same as double click.
void wrote: Sun May 10, 2026 1:55 am Alt + double click is currently hard coded as Properties.
Here, Alt + double click does nothing.
Also Alt + single click has no effect.

My settings in Tools / Options / Results:
Enabled: Open path with double click in path column
Disabled: Full row select
Single click open: Use system settings (=disabled)
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Columns managed by Search Function in Macros

Post by void »

Thanks for testing.

I cannot support Ctrl + Double click because:
If the item is already selected, Ctrl + Double click will unselect the item and no path is opened.
If another item is selected, Ctrl + Double click will select the item and open the paths for the whole selection.
Ctrl + Double click only works reliably if there's no selection.

I cannot support Shift + Double click because:
Shift + Double click will select an item range from the last clicked on item and open the paths for the whole selection.

The default Ctrl + Double click and Shift + Double click executing the whole selection is finicky too.
I will consider Ctrl + double clicking to just clear the selection, select the single item under the cursor and open the path.

I will add an option to mbutton_action to open paths in the next update.

Other options?
Double click on the icon opens the path?
Setting a margin with listview_margin_left and double clicking in the margin opens the path?
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Columns managed by Search Function in Macros

Post by runmode »

Thanks for the proposals!

Double click on the file icon to open the path is very charming and compact, because the eyes already rest on the file name - I like this most.

Double click on the margin is also a solution, but not so easy to hit, if the Name column is not the first column. I did't know listview_margin_left before - a useful hidden feature!

Very promising!
fanofvoid
Posts: 14
Joined: Tue Mar 24, 2026 6:05 am

Re: Columns managed by Search Function in Macros

Post by fanofvoid »

My current setup that is working. I'm always messing with settings, but these have stayed constant for a few months now.

Open (Folders)
$exploreineverything("%1")

Open (Files)
"%1"

Open Path
$exec("C:\Program Files\Everything 1.5a\Everything.exe" -parentpath "%1" -new-tab)

Explore
$exec("C:\Program Files (x86)\XYplorer\XYplorer.exe" "%1")

Explore Path
$exec("C:\Program Files (x86)\XYplorer\XYplorer.exe" "%1")


Keyboard Shortcuts:
File | Open Enter (Result List)
File | Explore Path Shift+Enter (Result List)
File | Explore in Everything Ctrl+Enter (Result List)
File | Explore Path in Everything (New Tab) Ctrl+Shift+Enter (Result List)

Mouse Shortcuts:
File | Explore in Everything Middle Button
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Columns managed by Search Function in Macros

Post by runmode »

Using search functions instead of search commands is the way to keep settings clear in Everything. No 3rd party tool required.
void wrote: Mon May 11, 2026 2:01 am I will add an option to mbutton_action to open paths in the next update.
@void: I noticed you added
/mbutton_action=3
to open the path when clicking with the mouse wheel on the file name.
Many thanks for this mouse action alternative to the keyboard shortcut Ctrl + Enter !

Is there an equivalet to
/path_hit_text_only
to enable clicking on the white space to the right of the name text? Something like /name_hit_text_only?

BTW /path_hit_text_only=0 and /path_hit_text_only=1 show the same behaviour in v1.5b which is open path on click into white space right of the path text. Is it a bug or did I miss the meaning of this setting?

With
/mbutton_action=3
I'd like to update my wish list of search functions for "views" (originating from colums controlled by macros):
1. A search function
right_sidebar_wide:
(equivalent to existing search command
/right_sidebar_wide

2. A search function
tab_colors:
to assign a color to the tab title (but preferably the background color)
3. A search function to control the Everything's window width and hight (yes this is new: it would be groundbreaking to expand the window when a bookmark requests it (by a macro in the search) for the purpose to show more or wider columns.

My clear strategy is "views on demand" (Everything as a chameleon), and search functions (in macros) is the way to achive that. I hope I can inspire you!
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Columns managed by Search Function in Macros

Post by void »

Is there an equivalet to /path_hit_text_only to enable clicking on the white space to the right of the name text?
No.
Not sure what this would do?


BTW /path_hit_text_only=0 and /path_hit_text_only=1 show the same behaviour in v1.5b which is open path on click into white space right of the path text. Is it a bug or did I miss the meaning of this setting?
It's working as expected here.
/path_hit_text_only=1
will open the item on left-double-click and open the path when left-double-clicking the path text.
How are you clicking?
mbutton_action works from anywhere on the item, single-click-open also worked for me.


With /mbutton_action=3 I'd like to update my wish list of search functions for "views" (originating from colums controlled by macros):
1. A search function right_sidebar_wide:
2. A search function tab_colors:
right_sidebar_wide: and tab_colors: are on my TODO list.


3. A search function to control the Everything's window width and hight (yes this is new: it would be groundbreaking to expand the window when a bookmark requests it (by a macro in the search) for the purpose to show more or wider columns.
Can be done with bookmarks, for example:
/window_wide=1000;window_high=1000

It gets a little awkward from a search.
However, I will consider a window_wide:1000/window_high:1000 search function.
Thank you for the suggestion.
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Columns managed by Search Function in Macros

Post by runmode »

First of all: I did not think of such a long reply - that's just how it turned out:
void wrote: Mon May 25, 2026 5:07 am
/path_hit_text_only=1
will open the item on left-double-click and open the path when left-double-clicking the path text.
How are you clicking?
Further reading on INI settings disclosed that
path_hit_text_only
is a sub-setting of
double_click_path
which was replaced by
double_click_path2
which was depreciated viewtopic.php?t=9994#path_hit_text_only. So can we conclude that also
path_hit_text_only
was depreciated, following double_click_path2 ?

It looks like "Open path with double click in path column" is now the setting of choice, as a replacement for
double_click_path2
, right ?
And viewtopic.php?t=9994#full_row_select_double_click_path says that
full_row_select_double_click_path
is the INI setting behind the "Open path with double click in path column" toggle (though literally 'select' is different from 'open').

Nevertheless, I tested
path_hit_text_only
again, with the following pre-settings:
/double_click_path=1
"Open path with double click in path column" was unchecked in Tools -> Options -> Results
/full_row_select_double_click_path=0|1 (tested both)

Behaviour when double-clicking with the left mouse button:

a) with
/path_hit_text_only=0

double-click in the path column on path text: opens the item in Explorer, focus on the item
double-click in the path column on empty space: opens the path in Explorer, focus on the item

just to round things off:
double-click in the name column on name text: opens the item with associated app (a folder in Explorer)
double-click in the name column on empty space: item gets just selected in Everything

b) with
/path_hit_text_only=1

exactly the same as above lit. (a)

void wrote: Mon May 25, 2026 5:07 am
Is there an equivalet to /path_hit_text_only to enable clicking on the white space to the right of the name text?
No.
Not sure what this would do?
The idea was to find alternatives to open the path, besides of Ctrl Enter and /mbutton_action=3, if the path column is hidden.
Just by way of an analogy to the options which open the path on double click in the empty space next to the path text in the path column, I thought an option would be useful which opens the path on double click in the empty space at the right of the item in the name column.
right_sidebar_wide: and tab_colors: are on my TODO list.
Thank you for confirming!
Can be done with bookmarks, for example:
/window_wide=1000;window_high=1000
It gets a little awkward from a search.
However, I will consider a window_wide:1000/window_high:1000 search function.
This would be great, to avoid permanent settings!

In the meanwhile I get along with multi-line bookmarks, such as

Code: Select all

/window_wide=2200;window_high=1100;right_sidebar_wide=450
mymacro: D:\ 
One more question: To avoid redundant code in multiple similar bookmarks, is it possible to compose a marco from INI-Settings or search commands?
For example:

Code: Select all

/define mymacro=/window_wide=2200;window_high=1100;right_sidebar_wide=450
does not work.
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Columns managed by Search Function in Macros

Post by void »

So can we conclude that also path_hit_text_only was depreciated, following double_click_path2 ?
No, while the setting double_click_path/double_click_path2 is depreciated, it is now always enabled.


It looks like "Open path with double click in path column" is now the setting of choice, as a replacement for
double_click_path2, right ?
"Open path with double click in path column" now maps to the ini setting:
full_row_select_double_click_path


This setting only applies when full row select is enabled.
If full row select is disabled, Everything will use double_click_path2, which is now always enabled.


Nevertheless, I tested...
I assume you have full row select disabled?

If so, path_hit_text_only is ignored.
Double clicking anywhere in the path column will open the path when rull row select is disabled.

Would you prefer Everything selects the item when double clicking on white space in the path column?


The idea was to find alternatives to open the path, besides of Alt Enter and /mbutton_action=3, if the path column is hidden.
Just by way of an analogy to the options which open the path on double click in the empty space next to the path text in the path column, I thought an option would be useful which opens the path on double click in the empty space at the right of the item in the name column.
I have put on my TODO list to rewrite double_click_select.
This setting should instead be non_label_row_double_click_action, with the option to select the item, or open the path.


This would be great, to avoid permanent settings!
I will consider an /open-bookmark search command, eg:

Code: Select all

/open-bookmark "my common bookmark"
mcsaveas: D:\
For now, you'll need to duplicate the search commands for each bookmark.

Thank you for the suggestions.
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Columns managed by Search Function in Macros

Post by void »

Everything 1.5.0.1414b adds a /open-bookmark search command.

Example usage:

Code: Select all

/open-bookmark "my common bookmark"
mcsaveas: D:\
Post Reply