Is it possible to get focus-follows-mouse behavior in terminal Neovim?
Please note this is different from this question about how to focus a window by clicking the mouse. This question is about how to focus a window by moving the mouse.
By focus-follows-mouse, I mean when the mouse pointer is hovered over a window that is not activated, it should be activated as if I switched to it using e.g. <C-w><Up>
.
I found the mousefocus
option which sounds like exactly what I want:
'mousefocus' 'mousef' boolean (default off)
global
The window that the mouse pointer is on is automatically activated.
When changing the window layout or window focus in another way, the
mouse pointer is moved to the window with keyboard focus. Off is the
default because it makes using the pull down menus a little goofy, as
a pointer transit may activate a window unintentionally.
Unfortunately, adding set mouse=a mousefocus
to my configuration has no effect. Moving the mouse pointer over an unfocused window doesn't do anything. (Having the mouse pointer automatically moved when I do <C-w><Up>
sounds annoying, but that's not happening either.) I tried this in Kitty and Gnome Terminal.