Skip to content

Instantly share code, notes, and snippets.

@Pagliacii
Created March 24, 2021 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pagliacii/218472e256a041f506bce8af2c63126b to your computer and use it in GitHub Desktop.
Save Pagliacii/218472e256a041f506bce8af2c63126b to your computer and use it in GitHub Desktop.
Auto-switch to relative line number if activating the visual mode. Doom Emacs.
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'absolute)
;; Auto-switch to relative line number if entering the visual mode
(add-hook! 'evil-visual-state-entry-hook #'menu-bar--display-line-numbers-mode-relative)
(add-hook! 'evil-visual-state-exit-hook #'menu-bar--display-line-numbers-mode-absolute)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment