From 5c39e9f3bcc8a8c105dd2eab789154359983fa03 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 14 May 2017 00:19:45 +0200 Subject: [PATCH] core-ui: disable hl-line in visual mode --- core/core-ui.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index 77c27ced8..997b7558c 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -187,7 +187,15 @@ file." :config ;; stickiness doesn't play nice with emacs 25+ (setq hl-line-sticky-flag nil - global-hl-line-sticky-flag nil)) + global-hl-line-sticky-flag nil) + + ;; acts weird with evil visual mode, so disable it temporarily + (defun doom|hl-line-off () (hl-line-mode -1)) + (after! evil + (add-hook! 'hl-line-mode-hook + (when hl-line-mode + (add-hook 'evil-visual-state-entry-hook #'doom|hl-line-off nil t) + (add-hook 'evil-visual-state-exit-hook #'hl-line-mode nil t))))) ;; Line numbers (def-package! linum