The file tree occupies the left sidebar of the Druk window and gives you a full view of your project at a glance. You can navigate it entirely from the keyboard, use the mouse for clicks and scrolling, create files and folders in-place, and perform cut/copy/paste operations that move files on disk while keeping all open tabs and buffers pointed at their new locations. The tree remembers exactly where you left it — expanded folders, cursor position, and open files are restored every time you reopen the same project.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/letstri/druk/llms.txt
Use this file to discover all available pages before exploring further.
Navigation
PressTab from anywhere in the editor to move focus to the tree. Press Esc to return to the editor. The mouse works throughout: click any row to select it, click a folder to expand or collapse it, and drag the divider between the sidebar and editor to resize.
| Key | Action |
|---|---|
↑ / ↓ | Move the cursor up and down |
→ | Open (expand) a folder |
← | Close (collapse) a folder |
Enter | Open the selected file in the editor |
Tab | Move focus from the tree to the editor |
Esc | Move focus from the editor back to the tree |
Ctrl+B | Show or hide the sidebar entirely |
[ / ] | Narrow / widen the sidebar |
File Operations
All file operations are available from the tree with single-key shortcuts. They apply to the selected row, or to the whole marked range if you usedShift+↑/↓ to extend a selection.
| Key | Operation |
|---|---|
a | Create a new file (prompts for name inline) |
A | Create a new folder (prompts for name inline) |
r | Rename the selected file or folder |
d | Delete the selected file or folder (asks to confirm) |
x | Cut — marks the selection for moving |
c | Copy — marks the selection for copying |
p | Paste — drops the clipboard contents into the selected folder |
Shift+↑ / Shift+↓ | Extend the selection to include multiple rows |
Pressing
p while a file is selected drops the pasted item next to that file (in the same folder), so you never have to aim precisely at the parent folder. A copy is never consumed: you can paste c into several folders one after another.F1 → File), which is useful when you want to act without the tree focused.
Bulk Operations
Deleting, moving, or copying a large tree (such asnode_modules) runs in the background. The status bar at the bottom of the window shows a live counter — Deleting 1 423 / 4 801 — while the editor stays fully usable. You are never frozen waiting for a long file operation to complete.
When a bulk move finishes, open tabs, unsaved buffers, and the active file path all update automatically to reflect the new locations, exactly as they do for a single-file move.
Move Behavior
Druk’smovePath function does more than rename a file on disk. After a successful move or rename, it remaps every in-memory reference to the old path:
- Open tabs — the tab title and its backing buffer are pointed at the new path.
- Preview tab — if the moved file was being previewed, the preview follows it.
- Expanded folder state — any folder that was expanded at or under the old path is expanded at its new location.
- Active file selection — the cursor lands on the destination after the move.
Name Collisions
Druk never silently overwrites a file. If you paste something into a folder that already contains an entry with that name, the pasted copy gets acopy suffix automatically:
c, then press p on the same folder. You get app copy.ts without any conflict.
Sidebar Visibility and Width
Ctrl+Btoggles the sidebar on and off. When Druk is opened with a single file path (druk src/main.ts), the sidebar starts hidden — pressCtrl+Bto bring it back.- Drag the divider between the sidebar and editor to resize it freely.
- Pin the width by setting
sidebarWidthin~/.config/druk/config.jsonto a number between15and80columns. The default ("auto") uses roughly a quarter of the terminal width.
Session Restore
Druk saves each project’s state between sessions. When you reopen a directory, it restores:- Which folders were expanded
- Which files were open in tabs
- Which file was the active tab
Hidden Files and Gitignore
Two settings control what the tree shows:| Setting | Default | Effect |
|---|---|---|
showDotfiles | true | Set to false to hide files and folders whose names begin with . |
respectGitignore | false | Set to true to hide files that .gitignore rules would exclude |
The
.git directory is always hidden from the file tree, regardless of either setting. This prevents accidental editing of internal git objects.F1 → Settings) or by editing ~/.config/druk/config.json directly.