Skip to main content

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.

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. Press Tab 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.
KeyAction
/ Move the cursor up and down
Open (expand) a folder
Close (collapse) a folder
EnterOpen the selected file in the editor
TabMove focus from the tree to the editor
EscMove focus from the editor back to the tree
Ctrl+BShow 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 used Shift+↑/ to extend a selection.
KeyOperation
aCreate a new file (prompts for name inline)
ACreate a new folder (prompts for name inline)
rRename the selected file or folder
dDelete the selected file or folder (asks to confirm)
xCut — marks the selection for moving
cCopy — marks the selection for copying
pPaste — 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.
All of these operations are also reachable from the command palette (F1File), which is useful when you want to act without the tree focused.

Bulk Operations

Deleting, moving, or copying a large tree (such as node_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’s movePath 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.
This means renaming a folder that has five files open in tabs just works — all five tabs stay open and saving any of them writes to the correct new location.

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 a copy suffix automatically:
app.ts        →  app copy.ts
components/   →  components copy/
This is also how you duplicate a file in place: select it, press c, then press p on the same folder. You get app copy.ts without any conflict.
  • Ctrl+B toggles the sidebar on and off. When Druk is opened with a single file path (druk src/main.ts), the sidebar starts hidden — press Ctrl+B to bring it back.
  • Drag the divider between the sidebar and editor to resize it freely.
  • Pin the width by setting sidebarWidth in ~/.config/druk/config.json to a number between 15 and 80 columns. 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
This is stored per project root, so different projects each keep their own layout.

Hidden Files and Gitignore

Two settings control what the tree shows:
SettingDefaultEffect
showDotfilestrueSet to false to hide files and folders whose names begin with .
respectGitignorefalseSet 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.
Both settings can be changed from the Settings page (F1Settings) or by editing ~/.config/druk/config.json directly.

Build docs developers (and LLMs) love