> For the complete documentation index, see [llms.txt](https://handbook.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://handbook.bsdcn.org/di-3-zhang-freebsd-ji-chu/3.10.-wen-ben-bian-ji-qi.md).

# 3.10.文本编辑器

FreeBSD 的绝大多数配置都是通过编辑文本文件完成的，因此熟悉一款文本编辑器是个不错的主意。FreeBSD 基本系统自带了一些文本编辑器，Ports 中还提供了更多选择。

一个适合入门的简单编辑器是 [ee(1)](https://man.freebsd.org/cgi/man.cgi?query=ee\&sektion=1\&format=html)，即 easy editor（简易编辑器）。要启动该编辑器，可以键入 `ee filename`，其中 *filename* 是要编辑的文件名。进入编辑器后，所有用于操作编辑器功能的命令都会列在显示器顶部。脱字符（`^`）代表 **Ctrl**，因此 `^e` 就是 **Ctrl**+**e**。要退出 [ee(1)](https://man.freebsd.org/cgi/man.cgi?query=ee\&sektion=1\&format=html)，按下 **Esc**，然后从主菜单中选择“leave editor（退出编辑器）”选项。如果文件已被修改，编辑器会提示保存更改。

FreeBSD 的基本系统中还包括一些功能更强的文本编辑器，比如 [vi(1)](https://man.freebsd.org/cgi/man.cgi?query=vi\&sektion=1\&format=html)。其他编辑器如 [editors/emacs](https://cgit.freebsd.org/ports/tree/editors/emacs/) 和 [editors/vim](https://cgit.freebsd.org/ports/tree/editors/vim/) 是 FreeBSD Ports 的一部分。这些编辑器提供了更强大的功能，但学习起来也更复杂。从长远来看，学会使用像 vi 或 Emacs 这样强大的编辑器，最终可以节省大量时间。

许多修改文件或需要输入内容的应用程序会自动打开一个文本编辑器。要更改默认编辑器，可以按照 [Shells](/di-3-zhang-freebsd-ji-chu/3.9.-shell.md) 中的说明设置 `EDITOR` 环境变量。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-3-zhang-freebsd-ji-chu/3.10.-wen-ben-bian-ji-qi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
