feat(file-manager): filter the listing and open files faster

The panel could only be browsed entry by entry, which is slower than cd and ls
in a large directory. Typing / now filters the listing with the same fuzzy
matcher as the command palette, typing : lists every action with its
description from a single catalog, and o/t open the selection in a new tab or
OS window. Sizes are read once when the directory is listed so that sort_by
size does not need to stat the entries again.
This commit is contained in:
BlackAngelTV committed 2026-11-11 19:07:03 +01:00
1 parent f16ed6cbfe
commit f896d75211
3 files changed
+569 -59

No files matched your search

+23 -1
View File
@@ -41,7 +41,8 @@ opt(
long_text="""
How to order entries. :code:`name` lists directories first, then files, both
sorted by name ignoring case. :code:`mtime` lists directories first, then files
sorted by last modification time, most recent first.
sorted by last modification time, most recent first. :code:`size` lists
directories first, then files sorted by size, largest first.
""",
)
@@ -127,6 +128,7 @@ map('Change shell directory to the directory being browsed', 'cd_here --allow-fa
map('Toggle display of hidden entries', 'toggle_hidden --allow-fallback=shifted,ascii . toggle_hidden')
map('Create a new file', 'create_file --allow-fallback=shifted,ascii n create_file')
map('Create a new directory', 'create_dir shift+n create_dir')
map('Create a new directory', 'create_dir --allow-fallback=shifted,ascii a create_dir')
map('Rename the selected entry', 'rename --allow-fallback=shifted,ascii r rename')
map(
'Delete the selected entry',
@@ -138,6 +140,26 @@ confirmation. Directories are never deleted recursively.
)
map('Copy the path of the selection to the clipboard', 'copy_path --allow-fallback=shifted,ascii y copy_path')
map('Reload the current directory', 'refresh --allow-fallback=shifted,ascii ctrl+r refresh')
map(
'Filter the listing with a fuzzy query',
'search --allow-fallback=shifted,ascii / search',
long_text="""
Filters the listing as text is typed, using the same fuzzy matcher as the
command palette. :kbd:`Entrée` opens the selection, :kbd:`Échap` clears the
query and restores the full listing.
""",
)
map(
'List and run the actions of the panel',
'palette --allow-fallback=shifted,ascii : palette',
long_text="""
Lists every action of the panel with its description, filtered by a fuzzy query,
and runs the selected one with :kbd:`Entrée`. The same actions can be bound to
dedicated shortcuts in :file:`file-manager.conf`.
""",
)
map('Open the selected file in a new tab', 'open_tab --allow-fallback=shifted,ascii o open_tab')
map('Open the selected file in a new OS window', 'open_window --allow-fallback=shifted,ascii t open_window')
egr()