1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-27 21:19:51 -05:00

Use display-line-numbers instead of nlinum

This commit is contained in:
Jack Foltz 2019-09-07 11:03:29 -04:00
parent 84c2283491
commit f504d99475
Signed by: foltik
GPG Key ID: D1F0331758D1F29A

View File

@ -453,12 +453,15 @@ Show line and column numbers in the modeline.
*** Line Numbers
Use the default emacs relative line numbers, but switch to absolute lines when in insert mode.
#+BEGIN_SRC emacs-lisp
(use-package nlinum-relative
:config
(nlinum-relative-setup-evil)
:hook (prog-mode . nlinum-relative-mode))
(add-hook 'prog-mode-hook (lambda () (setq display-line-numbers 'absolute)))
(add-hook 'evil-insert-state-entry-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'absolute))))
(add-hook 'evil-insert-state-exit-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'relative))))
(add-hook 'evil-normal-state-entry-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'relative))))
(add-hook 'evil-normal-state-entry-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'absolute))))
(add-hook 'evil-visual-state-entry-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'relative))))
(add-hook 'evil-visual-state-entry-hook (lambda () (when (bound-and-true-p display-line-numbers) (setq display-line-numbers 'absolute))))
(add-hook 'display-line-numbers-hook (lambda () (when (evil-normal-state-p) (setq display-line-numbers 'relative))))
#+END_SRC
*** Show Matching Parens
Shows matching parenthesis
#+BEGIN_SRC emacs-lisp