columns:/colums: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=searchExample:
/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:txtAdvantages of
columns:1. Set the column layout temporarily for the search avoids to restore the default layout:
The search function
columns:/columns 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;...columns:[{"name":"Name","width":350},{"name":"Path","width":350},...]columns: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:/right_sidebar_wide - A search function
column_colors:column_colors- 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:- 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!