Skip to content

davidbalbert/Watt

Repository files navigation

Watt

A high performance text editor for macOS. Not ready for production use.

See this YouTube playlist for info on how Watt works.

Features

  • Fast text storage: a copy-on-write B-tree based rope with O(log n) access and mutation.
  • A fast, Core Animation based text view. Only draws lines in the viewport, and doesn't redraw on scroll.
  • Full Unicode support (extended grapheme clusters, emoji sequences, skin tone modifiers, etc.).
  • Monospaced and proportional typefaces.
  • A files sidebar supporting live updates, drag and drop, and file renaming.
  • System key bindings and IMEs (emoji picker, Romaji, marked text, etc.).
  • macOS integration: autosave, file history, reload on change, proxy icons, concurrent file loading, etc.
  • Syntax highlighting using Tree-sitter (only C for now).
  • System appearance support (dark mode, etc.).
  • Themes.

What's missing

  • Non-wrapped text.
  • Multiple cursors.
  • Auto indent.
  • LSP support: autocomplete, jump to definition, show callers, etc.
  • Split views and tabs.
  • Encodings besides UTF-8.
  • Find in File and Find in Project.
  • GitHub Copilot.
  • Performance improvements:
    • Fast layout for documents with no line breaks – don't draw visual lines that are outside the viewport.
    • Virtualized document height estimation – don't store heights of lines outside the viewport.
    • Don't block the UI when opening large files – load them piecemeal instead.
    • Don't block the UI when saving large files – use AppKit's asynchronous file writing support.
    • Efficient diff-based file reloading.

Points of interest

Getting started

  • Clone this repository.
  • Run git submodule update --init.
  • Copy Developer.xcconfig.example to Developer.xcconfig and set CODE_SIGN_IDENTITY and DEVELOPMENT_TEAM appropriately.
  • Open Watt.xcodeproj in Xcode.

License

Watt is copyright David Albert and released under the terms of the MIT License. See LICENSE.txt for details.

Acknowledgements

Portions of Watt are adapted from the following projects. See ACKNOWLEDGEMENTS.md for license information.

About

A high performance text editor for macOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages