3

I work with evil-mode under Emacs so I encounter this issue that Emacs display line numbers for some mode but not for other mode, when I try to toggle linenumber-mode explicitly it tells me this mode has been disabled.

is there a way to make evil-mode display line numbers ?

zinking
  • 5,561
  • 5
  • 49
  • 81

2 Answers2

3

Try M-x-display-line-number-mode

Evil emacs mode gives unexpected behavior with :set nu.

Daoist Paul
  • 133
  • 8
2

line-number-mode is enabled by default, and Evil does not appear to change that.

To clarify, you are definitely talking about displaying the current line number in the mode line, and not showing all visible line numbers in the fringe (which is handled by linum-mode) ?

phils
  • 71,335
  • 11
  • 153
  • 198
  • sorry, it's the linum-mode, you are right. I think what I entered is not correct ? – zinking Apr 20 '12 at 06:10
  • Can `set nu` be configured to toggle line numbers? – dotancohen Oct 08 '20 at 16:18
  • @dotancohen I don't understand the question, sorry. Where would you by typing this? It it an `evil` thing? (I don't use `evil` -- I only looked at it briefly for the purposes of this Q&A). – phils Oct 08 '20 at 20:47
  • @phils Thank you. In VIM, `set nu!` toggles line numbers. NU is short for "numbers" I suppose, and the exclamation point toggles the setting. I've googled a bit and it seems that none of VIM's `set` commands work. I'll see how I bind the Emacs command `display-line-numbers-mode` to a simple shortcut. – dotancohen Oct 09 '20 at 08:09