When I insert the mode, sometimes my cursor moves because my palm is accidentally placed on the trackpad. So, I want autocmd to turn off the mouse in insert mode and turn it on in normal mode.
I write it like this:
autocmd InsertEnter * set mouse=""
autocmd InsertLeave * set mouse=a
He worked to turn off the mouse. But, when I leave the insert mode, the mouse is not activated.
How to do it?
Edit: I only found out that it InsertLeavedoes not start when I use CTRL_C. Unfortunately, I always use CTRL_Cto exit insert mode. Is there a workaround for this?
Edit 2: I also recognized the event UserGettingBored. But it seems that this event is just a joke.
source
share