diff --git a/README.md b/README.md index 71e9800..1d5fed6 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ The following tools must be installed on your system: | git | any | Plugin management (vim-plug) | | gcc / clang | any | Compile LeaderF C extension | | ripgrep (rg) | any | Fuzzy search (LeaderF) | +| [yazi](https://github.com/sxyazi/yazi) | any | Terminal file manager (tfm.nvim, `t`) | | ctags / gtags | any | Code navigation (optional) | ### ⚠️ Critical: Install pynvim (most commonly forgotten) @@ -42,7 +43,7 @@ Without this step, LeaderF will refuse to load with the error: ## Quick Start: One-click Install -The `install.sh` script auto-detects your OS (Ubuntu/Debian or macOS) and bootstraps everything: Neovim binary, clangd, config symlink, vim-plug, plugins, tree-sitter parsers, and coc extensions. It is idempotent — safe to re-run. +The `install.sh` script auto-detects your OS (Ubuntu/Debian or macOS) and bootstraps everything: Neovim binary, clangd, config symlink, vim-plug, plugins, tree-sitter parsers, coc extensions, and yazi. It is idempotent — safe to re-run. ```bash git clone https://github.com/your-username/nvide.git ~/nvide diff --git a/install.sh b/install.sh index ba7b345..67364dc 100755 --- a/install.sh +++ b/install.sh @@ -284,6 +284,45 @@ install_coc_exts() { info "coc extensions installed: ${COC_EXTS[*]}" } +install_yazi() { + step 10 "yazi (terminal file manager, used by tfm.nvim t)" + if have yazi; then + info "skip: yazi already in PATH" + return + fi + if ! have cargo; then + warn "cargo not found — skipping yazi. Install Rust via rustup, then re-run (or install yazi manually)." + return + fi + # cargo-binstall fetches prebuilt binaries — far faster than building yazi from source. + if ! have cargo-binstall; then + info "installing cargo-binstall (prebuilt)" + curl -L --proto '=https' --tlsv1.2 -sSf \ + https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \ + | bash >/dev/null 2>&1 || { + warn "cargo-binstall install failed — skipping yazi (non-fatal)" + return + } + fi + # Prebuilt GNU build needs GLIBC_2.39 (absent on Ubuntu 22.04); force the musl + # static build on Linux so it runs on older glibc. macOS default target is fine. + local binstall_args=(-y) + if [[ "$OS" == "linux" ]]; then + case "$(uname -m)" in + x86_64) binstall_args+=(--target x86_64-unknown-linux-musl) ;; + aarch64 | arm64) binstall_args+=(--target aarch64-unknown-linux-musl) ;; + *) warn "unrecognized arch $(uname -m) — trying default target (may need newer glibc)" ;; + esac + fi + info "cargo binstall yazi-fm yazi-cli (prebuilt)" + if cargo binstall "${binstall_args[@]}" yazi-fm yazi-cli >/dev/null 2>&1; then + info "yazi installed to ~/.cargo/bin/" + warn "ensure ~/.cargo/bin is on PATH (rustup adds it by default)" + else + warn "cargo binstall yazi failed (non-fatal) — install yazi manually" + fi +} + do_install() { info "${C_BOLD}nvide bootstrap ($OS)${C_RESET}" install_nvim @@ -297,7 +336,8 @@ do_install() { install_ts_cli build_parsers install_coc_exts - step "✓" "Done. Open nvim to verify. If nvim/clangd PATH warnings appeared, add them to your shell rc and restart." + install_yazi + step "✓" "Done. Open nvim to verify. If nvim/clangd/yazi PATH warnings appeared, add them to your shell rc and restart." } do_update() { @@ -342,7 +382,7 @@ Usage: ./install.sh Commands: install Full bootstrap: nvim, clangd, config symlink, vim-plug, - plugins, LeaderF, tree-sitter, coc extensions. (default) + plugins, LeaderF, tree-sitter, coc extensions, yazi. (default) update Update plugins (:PlugUpdate), recompile LeaderF, rebuild parsers, update coc extensions. clean Remove plugins no longer declared in init.vim (:PlugClean).