文章

Yazi

用Yazi在終端內管理檔案

安裝

Archlinux安裝

1
2
3
4
5
6
7
8
9
sudo pacman -S yazi ffmpeg p7zip jq poppler fd ripgrep fzf zoxide imagemagick ttf-nerd-fonts-symbols ttf-nerd-fonts-symbols-common nano
yazi --version
if [ $? -eq 0 ]; then
    echo "export EDITOR=nano" >> ~/.bashrc
    source ~/.bashrc
    echo "include /usr/share/nano/*.nanorc" >> ~/.nanorc
    clear
    yazi --version
fi

在Ubuntu安裝

因為yazi還沒被收錄到Ubuntu的倉庫,所以要從crates.io來安裝。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sudo apt update && sudo apt upgrade -y

# Install required and optional dependencies
sudo apt install -y file fonts-noto-color-emoji ffmpeg p7zip-full jq poppler-utils fd-find ripgrep fzf zoxide imagemagick xclip xsel wl-clipboard nano

# Install the compilation program
sudo apt install -y git cargo make gcc

# Install to the latest Rust stable version
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup update

# install Yazi
cargo install --locked yazi-fm yazi-cli

# Verify that the installation was successful
yazi --version
if [ $? -eq 0 ]; then
    echo "export EDITOR=nano" >> ~/.bashrc
    source ~/.bashrc
    echo "include /usr/share/nano/*.nanorc" >> ~/.nanorc
    clear
    yazi --version
fi

操作方式

Yazi的官網看吧!

解除安裝

在Ubuntu解除安裝

1
2
3
4
5
6
7
# Removed the PATH change used for Yazi in bashrc
sed -i '/export PATH=\$PATH:~\/.cargo\/bin\/yazi/d' ~/.bashrc
export PATH=$(echo $PATH | tr ':' '\n' | grep -v '~/.cargo/bin/yazi' | paste -sd ':')
source ~/.bashrc

# Delete Yazi
cargo uninstall --locked yazi-fm yazi-cli
本文章以 CC BY 4.0 授權