TextMate is a powerful, modular text editor for macOS with a sophisticated architecture built on efficient C++ data structures and an elegant Objective-C++ GUI layer.
You can download TextMate from here.
TextMate uses a custom build system based on rave configuration files and ninja. Install the following dependencies:
- boost — portable C++ source libraries
- Cap'n Proto — serialization library
- multimarkdown — marked-up plain text compiler
- ninja — build system similar to
make - ragel — state machine compiler
- sparsehash — a cache friendly
hash_map
Install via Homebrew or MacPorts:
# Homebrew (recommended)
brew install boost capnp google-sparsehash multimarkdown ninja ragel
# MacPorts
sudo port install boost capnproto multimarkdown ninja ragel sparsehashgit clone --recursive https://github.com/textmate/textmate.git
cd textmate
./configure && ninja TextMate/runThe ./configure script checks dependencies and generates build.ninja with default config set to release.
# Build TextMate
ninja TextMate
# Build and launch TextMate
ninja TextMate/run
# Clean build
ninja -t clean
# Run tests for a specific framework
ninja <framework_name>/test
# Build specific application
ninja <app_name>/run- Install the Ninja bundle via Preferences → Bundles
- Set up
PATHin Preferences → Variables or~/.tm_properties(e.g.,$PATH:/usr/local/bin) - Press ⌘B to build
The default target is TextMate/run which will relaunch TextMate with full session restore.
TextMate follows a modular architecture with clear separation between low-level C++ data structures and high-level Objective-C++ GUI components.
oak::basic_tree_t- Balanced binary indexed tree (AA-tree) for text storage with O(log N) operationsng::detail::storage_t- Efficient chunked memory storage in basic_tree_tng::buffer_t- Text buffer with semantic services (line/column tracking, syntax parsing, text marks)ng::indexed_map_t- Segment tree providing map-like interface and indexed access for metadatang::layout_t- Text layout and rendering with line wrapping and folding support
Core Frameworks:
buffer/- Text storage and manipulationeditor/- Text editing operations and transformationsparse/- Grammar parsing and syntax highlightinglayout/- Text layout and renderingselection/- Text selection handlingregexp/- Regular expression and pattern matching
GUI Frameworks:
OakTextView/- Main text editing view componentsDocumentWindow/- Document window managementFileBrowser/- File browser sidebarFind/- Search and replace functionalityBundleEditor/- Bundle editing interface
Support Frameworks:
io/- File I/O, path manipulation, process executionsettings/- Configuration and preferencesbundles/- Bundle loading and managementscm/- Source control integration (Git, SVN, Hg, P4)
TextMate/- Main TextMate.appmate/- Command line toolSyntaxMate/- Syntax highlighting framework- Plus various utility applications
Tests use the CxxTest framework and are located in tests/ subdirectories:
t_*.ccort_*.mm- Unit tests using CxxTestgui_*.mm- GUI tests
Build test targets automatically based on current file location via .tm_properties.
TextMate's functionality is extended through bundles containing:
- Commands, snippets, and macros
- Grammar definitions for syntax highlighting
- Themes for visual appearance
- Language-specific settings
- Uses
.ravefiles for build configuration - Uses
.tm_propertiesfor TextMate-specific settings - C++2a standard with 3-space tabs
- Precompiled headers in
Shared/PCH/ - Automatic framework include path configuration
- TextMate mailing list
- #textmate IRC channel on freenode.net
- Contact MacroMates
Please read the writing bug reports instructions before submitting issues.
保留的配置文件:
- ✅
local.rave- 工作的本地配置 - ✅
default.rave- 默认构建配置 - ✅
local-orig.rave- 原始配置备份 - ✅ 项目原有的文档 (README.md, CLAUDE.md等)
编译环境:完全正常
- ✅ 依赖项已正确安装
- ✅ 配置文件已恢复正常
- ✅ ARM64版本编译成功
- ✅ TextMate.app可正常启动
使用方法:
# 开发构建 (debug)
./configure && ninja TextMate
# 发布构建 (release)
bin/rave -crelease -tTextMate && ninja TextMate
# 构建并启动
ninja TextMate/run输出位置:
- Debug:
dist/debug/Applications/TextMate/TextMate.app - Release:
dist/release/Applications/TextMate/TextMate.app
The source for TextMate is released under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
TextMate is a trademark of Allan Odgaard.
