Skip to content
Permalink
Browse files

Attempt to reduce mouse click related line deletes

If you have Vim set up with mouse support, if you hit the d key in
insert mode and click your mouse to some line in between where your
cursor is and above, then Vim will delete all lines that were included.

I don't know how I'm doing it exactly but about 10 times a day I will
end up accidentally deleting a bunch of lines above my cursor when I
click somewhere with my mouse.

After having set these new values I'm noticing that it's happening less
often with no perceivable downside to the additional delay. This is a
work in progress, but it's an improvement as is.
  • Loading branch information
nickjj committed Dec 6, 2019
1 parent b5ae4c0 commit 6c8c704aed83cb40ba48f444138578c3a623892a
Showing with 6 additions and 6 deletions.
  1. +1 −1 .tmux.conf
  2. +5 −5 .vimrc
@@ -16,7 +16,7 @@ bind ` send-prefix
setw -g aggressive-resize on

# Remove delay when switching between Vim modes.
set -s escape-time 0
set -g escape-time 50

# Allow Vim's FocusGained to work when your terminal gains focus.
# Requires Vim plugin: https://github.com/tmux-plugins/vim-tmux-focus-events
10 .vimrc
@@ -343,11 +343,11 @@ vnoremap <Leader>tc c<C-r>=system('tcc', getreg('"'))[:-2]<CR>
" -----------------------------------------------------------------------------

" Reduce delay when switching between modes.
augroup NoInsertKeycodes
autocmd!
autocmd InsertEnter * set ttimeoutlen=0
autocmd InsertLeave * set ttimeoutlen=50
augroup END
" augroup NoInsertKeycodes
" autocmd!
" autocmd InsertEnter * set ttimeoutlen=0
" autocmd InsertLeave * set ttimeoutlen=500
" augroup END

" Auto-resize splits when Vim gets resized.
autocmd VimResized * wincmd =

0 comments on commit 6c8c704

Please sign in to comment.
You can’t perform that action at this time.