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.

Druk’s editor pane sits at the center of the window, flanked by the file tree on the left and bounded by a tab strip at the top and a status bar at the bottom. Every file you open lands in the editor, each in its own tab, and you can keep as many tabs alive simultaneously as you like. The editor renders entirely in the terminal — no GUI, no Electron — yet still gives you the full experience of a modern code editor: syntax highlighting, vim mode, undo history, clipboard integration over SSH, and automatic save on blur.

Tabs

Opening a file from the tree creates a preview tab: the name is displayed in italics, and the next file you open from the tree takes its place. Previewing is how you browse quickly without cluttering the tab strip. A tab becomes pinned — shown in normal weight — the moment you start editing, double-click the tab, or save.
Press Ctrl+T to open the tab switcher and jump to any open file by name.
KeyAction
Ctrl+TOpen the tab switcher (fuzzy pick from all open tabs)
Ctrl+WClose the current tab (prompts if unsaved)
Ctrl+Opt+TReopen the last closed tab
Ctrl+Opt+←Switch to the previous tab
Ctrl+Opt+→Switch to the next tab
You can also close other tabs or close all tabs at once from the command palette (F1Tabs).

Syntax Highlighting

Druk uses tree-sitter for syntax highlighting, meaning every language has a full incremental parse tree rather than a regex approximation. Grammars for JavaScript, TypeScript, and Markdown are bundled directly inside the binary; additional grammars are vendored alongside it. The full list of supported languages includes:

Web

JavaScript, TypeScript, TSX, JSX, TSRX, Vue, HTML, CSS, SCSS, SASS, LESS, JSON, PHP, Svelte

Systems

Rust, C, C++, Go, Swift, Zig

JVM & Mobile

Java, Kotlin, Scala, Dart

Scripting

Python, Ruby, Bash, Lua, Elixir

Config & Markup

TOML, YAML, Markdown, INI, Env (.env), SQL

Other

C#
Language detection is automatic from the file extension. When a file type has no grammar, the editor falls back to plain-text display without errors.

Editing Shortcuts

All standard editing operations work from the keyboard. Ctrl+C copies when text is selected and exits Druk when nothing is — so you can never accidentally discard unsaved work by misfire.
KeyAction
Ctrl+SSave the current file
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+CCopy selected text (or quit if nothing is selected)
Ctrl+XCut selected text
Ctrl+VPaste
Ctrl+/ or Ctrl+LToggle line or selection comment
Opt+↑ / Opt+↓Move current line or selection up / down
Opt+Shift+↑ / Opt+Shift+↓Duplicate current line or selection up / down
Ctrl+GGo to line number
Ctrl+SpaceTrigger autocomplete
Copy, cut, and paste use OSC 52 — the terminal clipboard escape sequence — so they work with your system clipboard even over an SSH session, as long as your terminal supports OSC 52 (iTerm2, kitty, WezTerm, and most modern terminals do).
Some terminals cannot send Ctrl+/ at all (macOS Terminal.app is a common example), which is why Toggle comment also responds to Ctrl+L. Both are also available in the command palette under Editor.

Vim Mode

Druk ships a built-in vim emulation layer. Enable it by setting vim: true in ~/.config/druk/config.json, or toggling it on the Settings page (F1Settings).
1

Enable vim mode

Open the command palette with F1, choose Settings, navigate to the vim row, and press Enter to toggle it on. Changes apply immediately.
2

Learn the basics

Druk starts in Normal mode. Press i to enter Insert, Esc to return to Normal, and v / V to enter character / line Visual mode.
3

Use motions and operators

All standard motions and operators work together with counts.

Modes

ModeHow to enterStatus bar label
NormalEsc from any modeNORMAL
Inserti (before cursor), a (after), o (new line below), O (new line above), I (line start), A (line end)INSERT
Visualv (character), V (line)VISUAL

Motions

KeyMotion
h / lLeft / right
j / kDown / up
w / bWord forward / backward
0Line start
$Line end
ggBuffer start (or {n}gg for line n)
GBuffer end (or {n}G for line n)
{ / }Paragraph up / down
Ctrl+D / Ctrl+UScroll 10 lines down / up

Operators

OperatorEffect
d{motion}Delete (e.g. dw, d$, dd)
c{motion}Change — delete and enter Insert mode
y{motion}Yank (copy) into the register
DDelete to end of line
CDelete to end of line and enter Insert mode
xDelete character under cursor
p / PPaste register after / before cursor
uUndo
Ctrl+RRedo (in vim mode; Ctrl+Opt+F for project search)
Counts work before any operator or motion: 3dd deletes 3 lines, 5j moves down 5 rows. Text objects are supported for bracket pairs — di( deletes inside parentheses, da{ deletes the whole block including braces. In Visual mode, d / x deletes the selection, y yanks it, and c replaces it and enters Insert.

Auto-Save

When autoSaveOnBlur is true (the default), Druk automatically saves any dirty buffer when you:
  • Switch to a different tab
  • Switch to a different terminal window (the TUI loses focus)
This means you rarely need to reach for Ctrl+S manually — context-switching takes care of it. If you prefer to control saving entirely by hand, set autoSaveOnBlur: false in settings.

Conflict Detection

If a file on disk has been modified by another process since Druk last read it, Druk detects the mismatch before saving and prompts you to confirm before overwriting. This prevents silent data loss when you edit the same file in two places simultaneously.

Build docs developers (and LLMs) love