开发者

How can I get emacs to show line numbers when the 'text-mode-hook appears not to be working?

开发者 https://www.devze.com 2023-03-26 02:12 出处:网络
I am trying to use setnu.el to give me line numbers in emacs, which as you might imag开发者_运维知识库ine I want in pretty much every mode. It seemed like the preffered way of doing this in Emacs is t

I am trying to use setnu.el to give me line numbers in emacs, which as you might imag开发者_运维知识库ine I want in pretty much every mode. It seemed like the preffered way of doing this in Emacs is to use

(add-hook 'text-mode-hook 'turn-on-setnu-mode)

but this isn't working for me. Using

(add-hook 'emacs-lisp-mode-hook 'turn-on-setnu-mode)

works just fine when I am editing emacs lisp files, but I want line numbers in all my text viewing and don't want to have a special case for each kind of file in my init.d file. Help would be much appreciated.


Linum seems to be distributed with emacs >=22.

Try:

(require 'linum)

Then toggle the display of line numbers with

M-x linum-mode

http://web.student.tuwien.ac.at/~e0225855/linum/linum.html

0

精彩评论

暂无评论...
验证码 换一张
取 消