← XeFM English | 日本語 · crftwr/xefm on GitHub · craftware

Select by Pattern

English | 日本語

Three ways to select many files at once without filtering the pane first.

Action Menu What it does
select_by_pattern Select → Select by Pattern… Asks for a pattern and adds every matching file to the selection
unselect_by_pattern Select → Unselect by Pattern… Asks for a pattern and removes every matching file from the selection
select_same_extension Select → Select Same Extension Adds every file with the same extension as the one under the cursor

Keys depend on your keymap preset — see Keymap Presets. All three are also in the command palette (Tools → Command Palette…). Most presets give select_same_extension no key; see Keys.

Patterns

A pattern is written exactly as for Filter (View → Filter…):

Case does not matter: *.jpg also picks IMG_0001.JPG. A pattern that would show some files under Filter selects those same files here — including on a search-results pane, where a file’s name is its path below the search root, so sub/* selects the hits under sub.

The prompt lists your defined filters and the patterns you used before. That history is shared with Filter: a pattern typed in either is offered in both.

What gets selected

Select same extension

Put the cursor on a file and run select_same_extension: every file in the pane with the same extension is selected, whatever its case — on photo.JPG it picks every .jpg and .JPG. On a file with no extension (README, .bashrc) it selects the other files without one. On a directory it does nothing.

Keys

Each preset puts these actions on its own keys; the Keymap Presets page lists them. A key that is a character, such as ' or ", works the same in the desktop app and in any terminal, whatever the keyboard layout: press whichever key types it (on a Japanese keyboard, Shift-7 for ' and Shift-2 for ").

To change the keys, or give select_same_extension one, set them in config.py:

KEY_BINDINGS = {
    'select_by_pattern': ["'"],
    'unselect_by_pattern': ['"'],
    'select_same_extension': ['Y'],
}

See Key Bindings for the key names.