When in select mode (used mouse to select some text) if I delete a chunk of text with the backspace the postion of the cursor moves backwards a few places which is very annoying. I know I should probably never be using the mouse but….its annoying!
Share
With me, a visual selection done with the mouse, is (obviously) not deleted with backspace, but that’s probably due the fact that I’m not on a Mac (doesn’t a Mac have fewer keys in the delete/backspace department?)
You might get mileage from this type of mapping:
It works like a charm with me. If you feel like being adventurous, you might map it to
<Del>even when your physical keyboard doesn’t have that key :).Note that in order to prevent the ‘cut’ text from being yanked in the default register, change the mapping to be
"_xinstead of plainxOn my PCs, mouse selection actually starts a Visual Mode selection, due to the fact that I have
behave xtermin $MYVIMRC, so I needed to do this:If you want to override the select behaviour back to the default, use