0

I've enabled mouse and clipboard and ... something else:

set mouse=a
set clipboard+=autoselect guioptions+=a

That's almost perfect, but I want it so that when I left click it moves the cursor and enters insert mode. I tried this:

set mouse=a
set clipboard+=autoselect guioptions+=a
nnoremap <LeftMouse> i

But then it enters insert mode without moving the cursor.

I'm sure this should be obvious... but I'm just shooting in the dark - true stackoverflow-driven-development style. I have no idea what to even search for.

1

Fortunately, a solution is fairly simple

nnoremap <LeftMouse> <LeftMouse>i

This leverages the "nore" part of nnoremap, allowing you to use the built-in functionality of the map on the right-hand-side while overriding it via left-hand-side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.