Scripts2026年4月15日·1 分钟阅读

nnn — n³ The Fastest Terminal File Manager Ever Written

nnn is a full-featured, ultra-fast, zero-config terminal file manager written in C, with a plugin ecosystem, type-to-nav, mounting, disk usage analysis, and batch renaming.

Introduction

nnn (n-cubed) is a blazing-fast, text-mode file manager that renders in under 16ms, fits in ~300KB, and leverages native OS shells for operations. Unlike heavier TUIs that ship their own mini-shell, nnn trusts your cp, mv, trash-cli and stays out of the way. A thriving plugin repo bolts on previews, git, archivers, and media.

What nnn Does

  • Navigates filesystems with vim-style keys.
  • Displays disk usage, permissions, git status, mount points.
  • Mounts/unmounts archives, cloud drives (via rclone), remote shells.
  • Batch-renames via $EDITOR.
  • Plugin system: press ; or ! and pick a shell script.

Architecture Overview

nnn is a single C binary using ncurses. Operations delegate to POSIX tools over fork/exec. A context ring (up to 8 contexts) keeps multiple directories active. The plugin bridge writes a FIFO with selections so plugins can pipe selections into tools like rsync, zip, or ffmpeg.

Self-Hosting & Configuration

  • Install via brew, apt, dnf, pacman, pkg.
  • Config via env vars: NNN_PLUG, NNN_OPENER, NNN_FIFO, NNN_COLORS.
  • Plugin installer: curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | sh.
  • NNN_BMS="d:~/dev;s:~/sync" bookmarks.
  • NNN_TRASH=1 uses trash-cli for recoverable deletes.

Key Features

  • Sub-100ms startup.
  • Context tabs — 8 directories, one keystroke apart.
  • Mount archives & cloud remotes inline.
  • Detail mode shows size, mtime, perms, git.
  • Plugin ecosystem for preview, batch ops, media.

Comparison with Similar Tools

  • ranger — Python, more features, slower startup.
  • lf — Go, minimal, config in a DSL; very close to nnn.
  • vifm — vim-like bindings; heavier.
  • mc (Midnight Commander) — classic two-pane; not as fast.
  • yazi — newer Rust alternative with async previews.

FAQ

Q: Is there image preview? A: Via plugin with kitty/iterm2/Ueberzug.

Q: Tab/context difference? A: Contexts are persistent tabs, preserved across sessions.

Q: Where do settings live? A: Env vars in shell rc; no config file by design.

Q: Trash? A: NNN_TRASH=1 (trash-cli) or 2 (gio trash).

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产