# File & Buffer Management
Tuim provides straightforward file exploration, buffer switching, and project-wide searching. Even in environments where third-party plugins are disabled or unavailable, Tuim's built-in buffer controls keep you productive.
---
## 1. File Explorer
Open the Explorer by clicking **Explorer** in the sidebar or via the F1 command palette:
* **Navigating the Tree**: Use ↑ / ↓ or j / k to move between files and directories.
* **Expanding / Collapsing**: Press Enter or click a folder to toggle its contents.
* **Opening a File**: Press Enter or click a file to load it into the active editor split.
* **Collapsing the Sidebar**: Press Ctrl+E (or Alt+E in the Vim-safe preset) to toggle the sidebar view.
---
## 2. Creating New Files
You can create a new file from any editing mode:
1. Press Ctrl+N (or open F1 → **New file**).
> [!NOTE]
> When the bottom terminal panel is focused, Ctrl+N is passed to the shell/terminal mode. To create a file while in the terminal, use F1 → **New file** or switch focus with F6.
2. Begin typing immediately.
3. On the first save (Ctrl+S), Tuim presents a prompt:
```
Save file as: [src/utils.zig ]
(Enter to save, Esc to cancel)
```
4. Enter the filename or relative path and press Enter.
5. Pressing Esc cancels the naming prompt safely without discarding any typed text.
---
## 3. Switching & Managing Buffers
### Switch Buffers
Tuim includes a native, plugin-independent **Switch buffers** dialog:
* Open F1 → **Switch buffers**.
* Displays all open buffers, their relative paths, active/inactive state, and modification markers (`[+]`).
* Fuzzy filter buffers by typing.
* Use arrows and Enter to jump to the selected buffer.
* Works in Zen mode, narrow terminals, and recovery mode without requiring Telescope.
### Close Buffer
* Open F1 → **Close buffer**.
* Closes the active buffer. If the buffer has unsaved changes, Tuim prompts you to save or discard before closing.
---
## 4. Project Search with Telescope & Ripgrep
Tuim integrates Telescope and ripgrep for lightning-fast project navigation:
### Find Files
* Press Ctrl+P or ` f f`.
* Type any part of a file path to fuzzy search across the workspace.
* Results display the filename first followed by its parent directory path.
* Preview panel appears on wide terminals, showing the file content at your cursor.
### Live Grep (Search in Files)
* Press Alt+G or ` f g`.
* Search text across the entire repository using ripgrep.
* Jump directly to matching lines and columns.
### Telescope Picker Controls
| Shortcut | Action |
| :--- | :--- |
| Ctrl+N / Ctrl+P | Move to next / previous search result |
| Enter | Open selected result in editor |
| Tab | Multi-select / mark entry |
| Alt+P | Toggle preview window |
| Esc | Close picker immediately (single press) |
---
## Next Steps
Learn how to interact with the shell and copy terminal text in **[Integrated Terminal](Integrated-Terminal.md)**.