# Explore - A Terminal File Explorer ## Overview Explore is a terminal-based file explorer built with Rust and `ratatui` ## Features - **Directory Navigation**: Easily navigate through directories using Vim-style key bindings. - **File Preview**: Preview the contents of text files with syntax highlighting and view images directly in the terminal. - **Toggleable Preview Pane**: Enable or disable the preview pane with a simple key press. ## Key Bindings - `j` / `Down Arrow`: Move down in the file list. - `k` / `Up Arrow`: Move up in the file list. - `l` / `Right Arrow` / `Enter`: Enter a directory or open a file preview. - `h` / `Left Arrow` / `Backspace`: Go back to the parent directory. - `p`: Toggle the preview pane. - `q` / `Esc`: Exit the application. ## Installation ### Using Cargo If you have Cargo installed, you can install `explore` directly from [crates.io](https://crates.io/): 1. Install `explore`: ```sh cargo install explore ``` 2. Run the application: ```sh explore ``` ### Build from Source ### Prerequisites - [Rust](https://www.rust-lang.org/tools/install) ### Steps 1. Clone the repository: ```sh git clone https://github.com/nathanroark/explore.git cd explore ``` 2. Build the project: ```sh cargo build --release ``` 3. Run the application: ```sh cargo run ``` ## Usage Use the key bindings to navigate through your file system. When the preview pane is enabled, you can see the contents of the selected file directly in the terminal. The preview supports syntax highlighting for code files and can display images. ## File Structure - `src/` - `main.rs`: Entry point of the application. - `app.rs`: Contains the main application logic, including event handling and rendering. - `tui.rs`: Handles terminal initialization and restoration. - `ui.rs`: Contains functions to render the file list and other UI components. - `preview.rs`: Manages the preview functionality, including syntax highlighting and image rendering. ## Dependencies - [`ratatui`](https://crates.io/crates/ratatui) for terminal UI. - [`syntect`](https://crates.io/crates/syntect) for syntax highlighting. - [`image`](https://crates.io/crates/image) for image decoding and rendering. - [`color-eyre`](https://crates.io/crates/color-eyre) for error handling. ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. ## Acknowledgements - [ratatui](https://github.com/ratatui/ratatui) terminal UI - [syntect](https://github.com/trishume/syntect) syntax highlighting - [image](https://github.com/image-rs/image) image processing.