brew install file yazi ffmpegthumbnailer unar jq poppler fd ripgrep fzf zoxide exiftool bat lazygit lazydocker sevenzip imagemagick font-symbols-only-nerd-font ripgrep-all mediainfo glow ezaecho 'export PATH="/opt/homebrew/opt/file-formula/bin:$PATH"' >> ~/.zshrcmv ~/.config/yazi ~/.config/yazi.bak
git clone --depth 1 https://github.com/chaozwn/yazi.git ~/.config/yazizsh/bash
function ff() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}# Add the plugin
ya pack -a lpnh/fg
# Install the plugin
ya pack -i
# Upgrade the plugin
ya pack -uadd to
.zshrc
eval "$(zoxide init zsh)"export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--highlight-line \
--info=inline-right \
--ansi \
--layout=reverse \
--border=none
--color=bg+:#2d3f76 \
--color=bg:#1e2030 \
--color=border:#589ed7 \
--color=fg:#c8d3f5 \
--color=gutter:#1e2030 \
--color=header:#ff966c \
--color=hl+:#65bcff \
--color=hl:#65bcff \
--color=info:#545c7e \
--color=marker:#ff007c \
--color=pointer:#ff007c \
--color=prompt:#65bcff \
--color=query:#c8d3f5:regular \
--color=scrollbar:#589ed7 \
--color=separator:#ff966c \
--color=spinner:#ff007c \
"add to
.zshrc
# 默认显示 icons:
alias ls="eza --icons"
# 显示文件目录详情
alias ll="eza --icons --long --header"
# 显示全部文件目录,包括隐藏文件
alias la="eza --icons --long --header --all"
# 显示详情的同时,附带 git 状态信息
alias lg="eza --icons --long --header --all --git"
# 替换 tree 命令
alias lt="eza --tree -L 2 --icons"
eval "$(zoxide init zsh)":::tip
For all keybindings, see the default keymap.toml file.
:::
To navigate between files and directories you can use the arrow keys ←, ↓, ↑ and → or Vim-like keys such as h, j, k, l:
| Key binding | Alternate key | Action |
|---|---|---|
| k | ↑ | Move the cursor up |
| j | ↓ | Move the cursor down |
| l | → | Enter hovered directory |
| h | ← | Leave the current directory and into its parent |
Further navigation commands can be found in the table below.
| Key binding | Action |
|---|---|
| K | Move the cursor up 5 lines |
| J | Move the cursor down 5 lines |
| g ⇒ g | Move cursor to the top |
| G | Move cursor to the bottom |
To select files and directories, the following commands are available.
| Key binding | Action |
|---|---|
| Space | Toggle selection of hovered file/directory |
| v | Enter visual mode (selection mode) |
| V | Enter visual mode (unset mode) |
| Ctrl + a | Select all files |
| Ctrl + r | Inverse selection of all files |
| Esc | Cancel selection |
To interact with selected files/directories use any of the commands below.
| Key binding | Action |
|---|---|
| o | Open the selected files |
| O | Open the selected files interactively |
| Enter | Open the selected files |
| Ctrl + Enter | Open the selected files interactively (some terminals don't support it yet) |
| y | Yank the selected files (copy) |
| x | Yank the selected files (cut) |
| p | Paste the yanked files |
| P | Paste the yanked files (overwrite if the destination exists) |
| Y or X | Cancel the yank state (unyank) |
| - | Create a symbolic link to the yanked files (absolute path) |
| _ | Create a symbolic link to the yanked files (relative path) |
| d | Move the files to the trash |
| D | Permanently delete the files |
| a | Create a file or directory (ends with "/" for directories) |
| r | Rename a file or directory |
| ; | Run a shell command |
| : | Run a shell command (block the UI until the command finishes) |
| . | Toggle the visibility of hidden files |
| Ctrl + s | Cancel the ongoing search |
| z | Jump to a directory using zoxide |
| Z | Jump to a directory, or reveal a file using fzf |