CotEditor takes a distinct approach in the crowded landscape of text editors: it doesn’t try to be a cross-platform Swiss Army knife or pack every conceivable feature. Instead, it commits fully to macOS’s native APIs and design philosophy. This means everything from text rendering to document management feels like it belongs on macOS, not just runs on it.
deep integration with macOS document and text systems
CotEditor is a plain text editor written in Swift, built specifically for macOS (targeting macOS Sequoia 15+). At its core, it leverages Cocoa’s document-based application architecture. This framework isn’t just an implementation detail here; it shapes how the app manages document lifecycle, autosaving, version control, undo management, and window handling.
Text rendering and editing rely on AppKit’s NSTextView, a powerful native text system component. This means CotEditor inherits the robustness and optimizations Apple has invested in NSTextView, including text layout, selection, input handling, and more. It avoids reinventing the wheel or introducing a custom text engine.
The app supports a wide range of plain text formats with precise encoding management, ensuring that files saved and opened maintain correct character encodings across different languages. It also ships with 17 localizations, reflecting a commitment to global accessibility.
Development uses Xcode 26.5, and the app runs with sandboxing and hardened runtime enabled—both important for meeting macOS’s security standards. The entire project is Apache 2.0 licensed, with images under Creative Commons BY-NC-ND.
architectural philosophy and tradeoffs
What makes CotEditor interesting is its architectural philosophy: it treats macOS system APIs as first-class citizens. Rather than layering abstractions or creating a custom UI toolkit, it opts for system-native components and standard macOS conventions. This means keyboard shortcuts, UI behaviors, and window management are familiar to any macOS user because they follow the platform’s design language precisely.
The tradeoff here is clear: by focusing on native APIs and minimalism, CotEditor isn’t trying to compete with feature-heavy editors that run cross-platform or support complex project management. It’s not about speed records or massive extensibility but about quality and consistency within the macOS ecosystem.
The codebase itself reflects this philosophy. It’s written entirely in Swift, following Apple’s recommended patterns. The document-based architecture separates concerns cleanly, making the app’s flow around document handling transparent. The reliance on NSTextView avoids the complexity of a custom text engine but also means it inherits NSTextView’s limitations (for example, certain advanced text manipulation features may be constrained by NSTextView’s design).
how to build and try coteditor
If you want to build CotEditor to poke around or modify it, the README provides clear instructions. Here’s the exact process for ad-hoc usage and distribution builds:
## Build for ad‑hoc usage
1. Open `CotEditor.xcodeproj` in Xcode.
1. Switch to ad-hoc build mode:
1. Open `Configurations/CodeSigning.xcconfig`.
1. Comment out `#include "CodeSigning-Default.xcconfig"`.
1. Uncomment `#include "CodeSigning-AdHoc.xcconfig"`.
1. Build the “CotEditor” scheme.
## Build for distribution
1. Open `CotEditor.xcodeproj` in Xcode.
1. Build the “CotEditor” scheme.
This process lets you build the app locally with minimal setup if you already have Xcode installed. The approach respects macOS’s security settings, so sandboxing and hardened runtime are enabled by default.
why coteditor is worth understanding
CotEditor offers a clean example of how to build a macOS app that truly feels native rather than ported. Its strict adherence to Cocoa’s document-based architecture and NSTextView means it integrates seamlessly with macOS features like autosave, versioning, and native text input behaviors.
For developers looking to build macOS apps, especially those involving text editing, CotEditor is a solid reference for how to approach architecture with platform fidelity as a guiding principle. It also shows the tradeoffs of prioritizing native behavior and minimalism over feature bloat or cross-platform ambitions.
That said, it’s not the editor for everyone. Power users who want advanced IDE-like features or cross-platform availability will find it limited. But for those who want a lightweight, stable, and macOS-consistent plain text editor, it hits the mark.
CotEditor’s source code being open under Apache 2.0 means you can dig into its Swift and AppKit implementation details directly. This transparency is a boon if you want to learn from a mature macOS text editor codebase or even contribute.
Overall, CotEditor is an example of architecture as philosophy: choosing platform-native APIs not as a fallback but as a core design decision that shapes everything from UI to document handling to security compliance.
→ GitHub Repo: coteditor/CotEditor ⭐ 8,068 · Swift