Make my-relative-linenum interactive and toggleable
This commit is contained in:
parent
0e8a092a92
commit
010825f326
5
init.el
5
init.el
|
@ -1013,9 +1013,10 @@
|
||||||
|
|
||||||
(global-hl-line-mode)
|
(global-hl-line-mode)
|
||||||
|
|
||||||
(defun my-relative-linenum ()
|
(defun my-relative-linenum (&optional toggle)
|
||||||
"Simply enables relative line numbers."
|
"Simply enables relative line numbers."
|
||||||
(setq display-line-numbers 'relative))
|
(interactive "p")
|
||||||
|
(setq display-line-numbers (if (and toggle display-line-numbers) nil 'relative)))
|
||||||
(dolist (hook '(prog-mode-hook
|
(dolist (hook '(prog-mode-hook
|
||||||
conf-mode-hook))
|
conf-mode-hook))
|
||||||
(add-hook hook #'my-relative-linenum))
|
(add-hook hook #'my-relative-linenum))
|
||||||
|
|
Loading…
Reference in a new issue