# REX â Terminal File Manager
> ⥠A Vim-inspired, blazing-fast TUI file manager built in Rust.




---
## đ Version 2 is Coming
> **REX v2 is currently in active development and will be launching soon.**
Version 2 is a major leap forward â the goal is to make REX a **true daily-driver file manager** that you can replace Nautilus, Thunar, or any other GUI file manager with, right from your terminal.
**What's planned for v2:**
- đĨ Major performance overhaul â even faster rendering and directory scans
- đ¨ Redesigned UI with better visual hierarchy and themes
- đ Dual-pane mode
- đ Bookmarks / pinned directories
- đĨī¸ macOS and Windows support *(Linux-only as of v1 â cross-platform is on the roadmap)*
- And much more...
If you find REX useful, star the repo and watch for the v2 release!
---
## What is REX?
REX is a keyboard-driven terminal file manager **inspired by Vim**. If you've used Vim, you'll feel right at home â `hjkl` to navigate, modal-style interactions, and zero mouse dependency. It's lightweight, fast, and stays out of your way.
It's built with [Rust](https://www.rust-lang.org/) and [ratatui](https://github.com/ratatui-org/ratatui), which means it starts instantly, uses almost no memory, and never lags.
> **Linux only as of now.** macOS and Windows support is planned for a future release.
---
## Features
| ⥠| **Zero-lag navigation** â dirty-flag rendering, async previews, cached `stat` calls |
| đ | **Fast search** â `/` local, `g` global (via `fd`), fully async with per-keystroke cancellation |
| âī¸ | **Inline rename** â press `r`, edit with arrow keys, confirm with Enter |
| âšī¸ | **File info popup** â press `i` for name, size, type, permissions, modified date, full path |
| đ | **Multi-select** â `Space` to toggle, `A` to select all, then batch copy/cut/delete |
| đī¸ | **Open With** â `o` opens with configured app, `O` shows a picker popup |
| âī¸ | **JSON config** â map any extension to any app in `~/.config/rex/config.json` |
| đī¸ | **Trash support** â delete sends to trash, `u` to undo |
| đ | **Built-in help** â press `?` anytime |
---
## Install
```bash
# Clone the repo
git clone https://github.com/gaurav13407/REX-File-Manager
cd REX-File-Manager
# Run directly
cargo run
# Or install the binary globally
cargo install --path .
```
> Requires **Rust âĨ 1.70**
```bash
# Install fd for faster search (optional but recommended)
sudo apt install fd-find # Ubuntu / Debian
sudo pacman -S fd # Arch
brew install fd # macOS (future)
# Falls back to system 'find' automatically if fd is not installed
```
---
## Keybinds
### Navigation
| `j` / `k` | Move down / up |
| `h` | Go to parent directory |
| `l` / `Enter` | Enter directory |
| `Tab` | Switch between file list and preview pane |
### File Operations
| `r` | **Rename** â opens popup with arrow-key cursor, pre-filled name |
| `i` | **File info** â popup with size, type, permissions, modified, path |
| `o` | Open file with configured app |
| `O` | Open With popup â choose app, saves as new default |
| `Space` | Toggle select file |
| `A` | Select all files |
| `y` | Copy selected / cursor file |
| `x` | Cut selected / cursor file |
| `p` | Paste |
| `d` | Delete â trash (confirm with `y`) |
| `u` | Undo last operation |
| `Esc` | Clear selection / close popups |
### Search
| `/` | Local search (current directory, depth 5) |
| `g` | Global search (from `/`, depth 8) |
| `j` / `k` | Navigate results |
| `Enter` | Jump to result |
| `Esc` / `q` | Exit search |
### Rename Popup Keys
| `â` / `â` | Move cursor left / right |
| `Home` / `End` | Jump to start / end |
| `Backspace` | Delete character before cursor |
| `Delete` | Delete character at cursor |
| `Enter` | Confirm rename |
| `Esc` | Cancel |
### General
| `?` | Toggle help popup |
| `q` | Quit |
---
## Configuration
REX looks for `config.json` in the following order:
1. Next to the binary (for installed builds)
2. Current working directory
3. `~/.config/rex/config.json`
```json
{
"open_with": {
"rs": "nvim",
"md": "nvim",
"pdf": "evince",
"png": "eog",
"mp4": "vlc",
"mp3": "vlc"
}
}
```
- **`o`** opens with the mapped app, or falls back to `xdg-open`
- **`O`** lets you pick from a list and saves the choice back automatically
---
## Architecture
```
src/
âââ main.rs # Event loop, key handling, async search
âââ app.rs # App state (App struct, config, history)
âââ fs/
â âââ navigator.rs # Directory listing with cached is_dir flags
âââ ui/
â âââ layout.rs # Rendering: widgets, popups, icons
âââ utils/
âââ trash.rs # Trash-safe deletion and undo
```
**Performance design:**
- Async preview via `mpsc::channel` â never blocks the event loop
- Search runs `fd` in a background thread with `AtomicBool` cancellation
- `needs_draw` dirty flag â zero redundant redraws
- Zero `stat()` syscalls during render â `is_dir` cached at directory load time
---
## Dependencies
| `ratatui` | TUI rendering |
| `crossterm` | Terminal backend & input |
| `notify` | Filesystem watcher (live refresh) |
| `serde` + `serde_json` | Config file serialization |
| `dirs` | Home directory resolution |
---
## Platform Support
| đ§ Linux | â
Fully supported |
| đ macOS | đ Planned (v2) |
| đĒ Windows | đ Planned (v2) |
---
## License
MIT â do whatever you want with it.
---
<p align="center">
Built with â¤ī¸ and Rust | Vim-inspired | Stay in the terminal
</p>