Q: is there a way to have hl-line-mode
highlight the current line
only in the selected window?
When I have multiple windows showing buffers with hl-line-mode
on, it is difficult to tell, at a glance, which window is
current.
I have the variable cursor-in-non-selected-windows
set
to nil
to show the cursor only in the current window, but that
visual cue is swamped by the highlighted lines in the windows.
Is there a similar setting to allow me to have hl-line-mode
show
the highlighted line only in the current window? Even better, is
there a way to give the highlighted lines a different face when
they're in inactive windows (analogous to mode-line-inactive
)?
PS: yes, I can look at the mode line to tell which window is active, but doing so takes my eyes away from what I'm doing and breaks my concentration.
global-hl-line-mode
(rather than calling hl-line-mode for each buffer) then only line the selected window is highlighted.hl-line-mode
in a few buffer types (occur
,mu4e
, etc.). I'll dig around in the source code when I get a moment.