Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide cursor if window looses focus?

Tags:

emacs

Is it possible to hide the cursor if the window looses the focus ? e.g. 'windmove-left moves the focus one window left but the cursor can still be seen in the windows that is no longer active.

like image 212
rogergl Avatar asked Jun 19 '26 10:06

rogergl


1 Answers

That's the purpose of user option cursor-in-non-selected-windows.

cursor-in-non-selected-windows is a variable defined in ‘C source code’.
Its value is t

  Automatically becomes buffer-local when set.

Documentation:
Non-nil means show a cursor in non-selected windows.
If nil, only shows a cursor in the selected window.
If t, displays a cursor related to the usual cursor type
(a solid box becomes hollow, a bar becomes a narrower bar).
You can also specify the cursor type as in the `cursor-type' variable.
Use Custom to set this variable and update the display.

You can customize this variable.
like image 134
Drew Avatar answered Jun 21 '26 21:06

Drew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!