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
精彩评论