Moon Commander is a modern, Rust-based terminal file manager designed for efficiency and speed. It features a classic dual-pane interface, robust file operations, and a built-in text editor with syntax highlighting.
- Dual-Pane Interface: Navigate two directories simultaneously for easy file management.
- File Operations:
- Copy (F5): Copy files and directories (recursive).
- Move (F6): Move and rename files and directories.
- Mkdir (F7): Create new directories.
- Delete (F8): Delete files and directories.
- New File (F2): Create empty files.
- Built-in Editor (F4):
- Syntax highlighting for major languages.
- Undo/Redo support (Ctrl+U/Z, Ctrl+Y).
- Line operations (Insert, Delete).
- Modal interface (Exit with ESC).
- Navigation:
- Arrow keys for movement.
- PageUp/PageDown for fast scrolling.
- Enter to open directories or edit files.
- Backspace to go to parent directory.
- Tab to switch panels.
- Modal Dialogs: Interactive dialogs for all major operations.
The codebase is organized into modular components:
src/app/: Core application logic and state management.mod.rs: Main event loop and application entry point.state.rs: Manages global application state (panels, dialogs, etc.).events.rs: Event definitions and handling.config.rs: Configuration management.
src/filesystem/: File system abstraction and operations.operations.rs: Implementation of Copy, Move, Delete, Create.entries.rs: File entry definitions.watcher.rs: File system monitoring.
src/editor/: The built-in text editor.editor.rs: Main editor logic and event handling.editor_state.rs: Manages text content, cursor, and history.syntax.rs: Syntax highlighting implementation.version_history.rs: Undo/Redo stack implementation.
src/ui/: User interface rendering usingratatui.layout.rs: Main layout definition.components/: Reusable UI components (Panel, Dialog).
src/utils/: Utility functions (error handling, path manipulation).
- Rust (latest stable version)
- Cargo
Clone the repository:
git clone https://github.com/yourusername/moon-commander.git
cd moon-commanderRun the application using Cargo:
cargo run| Key | Action |
|---|---|
| F1 | Help |
| F2 | New File |
| F4 | Edit File |
| F5 | Copy |
| F6 | Move |
| F7 | Make Directory |
| F8 | Delete |
| F10 | Quit |
| Tab | Switch Panel |
| Esc | Close Dialog / Exit Editor |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.