# CotEditor

免费的原生 Mac 纯文本编辑器，支持语法高亮、编码工具、文件夹搜索和脚本化文本工作流程。

> 这是 OpenNavo 上 CotEditor 页面的 Markdown 版本，内容与网页相同： <https://opennavo.com/zh/apps/coteditor>

- **最新版本**: `7.1.3`
- **开发者**: CotEditor Project
- **主页**: <https://coteditor.com/>
- **分类**: [写作与笔记](https://opennavo.com/zh/categories/writing)
- **安装**: `brew install --cask coteditor`
- **近 30 天安装**: 1,506
- **Homebrew**: 可以安装，应用会自行更新
- **下载地址**: <https://github.com/coteditor/CotEditor/releases/download/7.1.3/CotEditor_7.1.3.dmg>
- **SHA-256**: `c8cbe6437434516bb23f93efe057fd058ad56ded5523ac113081a8ae68dab184`
- **附带命令**: cot

SHA-256 只用来核对下载的文件是否完整，不代表安全认证。

## 安装与卸载内容

```json
[
  {
    "declaration": {
      "uninstall": [
        {
          "quit": "com.coteditor.CotEditor"
        }
      ]
    },
    "phase": "uninstall",
    "sources": [],
    "type": "uninstall"
  },
  {
    "declaration": {
      "app": [
        "CotEditor.app"
      ],
      "target": "/Applications/CotEditor.app"
    },
    "phase": "install",
    "sources": [
      "CotEditor.app"
    ],
    "target": "/Applications/CotEditor.app",
    "type": "app"
  },
  {
    "declaration": {
      "binary": [
        "$APPDIR/CotEditor.app/Contents/SharedSupport/bin/cot"
      ],
      "target": "$HOMEBREW_PREFIX/bin/cot"
    },
    "phase": "install",
    "sources": [
      "$APPDIR/CotEditor.app/Contents/SharedSupport/bin/cot"
    ],
    "target": "$HOMEBREW_PREFIX/bin/cot",
    "type": "binary"
  },
  {
    "declaration": {
      "zap": [
        {
          "trash": [
            "~/Library/Application Scripts/com.coteditor.CotEditor",
            "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.coteditor.coteditor.sfl*",
            "~/Library/Caches/com.apple.helpd/Generated/com.coteditor.CotEditor.help*",
            "~/Library/Caches/com.apple.helpd/SDMHelpData/Other/English/HelpSDMIndexFile/com.coteditor.CotEditor.help*",
            "~/Library/Caches/com.apple.helpd/SDMHelpData/Other/Japanese/HelpSDMIndexFile/com.coteditor.CotEditor.help*",
            "~/Library/Caches/com.coteditor.CotEditor",
            "~/Library/Containers/com.coteditor.CotEditor",
            "~/Library/Preferences/com.coteditor.CotEditor.plist"
          ]
        }
      ]
    },
    "phase": "cleanup",
    "sources": [],
    "type": "zap"
  }
]
```

## 介绍

CotEditor 是一款免费的原生 macOS 纯文本编辑器，适用于源代码、配置文件、标记语言和日常文本。它提供语法高亮、文档大纲、行号、字符信息、分屏编辑、正则表达式查找与替换，以及文本编码和换行符工具。它直接编辑文本本身，而不像文字处理器那样生成富文本排版。

### 编辑文本和文件夹
打开文本文件或文件夹，选择语法，并在一个或多个视图中检查文本。7.1 的文件夹搜索可跨已打开文件夹中的文件进行搜索。模式可让你为不同工作流程选择缩进样式和宽度。编辑器支持转换换行符和编码，并提供检查字符以及识别无法用某种编码表示的文本的工具。转换供其他程序使用的文件时，请确认转换结果；编码或换行符的更改可能影响兼容性。

查找与替换支持正则表达式和可重复使用的替换定义。使用合适的范围，并在执行“全部替换”前检查匹配项，尤其是在处理重要文件时。CotEditor 是文本编辑器，并非完整的 IDE、编译器或调试器；编辑脚本不会安装其语言运行时或依赖项。

### 安装和兼容性
CotEditor7.1.1 需要 macOS26 Tahoe 或更高版本，可在 Intel x86-64 和 Apple Silicon ARM64 上原生运行。直接下载的 DMG 为26,594,816 字节，不含安装后占用的存储空间。从 DMG 将应用拷贝到“应用程序”文件夹并打开。7.0.9 历史版本要求 macOS15+，但这不会改变当前7.1版本的要求。

直接下载版本免费，无需CotEditor账户、订阅或激活。Mac App Store 是另一种发行方式，并遵循 Apple Account 的常规要求。直接下载版本使用 Sparkle 更新；App Store 版本则通过 App Store 更新。文档访问受沙盒限制，并以用户选择的文件和文件夹为基础，因此请通过应用支持的文件打开流程授予访问权限，不要假定它能随意修改所有受保护路径。

### 脚本和自动化
CotEditor 支持通过“脚本”菜单运行脚本，包括 AppleScript 和可执行 UNIX 脚本。UNIX 脚本可通过标准输入接收所选文本或文档内容，并将输出返回编辑器。脚本需要可用的解释器，并且必须使用适当的文件扩展名和可执行权限。

Python 脚本需要另行安装兼容的 Python 解释器。官方指南支持使用诸如 /usr/bin/env python3 的 shebang，但提醒 CotEditor 的 PATH 可能与 Terminal shell 的 PATH 不同。需要特定环境时，请指定解释器的绝对路径。编辑器不保证附带 Python 运行时，也不保证与所有软件包环境普遍兼容。只运行可信的自动化脚本：脚本可能更改文档内容，并在其可用权限范围内执行其他操作。

### 保存和恢复
CotEditor 提供 macOS 风格的自动保存和编辑工作恢复机制，但这些机制不能替代独立备份。保存、替换文本或运行脚本都可能更改实际文档。重要文件请使用版本控制或单独备份，并在其他地方使用转换或重写后的文档前进行检查。

### 许可和费用
CotEditor 免费且开源。其当前源代码许可证为 Apache License2.0，而图像资源另行采用 Creative Commons Attribution-NonCommercial-NoDerivatives4.0 许可证。源代码许可证并不意味着可以不受限制地重复使用项目中的所有图形。使用该编辑器无需付费方案。

官方来源：[CotEditor](https://coteditor.com/)、[源代码和要求](https://github.com/coteditor/CotEditor)、[7.1.1 版本](https://github.com/coteditor/CotEditor/releases/tag/7.1.1)、[UNIX 脚本指南](https://github.com/coteditor/CotEditor/blob/7.1.1/CotEditor/Resources/CotEditor.help/Contents/Resources/en.lproj/pgs/script_unixscript.html)、[许可证](https://github.com/coteditor/CotEditor/blob/7.1.1/LICENSE)。

## 系统要求

- 适用于 macOS 27, 26 的版本 · 应用版本: 7.1.3 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/7.1.3/CotEditor_7.1.3.dmg>
  - SHA-256: `c8cbe6437434516bb23f93efe057fd058ad56ded5523ac113081a8ae68dab184`
- 适用于 macOS 27, 26 的版本 · 应用版本: 7.1.3 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/7.1.3/CotEditor_7.1.3.dmg>
  - SHA-256: `c8cbe6437434516bb23f93efe057fd058ad56ded5523ac113081a8ae68dab184`
- 适用于 macOS 15 的版本 · 应用版本: 7.0.9 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/7.0.9/CotEditor_7.0.9.dmg>
  - SHA-256: `b1cd481dd8f1271ffc7478dcc65d7e3a1f17893a3bc1f4afa38a9a93beaf5877`
- 适用于 macOS 15 的版本 · 应用版本: 7.0.9 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/7.0.9/CotEditor_7.0.9.dmg>
  - SHA-256: `b1cd481dd8f1271ffc7478dcc65d7e3a1f17893a3bc1f4afa38a9a93beaf5877`
- 适用于 macOS 14 的版本 · 应用版本: 5.2.3 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/5.2.3/CotEditor_5.2.3.dmg>
  - SHA-256: `c01fa87e31d7aafd475f72bb41a340e1e34db27cc8afb73ba2f5e2ad316739a9`
- 适用于 macOS 14 的版本 · 应用版本: 5.2.3 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/5.2.3/CotEditor_5.2.3.dmg>
  - SHA-256: `c01fa87e31d7aafd475f72bb41a340e1e34db27cc8afb73ba2f5e2ad316739a9`
- 适用于 macOS 13 的版本 · 应用版本: 4.8.7 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.8.7/CotEditor_4.8.7.dmg>
  - SHA-256: `9c439ace99d6b74cf94738d24368ccc39c579902c7062f8e107c596061a58dda`
- 适用于 macOS 13 的版本 · 应用版本: 4.8.7 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.8.7/CotEditor_4.8.7.dmg>
  - SHA-256: `9c439ace99d6b74cf94738d24368ccc39c579902c7062f8e107c596061a58dda`
- 适用于 macOS 12 的版本 · 应用版本: 4.5.9 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.5.9/CotEditor_4.5.9.dmg>
  - SHA-256: `fa3e4a1fdf7edfc109c5588292906d864d430d2e8bd3d84161b1f0a7892163f6`
- 适用于 macOS 12 的版本 · 应用版本: 4.5.9 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.5.9/CotEditor_4.5.9.dmg>
  - SHA-256: `fa3e4a1fdf7edfc109c5588292906d864d430d2e8bd3d84161b1f0a7892163f6`
- 适用于 macOS 11 的版本 · 应用版本: 4.3.6 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.3.6/CotEditor_4.3.6.dmg>
  - SHA-256: `8c1ecf6fd66a9885d428a6303d9d1c5ecb811c1c35c97bdbccdad72359d96ad9`
- 适用于 macOS 11 的版本 · 应用版本: 4.3.6 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
  - <https://github.com/coteditor/CotEditor/releases/download/4.3.6/CotEditor_4.3.6.dmg>
  - SHA-256: `8c1ecf6fd66a9885d428a6303d9d1c5ecb811c1c35c97bdbccdad72359d96ad9`

## 价格

- 免费下载 · US$0.00 (美国) — Mac App Store: <https://apps.apple.com/us/app/coteditor/id1024640650?mt=12> · <https://apps.apple.com/us/app/coteditor/id1024640650?mt=12> · 核查于 2026-11-23 · 这是 App Store 版的下载价格，不代表可以免费使用；应用内购买和订阅不在其中。

## 卸载

- `brew uninstall --cask coteditor`

普通卸载会删除应用本身，设置和缓存会保留。

### 深度清理（可选）

- `brew uninstall --zap --cask coteditor`

`--zap` 还会删除 Homebrew 定义里列出的设置、缓存等文件，其中可能有其他应用共用的数据，删除后无法恢复；它也不保证没有任何残留。请先备份需要保留的数据；如要保留设置和缓存，请不要加 `--zap`。

普通卸载会删除应用本身，设置和缓存会保留。

- 文件和文件夹: `~/Library/Application Scripts/com.coteditor.CotEditor` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.coteditor.coteditor.sfl*` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Caches/com.apple.helpd/Generated/com.coteditor.CotEditor.help*` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Caches/com.apple.helpd/SDMHelpData/Other/English/HelpSDMIndexFile/com.coteditor.CotEditor.help*` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Caches/com.apple.helpd/SDMHelpData/Other/Japanese/HelpSDMIndexFile/com.coteditor.CotEditor.help*` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Caches/com.coteditor.CotEditor` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Containers/com.coteditor.CotEditor` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。
- 文件和文件夹: `~/Library/Preferences/com.coteditor.CotEditor.plist` — <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 以上条目来自 Homebrew 定义，核查于 2026-11-23；它们只说明定义声明会删除什么，不代表你的 Mac 上都有。

## 最新版本说明

### 7.2.0-rc (2026-11-21)

system requirements: __macOS 26__ and later

##### New Features

- Add the Hungarian localization (thanks to Torma Zsolt!).

##### Improvements

- Improve the performance of undo and redo in large documents.
- Improve the performance of the file browser when many files in the opened folder change at once.
- Update the AppleScript, BBCode, CoffeeScript, Dart, Erlang, Fortran, Git Config, INI, jq, JSON, Markdown, Perl, R, reStructuredText, SVG, Tcl, Verilog, XML, DTD, and YAML syntaxes to improve performance and highlighting accuracy.
- Improve VoiceOver support (thanks to Torma Zsolt!).
- Update tree-sitter-c-sharp to 0.24.0.
- Update tree-sitter-php to 0.25.2.
- [trivial] Display the setting name in the error message when importing a setting fails.
- [trivial] Display errors in the `cot` command as a brief message instead of a Python traceback.
- [beta] Optimize regular-expression-based syntax highlighting in large documents.
- [beta] Update Czech, Polish, and Portuguese localizations.

##### Fixes

- Fix several issues where the editor’s font and indentation were reset, such as when opening documents with the “Detect indent style on document opening” option, splitting the editor, or relaunching the app.
- Fix several issues in the `cot` command, such as where the `--new` option could empty existing files or the `--wait` option stopped waiting when the window was minimized.
- Fix an issue where Keyboard Maestro and other accessibility tools could not find the Text menu.
- Fix an issue in the file browser where the item with the old name remained after changing only the capitalization of its name.
- Fix an issue in the file browser where changes were no longer reflected after renaming or moving the opened folder or its subfolders.
- Fix an issue in the file browser where both a file and a folder with the same name appeared after one replaced the other.
- Fix an issue in the file browser where filtering did not work when the folder contained a subfolder that could not be read.
- Fix an issue in the file browser where the filter results were not updated correctly after files were changed outside the app.
- Fix an issue where importing a settings archive exported from CotEditor 6.2 failed if it included custom syntaxes.
- Fix an issue where the AppleScript `replace` command could fail to replace a single match when the regular expression used lookahead.
- [trivial] Fix an issue in the file browser where filtering with only certain combining marks showed all items.
- [trivial] Fix an issue where importing a settings archive failed if it contained hidden files, such as .DS_Store.
- [trivial] Fix an issue where importing a setting listed it twice if a custom setting with the same name but different capitalization already existed.
- [trivial] Fix an issue where the line and column of the insertion point in the status bar could remain outdated after the document was reloaded with changes made outside the app.

**Full Changelog**: https://github.com/coteditor/CotEditor/compare/7.2.0-beta...7.2.0-rc

## 资料与来源

- <https://opennavo.com/zh/apps/coteditor>
- <https://opennavo.com/zh/apps/coteditor/versions>
- <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/c/coteditor.rb> · 核查于 2026-11-23
- <https://formulae.brew.sh/cask/coteditor>
- <https://apps.apple.com/us/app/coteditor/id1024640650?mt=12> · 核查于 2026-11-23
