Native line numbering
下面是我用的设置,分享给伸手党们 
;; config built-in "display-line-number-mode" (require Emacs >= 26)
(setq-default display-line-numbers-width 2)
(setq-default display-line-numbers-type 'relative)
(setq display-line-numbers-current-absolute t)
;; advanced linum style (optional)
(use-package linum-highlight-current-line-number
:config
(setq linum-format 'linum-highlight-current-line-number))
;; enable line numbering (or "linum-mode")
(let ((hook-list '(sh-mode-hook
cmake-mode-hook
matlab-mode-hook
python-mode-hook
c-mode-common-hook
makefile-gmake-mode-hook ; Gnome
makefile-bsdmake-mode-hook ; OS X
ess-mode-hook))) ; R
(dolist (hook-element hook-list)
(add-hook hook-element 'display-line-numbers-mode)))