Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sxyazi/yazi/llms.txt

Use this file to discover all available pages before exploring further.

Yazi provides multiple ways to select files for batch operations.

Quick Selection

Toggle Individual Files

<Space>  # Toggle selection on current file and move to next
This is the fastest way to select multiple files:
  • Moves cursor down automatically after toggling
  • Works in normal mode
  • Can be pressed multiple times rapidly

Visual Mode

Yazi implements Vim-style visual selection with two modes:

Select Mode

v  # Enter visual mode (select mode)
In select mode:
  • Move the cursor with j/k to expand selection
  • Selected files are added to the selection set
  • Use any navigation command to select ranges
1

Enter select mode

Press v on the starting file
2

Expand selection

Use j/k or other navigation keys to select more files
3

Exit visual mode

Press <Esc> to exit and keep the selection

Unset Mode

V  # Enter visual mode (unset mode)
Unset mode works inversely:
  • Files in the range are deselected
  • Useful for removing files from an existing selection
Example workflow:
# Select all files
<C-a>

# Enter unset mode to deselect a range
V
5j  # Deselect 5 files
<Esc>

Select All Operations

Bulk Selection Commands

KeyCommandDescription
<C-a>toggle_all --state=onSelect all files in current directory
<C-r>toggle_allInvert selection (toggle all)
<C-a>  # Select all files
Selects every file in the current directory. Useful for:
  • Batch operations on entire directories
  • Starting point for unset mode to exclude specific files

Visual Mode Details

How Visual Mode Works

Yazi’s visual mode is implemented in /home/daytona/workspace/source/yazi-core/src/tab/mode.rs:7:
  • Select mode: Mode::Select(start, indices) - Adds files to selection
  • Unset mode: Mode::Unset(start, indices) - Removes files from selection
  • Normal mode: Mode::Normal - Standard navigation

Exiting Visual Mode

<Esc>  # Exit visual mode and keep selection
<C-[>  # Alternative: Exit visual mode
The selection persists after exiting visual mode, allowing you to:
  • Navigate to other directories
  • Perform operations on the selected files
  • Add more files to the selection later

Cross-Directory Selection

One of Yazi’s powerful features is the ability to select files across multiple directories:
1

Select files in first directory

<Space>  # Toggle selection on files
2

Navigate to another directory

l  # Enter subdirectory
# or
cd /another/path
3

Select more files

<Space>  # Add more files to selection
4

Perform operation

y  # Yank all selected files
p  # Paste in destination
Selected files remain in the selection set even when you navigate away from their directory. This enables complex multi-directory operations.

Selection Indicators

Visual Feedback

Yazi provides clear visual indicators for selection state:
StateIndicatorDescription
SelectedHighlightedFile is in the selection set
Visual modeDifferent colorVisual mode is active
CursorBright highlightCurrent cursor position

Practical Examples

Example 1: Select Specific File Types

# Select all .txt files
f        # Start filter
*.txt    # Filter pattern
<C-a>    # Select all filtered results
<Esc>    # Clear filter (selection persists)

Example 2: Select All Except Few Files

<C-a>    # Select all files
V        # Enter unset mode
3j       # Deselect first 3 files
<Esc>    # Exit visual mode

Example 3: Multi-Directory Batch Move

# In /source/dir1
<Space>  # Select file1
<Space>  # Select file2

# Navigate to another directory
gh       # Go home
l        # Enter another directory
<Space>  # Select file3

# Now move all selected files
x        # Cut all selected files
cd /destination
p        # Paste all files from both directories

Clearing Selection

<Esc>  # Clear selection (when not in visual mode)
The escape key has multiple functions depending on context:
  • In visual mode: Exit visual mode (keep selection)
  • In normal mode: Clear all selections
  • During search: Cancel search

Working with Selected Files

Once files are selected, you can perform any file operation:
  • Yank/Cut: y or x
  • Delete: d or D
  • Open: o or O
  • Shell command: ; or :
All operations apply to the entire selection set, regardless of which directory the files are in.

Build docs developers (and LLMs) love