duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. ยท GitHub

๐Ÿ”ฅ Explore this awesome post from Hacker News ๐Ÿ“–

๐Ÿ“‚ **Category**:

โœ… **What Youโ€™ll Learn**:

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 keybindings โ€” j/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 create โ€” a creates a file or directory (trailing / = dir, nested paths supported)
  • Fuzzy search โ€” space opens fuzzy search in current dir; :find searches recursively
  • Command palette โ€” : opens a command prompt for power-user actions
  • Goto โ€” :goto 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 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

๐Ÿ’ฌ **Whatโ€™s your take?**
Share your thoughts in the comments below!

#๏ธโƒฃ **#duguyue100midnightcaptain #Inspired #Midnight #Commander #tailored #taste #GitHub**

๐Ÿ•’ **Posted on**: 1775957791

๐ŸŒŸ **Want more?** Click here for more info! ๐ŸŒŸ

By

Leave a Reply

Your email address will not be published. Required fields are marked *