Emacs 组织模式:关闭行号 [英] Emacs Org-Mode: Turn off line numbers
问题描述
我最近从 vim
转移到了 Emacs
,因为我想使用 org-mode
.我在 Emacs23
Org-mode
中打开了一个 ~10000 行、50kb 的文件,然后继续添加大约 10 个一级标题.在 Ubuntu 10.04/32 位下,在 Emacs23 中使用 3GB RAM 四核的性能非常慢,以至于无法使用.我找到了 两个 threads 在讨论这个的 Org-mode
电子邮件列表.似乎启用 linum
会导致性能下降.如果必须的话,我可以在 .org
文件中没有行号,但我不想为我编辑的所有文件禁用行号.如果我要生活"在Emacs"中,我会想要所有其他文件的行号.
I've recently moved from vim
to Emacs
because I want to use org-mode
. I opened a ~10000 line, 50kb file in Emacs23
Org-mode
and proceeded to add about 10 first-level headings. Performance on a quad-core with 3GB RAM in Emacs23 under Ubuntu 10.04/32bit was so slow that it was unusable. I found two threads on the Org-mode
email list discussing this. It seems that enabling linum
causes the slow performance. I can live without line numbers in .org
files if I have to, but I don't want to disable line numbers for all files I edit. If I'm going to "live" in `Emacs', I'll want line numbers for all other files.
如何仅对部分或所有 .org
文件禁用 linum
?如果我在 Emacs
中打开了多个文件并在它们之间切换,是否可以这样做?我在这里找到了一些关于禁用主要模式的行号的讨论,但我没有可以实现(尽管 linum-off.el
脚本 提到页面上的 a> 看起来很有希望,我(还)不知道 (E)Lisp,所以我无法根据需要更改它.
How can I disable linum
for some or all .org
files only? Is it possible to do this if I have several files open in Emacs
and switch between them? I found some discussion about disabling line numbers for major modes here, but there was nothing that I could implement (although the linum-off.el
script mentioned on the page looks promising, I don't (yet) know (E)Lisp, so I can't change it as I would need).
我将 Org-mode
从 Emacs23
附带的 6.21b 版更新到了 7.5 版,但没有任何区别.Emacs
GUI 中的性能非常糟糕,以至于应用程序根本无法响应.-nw
的性能更好",但仍然无法使用.
I updated Org-mode
from version 6.21b which came with Emacs23
to version 7.5, but it made no difference. Performance in Emacs
GUI is so bad that the application fails to respond at all. Performance with -nw
is "better", but still unusable.
推荐答案
linum-off.el
在我的问题中提到的已经解决了这个问题.说明在文件中:将文件放入 Emacs 加载路径并将 (require 'linum-off)
添加到 ~/.emacs.此脚本仅针对指定的模式关闭行编号.我已经测试过了,效果很好.
linum-off.el
mentioned in my quesiton has solved this. Instructions are in the file: place the file into the Emacs load-path and add (require 'linum-off)
to ~/.emacs. This script turns off line numbering for the modes specified only. I've tested it and it works fine.
这篇关于Emacs 组织模式:关闭行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!