emacs 23.1以后的版本都默认包含linum,只需使用M-x输入命令linum-mode再按回车即可显示行号.详见下文.
(转自https://www.metalevel.at/linum/linum.html)
linum lets you display line numbers to the left of Emacs buffers.
As of Emacs 23.1, linum ships with GNU Emacs. You can enable it with M-x linum-mode RET
You can also download either:
- linum.el for Emacs >=22, or
- compat/linum.el for older Emacs versions and XEmacs
Copy the appropriate linum.el to your load-path and add to your .emacs :
(require 'linum)
Then toggle display of line numbers with M-x linum-mode RET
另外,全局开启的方法如下: .emacs 中写入
(global-linum-mode 1) <span class="comment-delimiter" style="color: rgb(178, 34, 34);">; </span><span class="comment" style="color: rgb(178, 34, 34);">always show line numbers</span>保存即可。
注:.emacs文件一般位于用户的home目录下,windows下需要设置HOME环境变量,HOME环境变量所指的目录即为home目录.
本文介绍如何在Emacs编辑器中启用行号显示功能。从Emacs 23.1版本开始,linum模式已作为标准特性提供。用户可以通过M-x linum-mode命令轻松激活该功能。此外,还提供了通过配置.emacs文件来全局启用行号的方法。
85

被折叠的 条评论
为什么被折叠?



