I have been working on my laptop a lot lately, and I am accidentally clicking while typing.  I know I could remove set mouse=a in my .vimrc, but sometimes I like using the mouse.What can I do to create a toggle function to toggle mouse support?
How to toggle mouse support in vim?
vim
You can retrieve the value of an option by using its name with a & prepended. So a simple toggle function for the mouse option would be:function! ToggleMouse()     check if mouse is enabled    if &mouse == 'a'         disable mouse        set mouse=    else         enable mouse everywhere        set mouse=a    endifendfuncThis toggles between no mouse and mouse in all modes. You can use it via :call ToggleMouse()PS: don't use something like this for options that are boolean, for these :set option! can be used to invert them.