Skip to main content

File Operations

Bulk Rename Workflow

Yazi supports batch renaming through your $EDITOR. This is the recommended approach for renaming multiple files:

  1. Select files with Space or v
  2. Press r to open the rename buffer in $EDITOR
  3. Edit filenames — one per line — in the editor
  4. Save and quit; Yazi applies the changes

Lines starting with # are ignored. Only modified lines trigger a rename; unchanged lines are left as-is.

Trash vs Permanent Delete

Yazi offers two delete modes:

KeyActionBehavior
dTrashMoves files to the system trash (recoverable)
DPermanent deleteBypasses trash — files are removed immediately
warning

D permanently deletes files. There is no built-in undo. Consider aliasing D to trash if you prefer safety.

Trash location depends on your platform (typically ~/.local/share/Trash on Linux, ~/.Trash on macOS).

Yazi supports creating both symbolic and hard links from yanked files:

CommandDescription
yYank (copy) files
pPaste copied files
PPaste as a symlink
Ctrl+PPaste as a hardlink

For creating relative symlinks (preferred for portability):

# Use the shell command with ln:
:; ln -s --relative "$@"
tip

Relative symlinks work across different mount points and are the standard for dotfile management.

Copy Path Variants

Yazi provides several copy path commands via the c prefix:

KeyCopies
c c (or c p)Full path to file
c dDirname only
c fFilename only
c nName without extension

These copy to the system clipboard, making it easy to construct shell commands in another terminal.

CD Bookmarks with Custom G-Key Bindings

Yazi's g-key system lets you bind directory bookmarks for instant navigation. In keymap.toml:

[manager]
keymap = [
# g then 0-9 to jump to bookmarked directories
{ on = [ "g", "0" ], run = "cd ~/projects", desc = "Go to projects" },
{ on = [ "g", "1" ], run = "cd ~/Downloads", desc = "Go to downloads" },
{ on = [ "g", "2" ], run = "cd ~/Documents", desc = "Go to documents" },
{ on = [ "g", "3" ], run = "cd ~/dotfiles", desc = "Go to dotfiles" },
]

This is faster than typing full paths and works as an instant directory bookmark system.

Peek at Files

Press ~ or F1 for an overlay help screen. Press Space on a file to peek at its content in the preview pane without opening it.