Emacs relative line number based on nlinum-mode
nlinum
is faster than linum
because of its use of jit-lock. nlinum-relative
only redisplays line numbers when idle which is much more smoother especially with big files.
This package is available on MELPA as nlinum-relative
.
(use-package nlinum-relative
:config
;; something else you want
(nlinum-relative-setup-evil)
(add-hook 'prog-mode-hook 'nlinum-relative-mode))
Use develop
branch's nlinum
layer.
(require 'nlinum-relative)
(nlinum-relative-setup-evil) ;; setup for evil
(add-hook 'prog-mode-hook 'nlinum-relative-mode)
(setq nlinum-relative-redisplay-delay 0) ;; delay
(setq nlinum-relative-current-symbol "->") ;; or "" for display current line number
(setq nlinum-relative-offset 0) ;; 1 if you want 0, 2, 3...
-
coldnew/linum-relative: display relative line numbers in the left margin in emacs
Some code from here
-
Based on this