Files

Browse, preview and edit a project's files in the side panel.

Click Files in the top bar to open the Files pane beside the conversation: the project’s files on the left, the open file on the right.

Browsing

In a git repository the list shows tracked and untracked files and leaves out what .gitignore ignores. Outside a repository it lists the folder, without .git and node_modules. A changed file carries git’s letter after its name, such as M for modified or U for untracked.

  • Type in Filter, or ? to search in files to find a file by name.
  • Start with ? to search inside the files instead, and click a matching line to open the file at it.
  • Show as a list and Show as a tree switch the view, Hide the file list folds the list away, and Maximize gives the pane the whole window.

A file path in the conversation is a link: click it to open the file here, at its line, with its folders opened in the tree. The list and the open file refresh as files in a repository change and when you come back to the window.

Previewing

FileShows as
Code and textThe editor, with line numbers and syntax colors
MarkdownRendered; Show source and Show preview switch
SVGThe picture; the same button shows its source
PNG, JPEG, GIF, WebP, AVIF, BMP, ICOThe picture, with zoom controls
Audio and videoA player
Binary filesBinary file, not shown
Files over 1 MBToo large to preview

Editing and saving

Click into any text file and type. A dot after the file name marks unsaved changes. Save with Save or ⌘S on macOS, Ctrl+S on Windows and Linux. ⌘F or Ctrl+F opens find and replace.

  • Closing the file, or opening another, with unsaved changes asks Save changes to …?, with Save, Don’t save and Cancel.
  • If the file changes on disk while you have unsaved edits, a bar says This file changed on disk. Reload takes the version on disk; Keep mine keeps your edits, and your next save writes over it.
  • A file that is not valid UTF-8 opens read-only, so saving cannot change its bytes.
  • Quitting Kettu with unsaved files asks first.

Syntax colors

The editor takes its colors from the chosen theme, in light and dark, the same colors as code blocks and diffs in the conversation. See Themes.