Yazi is a very fast terminal file manager written in Rust, with a three column Miller layout (parent / current / preview).

Start it with:

yazi

Press q to quit, F1 or ~ to open the help menu.

Shell Wrapper

The recommended y shell wrapper changes the working directory of your shell when you quit Yazi. Add this to your ~/.zshrc or ~/.bashrc:

function y() {
    local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
    command yazi "$@" --cwd-file="$tmp"
    IFS= read -r -d '' cwd < "$tmp"
    [ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd"
    rm -f -- "$tmp"
}

Then use y to start Yazi. Press q to quit and cd into the last directory, or Q to quit without changing directory.


Shortcuts

KeyAction
h / Leave current directory (go to parent)
j / Move cursor down
k / Move cursor up
l / Enter hovered directory
ggMove cursor to the top
GMove cursor to the bottom
KSeek up 5 units in the preview
JSeek down 5 units in the preview
zCd to a directory or reveal a file via fzf
ZCd to a directory via zoxide
gSpaceCd to a directory or reveal a file via interactive prompt
TabShow file information (spotter)

Selection

KeyAction
SpaceToggle selection of hovered file/directory
vEnter visual mode (selection mode)
VEnter visual mode (unset mode)
Ctrl + aSelect all files
Ctrl + rInverse selection of all files
EscCancel selection

File Operations

KeyAction
o / EnterOpen selected files
O / Shift + EnterOpen selected files interactively
yYank selected files (copy)
xYank selected files (cut)
pPaste yanked files
PPaste yanked files (overwrite if destination exists)
Y or XCancel the yank status
dTrash selected files
DPermanently delete selected files
aCreate a file (end name with / to create a directory)
rRename selected file(s)
.Toggle the visibility of hidden files
;Run a shell command
:Run a shell command (block until it finishes)
-Symlink the absolute path of yanked files
_Symlink the relative path of yanked files
Ctrl + -Hardlink yanked files

Copy Paths

cd means: press c, then press d.

KeyAction
ccCopy the file path
cdCopy the directory path
cfCopy the filename
cnCopy the filename without extension
KeyAction
fFilter files in the current directory
/Find next file (incremental)
?Find previous file (incremental)
nGo to the next found
NGo to the previous found
sSearch files by name using fd
SSearch files by content using ripgrep
Ctrl + sCancel the ongoing search

Sorting

,a means: press ,, then press a.

KeyAction
,mSort by modified time
,MSort by modified time (reverse)
,bSort by birth time
,BSort by birth time (reverse)
,eSort by file extension
,ESort by file extension (reverse)
,aSort alphabetically
,ASort alphabetically (reverse)
,nSort naturally
,NSort naturally (reverse)
,sSort by size
,SSort by size (reverse)
,rSort randomly

Tabs

KeyAction
tCreate a new tab with CWD
1 to 9Switch to the matching numbered tab
[Switch to the previous tab
]Switch to the next tab
{Swap current tab with previous tab
}Swap current tab with next tab
Ctrl + cClose the current tab

Configuration Tips

Yazi’s keybindings are configured in ~/.config/yazi/keymap.toml. You can use prepend_keymap for higher priority or append_keymap for lower priority than the defaults.

Bookmarks via g keys

[[mgr.prepend_keymap]]
on   = [ "g", "d" ]
run  = "cd ~/Downloads"
desc = "Cd to ~/Downloads"
 
[[mgr.prepend_keymap]]
on   = [ "g", "p" ]
run  = "cd ~/Pictures"
desc = "Cd to ~/Pictures"

Disable a default keybinding

[[mgr.prepend_keymap]]
on  = [ "g", "c" ]
run = "noop"

Reference: Official Yazi Quick Start · Keymap Reference


(y) Return to Notes | (y) Return to CLI & Tools | (y) Return to Home