Avoiding Insert Delay Related Problems around Deleting with Vim & tmux
I had a problem with accidentally deleting lines when using the mouse with Vim. It turns out it was due to misconfiguring things a bit.
A few months ago I added a couple of settings to my .vimrc
and tmux.conf
files
which caused an issue where you could easily end up deleting paragraphs or lines
from a file without control. It happened to me multiple times a day.
I recently was able to pin point the problem and the video below explains how the problem came into existence and what I changed to fix it. The fix has been pushed to my dotfiles repo on GitHub.
# Demoing the Issue & Fixing It with 2 Config Settings
Timestamped Table of Contents
- 1:09 – Vim will happily delete points between your cursor and where you mouse click
- 2:35 – Attempting to fix the problem by tinkering with things until it worked
- 4:29 – Why I even added NoInsertKeycodes to my vimrc in the first place
- 6:45 – Things started to work after adjusting a tmux option for escape-time
- 7:40 – I have not experienced the problem again in 9+ days, I think it works
- 8:11 – Are you a Vim wizard? Let me know in the comments why this happened
Reference Links
- Dotfiles: https://github.com/nickjj/dotfiles
- https://github.com/nickjj/dotfiles/commit/6c8c704aed83cb40ba48f444138578c3a623892a
Can you explain why things work now? Let me know below.