# 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* 是要编辑的文件名。进入编辑器后，所有用于操作编辑器功能的命令都会列在显示器顶部。插入符号（`^`）代表 <kbd>Ctrl</kbd>，因此 `^e` 就是 <kbd>Ctrl</kbd>+<kbd>e</kbd>。要退出 [ee(1)](https://man.freebsd.org/cgi/man.cgi?query=ee\&sektion=1\&format=html)，按下 <kbd>Esc</kbd>，然后从主菜单中选择“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 的一部分。这些编辑器提供了更强大的功能，但学习起来也更复杂。长期来看，学习如 vim 或 Emacs 这样的强大编辑器可以节省更多时间。

许多修改文件或需要输入内容的应用程序会自动打开一个文本编辑器。要更改默认编辑器，可以按照 [Shells](https://docs.freebsd.org/en/books/handbook/basics/#shells) 中的说明设置 `EDITOR` 环境变量。


---

# Agent Instructions: 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.
