Is it possible to open and close folds in Gvim using mouse clicks ?
Say double click opens and closes folds ?
In the fold column (e.g. :set foldcolumn=4
), you can open / close folds by (single-)clicking on the signs; this works out-of-the-box.
I use a mapping similar to the one in your answer that just opens folds, but otherwise maintains the default doubleclick behavior:
" <2-LeftMouse> Open fold, or select word or % match.
nnoremap <expr> <2-LeftMouse> foldclosed(line('.')) == -1 ? "\<2-LeftMouse>" : 'zo'
This was what I was looking for
:noremap <2-LeftMouse> za
Toggles folds with mouse double click
Or may be triple click to avoid conflicting with text selecting command of vim
:noremap <3-LeftMouse> za
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With