ContextEditor is a macOS app that routes text and source files to different editors depending on the current project.
It is designed for setups where one project should open in Cursor, another in VS Code, and another in Sublime Text, while macOS still uses a single default app in Finder.
- macOS sends the clicked file to
ContextEditor. ContextEditorwalks up the directory tree looking for.contexteditor.- It reads the
editorvalue. - It opens the file in the matching real editor app.
- If there is no
.contexteditor, it asks macOS for the real default app for that file type and avoids routing back intoContextEditor.
Place a .contexteditor file at the root of a project:
{
"editor": "cursor"
}Supported values:
cursorvscodecodecodiumwindsurfzedsublimesublimetextnovabbedittextmatecoteditormacvimtextedit
Prebuilt signed binaries are available from the Releases page.
The current public release is v0.1.2.
brew tap driade/context-editor https://github.com/driade/context-editor
brew install --cask driade/context-editor/contexteditorThis tap installs the notarized app published in GitHub Releases.
Requirements:
- macOS
- Xcode
- XcodeGen
git clone https://github.com/driade/context-editor.git
cd context-editor
xcodegen generate
./scripts/build_universal.shThe app will be generated at:
build-universal/output/ContextEditor.appThat command builds a universal macOS app with Apple Silicon and Intel slices.
xcodebuild -project ContextEditor.xcodeproj -scheme ContextEditor -configuration Debug -derivedDataPath build testThe test suite covers configuration lookup and editor resolution behavior.
- Build
ContextEditor.app. - In Finder, select any text or source file and open
Get Info. - Under
Open with, chooseContextEditor. - Click
Change All....
- The app is registered as an editor for common text and source-code content types through its
Info.plist. - Finder associations are still controlled per file type by macOS, so you may need to use
Get Info > Open with > Change All...for the file families you care about. - GitHub release builds are signed, notarized, and published automatically from version tags.
MIT