메뉴
HN
Hacker News 49일 전

미드나잇 캡틴: 영감을 받은 터미널 파일 매니저

IMP
6/10
핵심 요약

개발자가 Midnight Commander와 NVim-Tree의 장점을 결합하여 Vim 키바인딩과 듀얼 패인을 지원하는 새로운 터미널 파일 매니저 'Midnight Captain'을 공개했습니다. OpenCode를 활용해 개발되었으며, 로컬 파일 탐색뿐만 아니라 SFTP를 통한 원격 서버 접속 및 퍼지 검색(Fuzzy search) 등 강력한 기능을 제공합니다. 설치는 간단한 원라인 명령어로 가능하며, macOS와 Linux 환경을 지원합니다.

번역된 본문

들어가며 미드나잇 커맨더(Midnight Commander)는 항상 내가 가장 좋아하던 터미널 파일 매니저였습니다. 기능이 풍부하고, 빠르며, 최신 대안들과 비교해도 진정한 파일 매니저로서의 역할에 충실하려 노력합니다. 하지만 내가 전혀 사용하지 않는 기능들도 꽤 있었고, 나에게 잘 맞는 Vim 키바인딩(Vim bindings)을 설정할 수 없었습니다. OpenCode 덕분에 마침내 나만의 터미널 파일 매니저를 만들게 되었습니다. 나는 미드나잇 커맨더의 주요 디자인 개념과 NVim-Tree 파일 탐색기의 일부 동작을 차용했습니다. 여러분도 이 프로젝트를 좋아해 주길 바라며, 적어도 나는 확실히 마음에 듭니다. 이 프로젝트는 완전히 '바이브 코딩(vibe-coded)' 방식으로 작성되었기 때문에 커뮤니티로부터 PR(Pull Request)은 받지 않을 예정입니다. 하지만 자유롭게 이슈를 열거나 포크(Fork)하셔도 됩니다.

주요 기능

  • 듀얼 패인(Dual pane) — 두 디렉토리를 나란히 탐색하며 양쪽 간에 복사/이동 가능
  • 트리 확장(Tree expand) — l / h 키로 디렉토리를 인라인으로 확장/축소, Nerd 폰트 아이콘 지원
  • Vim 키바인딩(Vim keybindings) — j / k / h / l , gg / G , ctrl+d / ctrl+u 지원
  • 비주얼 선택(Visual selection) — V 키로 범위를 선택하고, 여러 파일에 대해 한 번에 작업 수행
  • 파일 작업(File operations) — 복사, 잘라내기, 붙여넣기, 삭제(확인 메시지 포함), 이름 변경
  • 스마트 생성(Smart create) — a 키로 파일 또는 디렉토리 생성 (경로 끝에 / 를 붙이면 디렉토리, 중첩 경로 지원)
  • 퍼지 검색(Fuzzy search) — 스페이스 키로 현재 디렉토리에서 퍼지 검색 열기; :find 로 재귀적 검색
  • 명령어 팔레트(Command palette) — : 키를 눌러 파워 유저용 명령 프롬프트 열기
  • 이동(Goto) — :goto 명령으로 실시간 디렉토리 목록 보기, 탭 자동완성 및 ~ 경로 확장 지원
  • SSH — :ssh user@host 명령으로 SFTP를 통해 원격 서버를 탐색하고 작업 수행
  • Nerd 폰트 아이콘(Nerd font icons) — 파일 유형 아이콘, 열림/닫힘 폴더 글리프 지원
  • TokyoNight 테마 — 눈에 편안한 테마 제공

스크린샷 및 요구 사항

  • Nerd Fonts를 지원하는 터미널 필요 (추천: JetBrainsMono Nerd Font, FiraCode Nerd Font)
  • macOS 또는 Linux 환경

설치 방법 한 줄 설치 (macOS 및 Linux) curl -fsSL https://raw.githubusercontent.com/duguyue100/midnight-captain/main/install.sh | bash 최신 GitHub Release에서 사용 중인 OS 및 아키텍처에 맞는 사전 빌드된 바이너리를 다운로드하여 ~/.local/bin/mc 에 배치합니다. 만약 ~/.local/bin 이 $PATH 에 포함되어 있지 않다면, 설치 프로그램이 추가해야 할 내용을 알려줍니다.

소스에서 빌드 (로컬) Go 1.22+ 버전이 필요합니다. git clone https://github.com/duguyue100/midnight-captain cd midnight-captain ./install.sh --local-build make build 를 실행하고 bin/mc 를 ~/.local/bin/mc 로 복사합니다.

수동 빌드 make build # binary at bin/mc ./bin/mc

사용법 mc 현재 디렉토리에서 듀얼 패인으로 실행됩니다.

키바인딩 탐색

  • j / k : 커서를 아래 / 위로 이동
  • ctrl+d / ctrl+u : 반 페이지 아래 / 위로 이동
  • gg : 맨 위로 이동
  • G : 맨 아래로 이동
  • tab : 활성 패인 전환
  • h : 디렉토리 축소 또는 상위 디렉토리로 이동
  • l / enter : 디렉토리를 인라인으로 확장
  • o : 디렉토리 내부로 탐색 (현재 작업 디렉토리 변경)
  • . : 숨김 파일 토글

선택

  • V : 비주얼 선택 모드 — 이동하여 선택 범위 확장
  • esc : 선택 취소 / 선택 해제

파일 작업

  • a : 스마트 생성 — 경로 끝에 / 를 붙이면 디렉토리 생성, 중첩 경로 지원
  • r : 현재 파일 이름 변경
  • y : 클립보드로 복사(Yank)
  • d : 클립보드로 잘라내기
  • p : 활성 패인에 붙여넣기
  • x : 삭제 (확인 메시지 표시)
  • e : nvim으로 열기

검색 및 명령어

  • space : 현재 디렉토리에서 퍼지 검색
  • : : 명령어 팔레트 열기
  • ? : 도움말 오버레이 표시
  • q : 종료

명령어 : 를 눌러 연 다음, 명령어를 입력하세요.

  • :ssh user@host : 활성 패인에서 원격 서버(SFTP)로 연결
  • :disconnect : SSH 연결을 끊고 로컬 파일 시스템으로 돌아가기
  • :goto : 실시간 자동완성으로 지정한 경로로 이동
  • :find : 현재 디렉토리부터 재귀적으로 퍼지 검색
  • :sort name|size|date : 정렬 순서 변경
  • :hidden : 숨김 파일 토글
  • :quit : 종료
원문 보기
원문 보기 (영어)
Preamble 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. Features 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 <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 Screenshot Requirements A terminal with Nerd Fonts support (recommended: JetBrainsMono Nerd Font, FiraCode Nerd Font) macOS or Linux Installation 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 . Manual build make build # binary at bin/mc ./bin/mc Usage mc Launches in the current directory with dual panes. Keybindings Navigation 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 Selection Key Action V Visual select mode — move to extend selection esc Cancel / clear selection File Operations 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 Search & Commands Key Action space Fuzzy search in current directory : Open command palette ? Show help overlay q Quit Commands 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