I'm new with emacs and I'd like to know how can we disable the highlight line mode (global-hl-line-mode) when we are in the VISUAL mode of Evil Mode. I find it really confusing when we start selecting a block with the hl-line activated, even if their background colors are different. Of course, I want the hl-line-mode activated again when we leave the VISUAL mode. Thanks.
EDIT: I tried this one and I was finally able to disable hl-line when in VISUAL mode.
(add-hook 'evil-visual-state-entry-hook (lambda () (setq-local global-hl-line-mode nil)))
But I could not enable it when I leave. I tried this but it didn't work:
(add-hook 'evil-visual-state-exit-hook (lambda () (global-hl-line-mode 1)))
EDIT: nevermind, this actually works: (add-hook 'evil-visual-state-entry-hook (lambda () (setq-local global-hl-line-mode nil)))
(add-hook 'evil-visual-state-exit-hook (lambda () (global-hl-line-mode nil)))