This is a simple script to make Zedβor its Preview/Nightly buildsβyour default editor for all text/code files on macOS.
It:
- Installs
dutiif needed - Asks if you want to use Zed, Zed Preview, or Zed Nightly
- Associates a broad set of file types (including
.mdx,.ts,.py,.json,.kt,.cs,.sql, etc.) with Zed - Automatically sets them via
dutiin one shot
No need to download anything β just run this in your terminal:
bash <(curl -fsSL https://raw.githubusercontent.com/JohnnyHoff/zed-default-editor/refs/heads/main/set_zed_defaults.sh)git clone https://github.com/YOUR-USERNAME/zed-default-editor.git
cd zed-default-editor
chmod +x set_zed_defaults.sh
./set_zed_defaults.sh- macOS
- Homebrew installed (used to install
duti)
This script sets Zed as the default app for:
- Plain text files (
.txt,.md,.log,.ini) - Code files (
.js,.ts,.py,.rs,.kt,.cs,.sql,.html,.css, etc.) - Configs (
.json,.xml,.yml,.plist) - Markdown & MDX files (
.md,.mdx) - Scripts (
.sh,.bash,.php,.rb, etc.)
If Zed isnβt detected:
- Make sure it's installed in
/Applications - You can re-run the script any time
If Markdown files still open in Zed Preview:
- Re-run the script and choose Zed
- Restart Finder or log out/in to refresh Launch Services
Feel free to PR more file types, support for other editors, or general improvements!
MIT