tmux-plugins / vim-tmux-focus-events

Make terminal vim and tmux work better together.
MIT License
348 stars 23 forks source link

Plugin affects vim `.` commands #24

Closed l-qing closed 1 year ago

l-qing commented 4 years ago

Vim's Operator-Pending mode was interrupted when switching tmux focus.

prepare:

  1. start tmux and open 2 windows.
  2. start vim in first window of tmux.

steps:

  1. execute cw above words in vim. [test string:a:b] cursor on the character of a.
  2. switch to other tmux window.
  3. switch back to vim window.
  4. input some characters.(such as z)
  5. use ESC to normal mode. [test string changed to z:b]
  6. move cursor to the character of b
  7. use . command result: [test string changed to z:zb] expect: [test string changed to z:z]

If skip the step 2 and 3, the result is expect. I think the vim exit and reenter insert mod when switch tmux window.

environments:

MacOS: 10.15.2 Vim: 8.2 Tmux: 3.0a

vim config:

.vimrc

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/bundle')
Plug 'tmux-plugins/vim-tmux-focus-events'
call plug#end()

tmux config:

set -s focus-events on