Skip to content

Draft

Draft is Luft’s text and code editor. Open a file and you get just the editor and its tabs; start Draft on its own and a folder tree joins them in the sidebar.

  • Syntax highlighting for over a hundred languages, picked from the file name or its #! line. Change it from the status bar.
  • Multiple cursors, rectangular selection with Alt+drag, folding, bracket matching and auto-indent.
  • Find and replace with case, whole word and regular expressions.
  • Indentation, encoding and line endings are detected and kept when saving, and can be changed from the status bar.
  • A command palette, quick open, and a Markdown preview that follows the editor.
  • Syntax colours come from your wallpaper’s accent, in light and dark.

Draft restores your folder, tabs, cursors and unsaved changes the next time it starts, untitled documents included. Files changed on disk reload by themselves, and Draft asks first when you have unsaved changes.

Large files open quickly. Files over 10 MB open as plain text until you pick a language.

Shortcut Does
Ctrl+P Go to a file; type > for commands or : for a line
Ctrl+Shift+P All commands
Ctrl+O / Ctrl+Shift+O Open files, open a folder
Ctrl+S / Ctrl+Alt+S Save, save all
Ctrl+G Go to a line
Ctrl+F / Ctrl+H Find, find and replace
Ctrl+D Select the next occurrence
Ctrl+Shift+L Select every occurrence
Ctrl+Alt+Up / Down Add a cursor above or below
Ctrl+/ Comment
Alt+Up / Down Move lines
Ctrl+B Sidebar
Alt+Z Word wrap
Ctrl+Shift+V Markdown preview

Settings live in ~/.config/draft/settings.json.