# GNU nano

**GNU nano** 是一款小巧的自由终端文本编辑器，是作为 Pico 的自由软件替代品而编写的——Pico 是华盛顿大学 Pine 邮件套件附带的编辑器。它模仿了 Pico 的外观与操作手感，包括其 Control 键命令和屏幕上的快捷键提示，同时增加了 Pico 所缺少的功能，如撤销与重做、语法着色以及正则表达式搜索。<sup>[1](https://www.nano-editor.org/faq.html)</sup><sup> • </sup><sup>[2](https://packages.debian.org/en/sid/nano)</sup> 它以 C 语言编写，采用 ncurses 文本界面，以 GPL-3.0-or-later 许可证发布，并在大多数 Linux 发行版中预装。<sup>[2](https://packages.debian.org/en/sid/nano)</sup><sup> • </sup><sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup>

| 关键事实 | 详情 |
|---|---|
| 用途 | 作为非自由 Pine 邮件程序所附 Pico 编辑器的自由替代品；目标是在合理范围内尽可能贴近 Pico，同时提供其功能的超集<sup>[1](https://www.nano-editor.org/faq.html)</sup><sup> • </sup><sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup> |
| 起源 | 由 Chris Allegretta 于 1999 年末编写，最初名为“TIP”（Tip Isn't Pico）；2000 年 1 月 10 日更名为 nano<sup>[1](https://www.nano-editor.org/faq.html)</sup> |
| GNU 地位 | 2001 年 2 月由 Richard Stallman 宣布为正式 GNU 程序；首个正式版本于 2001 年 3 月 22 日发布<sup>[1](https://www.nano-editor.org/faq.html)</sup> |
| 当前版本 | 9.2 “Alquézar”，发布于 2026 年 7 月 31 日<sup>[5](https://www.nano-editor.org/news.php)</sup> |
| 界面 | 无编辑模式；命令使用 Control 键和 Meta（Alt）键，当前可用的快捷键列于屏幕底部<sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup><sup> • </sup><sup>[6](https://dyn.manpages.debian.org/stretch/nano/editor.1.en.html)</sup> |
| 超越 Pico 的功能 | 撤销/重做、行号、语法着色、软换行、支持正则表达式的交互式搜索与替换、跳转到指定行与列、多文件缓冲区、自动缩进、Tab 键补全、国际化<sup>[2](https://packages.debian.org/en/sid/nano)</sup> |
| 许可证与技术栈 | C 语言、ncurses 文本用户界面、GPL-3.0-or-later<sup>[2](https://packages.debian.org/en/sid/nano)</sup> |

## 历史

多年来，Pico 和 Pine 一直是 Unix 系统上阅读和撰写电子邮件的标准方式，其简洁的界面吸引了许多初学者。Debian GNU/Linux 只分发真正自由的软件，由于许可证问题，它不提供 Pine 或 Pico 的二进制包，这使得想要使用这些程序的用户没有自由的选择。<sup>[1](https://www.nano-editor.org/faq.html)</sup>

1999 年末，从 [Slackware](https://www.edgepedia.org/zh/slackware) 转投 Debian 的用户 Chris Allegretta 花了一个周末编写了一个勉强可用的 Pico 克隆，他称之为 TIP（Tip Isn't Pico）。第一个版本不指定文件名就无法启动，无法保存文件，也没有帮助显示或[拼写检查器](https://www.edgepedia.org/zh/spell-checker)，但在其他程序员的贡献下逐步改进。<sup>[1](https://www.nano-editor.org/faq.html)</sup> 2000 年 1 月 10 日，由于与一个名为 tip 的现有 Unix 工具发生命名空间冲突——该工具用于建立到远程主机的终端连接——程序更名为 nano；这一冲突此前未被注意到，因为大多数 GNU/Linux 发行版不包含 tip 工具。<sup>[1](https://www.nano-editor.org/faq.html)</sup>

2001 年 2 月，[Richard Stallman](https://www.edgepedia.org/zh/richard-stallman) 宣布 nano 为正式 GNU 程序，首个正式版本于 2001 年 3 月 22 日发布。<sup>[1](https://www.nano-editor.org/faq.html)</sup> 该项目的历史页面将其与 Pico 的两点根本分歧总结为：默认情况下与 Pico 更兼容，以及采用真正自由的许可证——GNU GPL。<sup>[7](https://nano-editor.org/history.php)</sup>

## 编辑模型与命令

Nano 没有单独的命令模式。输入即插入文本，命令通过 Control（^）键和 Meta（M-，通常为 Alt）键输入，因此新手或疲劳的操作者不太可能输入被编辑器解释为命令的文本。<sup>[6](https://dyn.manpages.debian.org/stretch/nano/editor.1.en.html)</sup> 最常用的两个命令是 Ctrl+O 保存和 Ctrl+X 退出；Ctrl+K 剪切当前行，Ctrl+U 粘贴剪切缓冲区，Ctrl+W 搜索，Ctrl+\ 替换，Ctrl+G 显示帮助，Alt+U 和 Alt+E 撤销和重做。<sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup> 连续的 Ctrl+K 剪切会累积在剪切缓冲区中，直到有其他命令介入。<sup>[6](https://dyn.manpages.debian.org/stretch/nano/editor.1.en.html)</sup>

可以通过 `nano [FILE]` 启动编辑器，在文件名前加上加号和行号可将光标置于指定行，再加上逗号和列号可置于指定列；负数从文件或行的末尾计数。<sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup>

## 功能

除基本编辑外，nano 还提供撤销与重做、语法着色、支持正则表达式的交互式搜索与替换、自动缩进、行号、单词补全、文件锁定、备份文件以及国际化支持。<sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup><sup> • </sup><sup>[2](https://packages.debian.org/en/sid/nano)</sup> 它支持多文件缓冲区、超长行的软换行、按住 Shift 选择文本、跳转到指定行与列的命令，以及文件名和搜索词的 Tab 键补全。<sup>[2](https://packages.debian.org/en/sid/nano)</sup> 在读写文件时通过 ^T 调用的文件浏览器，可以浏览目录以定位文件。<sup>[8](https://www.nano-editor.org/dist/v2.0/nano.html)</sup>

行为通过 nanorc 文件配置：nano 从 `~/.nanorc`、`$XDG_CONFIG_HOME/nano/nanorc` 或 `~/.config/nano/nanorc` 中读取用户配置，取决于哪个文件存在。<sup>[9](https://www.turbogeek.co.uk/nano-vim-vi-which-linux-editor-should-you-use/)</sup> 功能也可以在编辑器运行时切换。<sup>[2](https://packages.debian.org/en/sid/nano)</sup>

## Pico 兼容性与默认行为

最初的目标是完整模拟 Pico，连其缺陷也一并复现；当前的目标是在合理范围内尽可能兼容，同时提供 Pico 功能的超集。<sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup> 自 4.0 版起，nano 默认不再对超长行进行硬换行，采用逐行（平滑）滚动，并将标题栏下方的一行纳入编辑区域；选项 `--breaklonglines`、`--jumpyscrolling` 和 `--emptyline`（或 `-bje`）可恢复旧的 Pico 行为。<sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup><sup> • </sup><sup>[10](https://manpages.debian.org/bullseye/nano/nano.1.en.html)</sup> 自 8.0 版起，^F 启动向前搜索，^B 启动向后搜索，M-F 和 M-B 分别在各方向上重复搜索。<sup>[4](https://www.nano-editor.org/dist/latest/nano.html)</sup>

## 近期版本

2026 年 4 月 8 日发布的 9.0 版改变了水平滚动方式：所有行一起横向滚动，滚动量仅为保持光标可见所需的最小值，`--solosidescroll` 可恢复旧的单行滚动；该版本还使 M-Left、M-Right、M-Up 和 M-Down 可重新绑定，并允许在滚动条区域点击（配合 `--mouse` 和 `--indicator`）以在缓冲区中大致导航。<sup>[5](https://www.nano-editor.org/news.php)</sup> 9.1 版（2026 年 6 月 23 日）移除了以旧 Mac 格式读写文件的能力——该格式使用单独的回车符作为行结束符——并修复了 `--backup` 下的备份问题。<sup>[5](https://www.nano-editor.org/news.php)</sup> 9.2 版（2026 年 7 月 31 日）使 nano 在标准输出不是终端时拒绝启动，新增 `--newbuffer` 和 'set newbuffer' 作为 `--multibuffer` 和 'set multibuffer' 的更佳同义词，并再次识别旧式按键组合 ^W^T 和 ^/^T。<sup>[5](https://www.nano-editor.org/news.php)</sup><sup> • </sup><sup>[11](https://www.mail-archive.com/info-gnu%40gnu.org/msg03554.html)</sup>

## 终端编辑器中的 Nano

Nano、Vim 和 Emacs 是 Linux 上讨论最广泛的三大终端编辑器，它们各自占据不同的位置。Nano 学习曲线极低，在屏幕上显示快捷键，且没有模式；Vim 采用模态编辑，学习曲线陡峭，但一旦学会编辑速度极快；Emacs 通过 [Emacs Lisp](https://www.edgepedia.org/zh/emacs-lisp) 具有高度可扩展性。<sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup><sup> • </sup><sup>[12](https://www.geeksforgeeks.org/linux-unix/difference-between-vim-vs-nano-vs-emacs/)</sup> Nano 的自定义仅限于基本选项，其强大程度被评为低到中等，适合快速编辑配置文件而非日常编码。<sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup><sup> • </sup><sup>[13](https://meshworld.in/blog/how-to/text-editor-comparison/)</sup> 它通过 SSH 工作良好，且通常默认安装，使其成为在远程服务器上进行一次性编辑的常见选择；在只能使用终端编辑器的服务器工作中，Nano 和 Neovim 是最受欢迎的 Vim 替代品。<sup>[3](https://practicallinuxbook.com/linux-text-editors/)</sup> 在小系统上，例如 512 MB 的 VPS，Nano 或最小化的 Vim 配置是实用之选。<sup>[14](https://monovm.com/blog/nano-vs-vim-vs-emacs/)</sup>

## References

1. [The GNU nano editor FAQ, nano-editor.org](https://www.nano-editor.org/faq.html)
2. [Debian package details for nano (sid), packages.debian.org](https://packages.debian.org/en/sid/nano)
3. [Linux Text Editors: Vim, Emacs, and Nano Compared, The Practical Linux Handbook](https://practicallinuxbook.com/linux-text-editors/)
4. [The GNU nano text editor, manual version 9.2, nano-editor.org](https://www.nano-editor.org/dist/latest/nano.html)
5. [nano News, nano-editor.org](https://www.nano-editor.org/news.php)
6. [nano(1) man page, Debian stretch, manpages.debian.org](https://dyn.manpages.debian.org/stretch/nano/editor.1.en.html)
7. [nano History, nano-editor.org](https://nano-editor.org/history.php)
8. [nano Command Manual, version 2.0, nano-editor.org](https://www.nano-editor.org/dist/v2.0/nano.html)
9. [Nano vs Vim vs Vi for Linux Admins, TurboGeek](https://www.turbogeek.co.uk/nano-vim-vi-which-linux-editor-should-you-use/)
10. [nano(1) man page, Debian bullseye, manpages.debian.org](https://manpages.debian.org/bullseye/nano/nano.1.en.html)
11. [ANNOUNCE: nano-9.2 is released, mail-archive.com](https://www.mail-archive.com/info-gnu%40gnu.org/msg03554.html)
12. [Difference Between Vim VS Nano VS Emacs, GeeksforGeeks](https://www.geeksforgeeks.org/linux-unix/difference-between-vim-vs-nano-vs-emacs/)
13. [Terminal Text Editors Compared: vi/vim vs Nano vs Emacs, MeshWorld](https://meshworld.in/blog/how-to/text-editor-comparison/)
14. [Nano vs Vim vs Emacs — Which Terminal Editor to Learn?, MonoVM](https://monovm.com/blog/nano-vs-vim-vs-emacs/)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Named software products and platforms › Office and business software › Titles symbols to M › Titles 1 to G

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gnu-nano

English original: https://www.edgepedia.org/gnu-nano
