午夜船长 – 一个受午夜指挥官启发的的文件管理器
Midnight Captain – A midnight commander inspired file manager

原始链接: https://github.com/duguyue100/midnight-captain

## 午夜船长:一款可定制的终端文件管理器 午夜船长是一款新的终端文件管理器,灵感来自 Midnight Commander 和 NVim-Tree,并专注于定制化。作者创建它是为了解决现有工具的局限性,并实现个性化的 Vim 体验。 主要功能包括双面板界面、树形目录展开、丰富的 Vim 键绑定(j/k 用于导航,gg/G 用于顶部/底部)、可视化选择用于多文件操作,以及标准文件管理操作(复制、移动、删除、重命名)。它还提供智能文件/目录创建、模糊搜索、命令面板以及 SSH/SFTP 支持,用于远程文件浏览。 目前,该项目是一个“氛围编码”的个人项目,这意味着不接受拉取请求,但欢迎提交问题报告和分支。安装通过 macOS/Linux 的一键命令或使用 Go 1.22+ 从源代码构建非常简单。它设计用于与支持 Nerd Fonts 的终端一起使用,以获得最佳图标显示效果。

## 午夜船长:一款新的终端文件管理器 一位开发者,duguyue100,创建了“午夜船长”,一款受经典Midnight Commander (mc) 启发的终端文件管理器。由于对mc中未使用的功能和难以定制的Vim绑定感到沮丧,开发者使用OpenCode构建了自己的版本。 午夜船长旨在复制mc高效的双面板设计,同时融入NVim-Tree文件浏览器的行为。创建者强调这是一个个人项目,不会接受拉取请求,但欢迎问题报告和分支。 早期的评论者呼应了替换mc的困难,认为它的速度和根深蒂固的双面板工作流程难以取代。一位用户对午夜船长更好的Vim集成潜力特别感兴趣,并正在测试它处理大型目录的性能。另一位用户则只是表达了尝试它并提供反馈的兴趣。
相关文章

原文
Gemini_Generated_Image_618bk5618bk5618b

Midnight Commander has always been my favorite terminal file manager. It's feature-rich, fast, and actually tries to be a file manager compared to modern alternatives. However, there are quite some features that I never used, and I couldn't configure a Vim bindings that works well for me.

With OpenCode, I can finally make my own terminal file manager. I borrowed the main design concepts from Midnight Commander and some behavior from NVim-Tree file explorer.

I hope you would like it, at least I do. Since this project is entirely vibe-coded, so I'm not going to accept PR from the community, but feel free to open issues and fork it.

  • Dual pane — navigate two directories side by side, copy/move between them
  • Tree expand — expand/collapse directories inline with l/h, nerd font icons
  • Vim keybindingsj/k/h/l, gg/G, ctrl+d/ctrl+u
  • Visual selection — select ranges with V, operate on multiple files at once
  • File operations — copy, cut, paste, delete (with confirmation), rename
  • Smart createa creates a file or directory (trailing / = dir, nested paths supported)
  • Fuzzy searchspace opens fuzzy search in current dir; :find searches recursively
  • Command palette: opens a command prompt for power-user actions
  • Goto:goto <path> with live directory listing, tab-complete, and ~ expansion
  • SSH — browse and operate on remote servers over SFTP via :ssh user@host
  • Nerd font icons — file type icons, open/closed folder glyphs
  • TokyoNight theme — easy on the eyes
image
  • A terminal with Nerd Fonts support (recommended: JetBrainsMono Nerd Font, FiraCode Nerd Font)
  • macOS or Linux

One-liner (macOS and Linux)

curl -fsSL https://raw.githubusercontent.com/duguyue100/midnight-captain/main/install.sh | bash

Downloads the correct pre-built binary for your OS and architecture from the latest GitHub Release and places it at ~/.local/bin/mc. If ~/.local/bin is not in your $PATH, the installer will tell you what to add.

Build from source (local)

Requires Go 1.22+.

git clone https://github.com/duguyue100/midnight-captain
cd midnight-captain
./install.sh --local-build

Runs make build and copies bin/mc to ~/.local/bin/mc.

make build   # binary at bin/mc
./bin/mc

Launches in the current directory with dual panes.


Key Action
j / k Move cursor down / up
ctrl+d / ctrl+u Half-page down / up
gg Jump to top
G Jump to bottom
tab Switch active pane
h Collapse directory or jump to parent
l / enter Expand directory inline
o Navigate into directory (change cwd)
. Toggle hidden files
Key Action
V Visual select mode — move to extend selection
esc Cancel / clear selection
Key Action
a Smart create — trailing / = dir, nested paths supported
r Rename current file
y Yank (copy) to clipboard
d Cut to clipboard
p Paste into active pane
x Delete (prompts for confirmation)
e Open in nvim
Key Action
space Fuzzy search in current directory
: Open command palette
? Show help overlay
q Quit

Open with :, then type a command.

Command Description
:ssh user@host Connect to remote server (SFTP) in active pane
:disconnect Disconnect SSH, return to local filesystem
:goto <path> Jump to path with live completion
:find Recursive fuzzy search from current directory
:sort name|size|date Change sort order
:hidden Toggle hidden files
:quit Exit
联系我们 contact @ memedata.com