tmux-plugins / vim-tmux-focus-events

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

<F24><F25> pasted #6

Open mrmuskrat opened 8 years ago

mrmuskrat commented 8 years ago

Normally everything works well. If I'm in insert paste mode (':set paste' followed by 'i') then switch windows/panes and come back to vim <F24><F25> are pasted at the cursor location. I don't know enough about Vim remaps to know if this is normal or how to fix it (apart from remembering not to enable paste mode until I need it).

hjanuschka commented 6 years ago

old issue but i stumbled upon the same issue.

adding this to my vimrc fixed it

 " When Tmux 'focus-events' option is on, Tmux will send <Esc>[O when the
  " window loses focus and <Esc>[I when it gains focus.
exec "set <F24>=\<Esc>[O"
exec "set <F25>=\<Esc>[I"

found in: https://github.com/tmux-plugins/vim-tmux-focus-events/blob/master/plugin/tmux_focus_events.vim

captainfffsama commented 4 years ago

= =||| I try add

 " When Tmux 'focus-events' option is on, Tmux will send <Esc>[O when the
  " window loses focus and <Esc>[I when it gains focus.
exec "set <F24>=\<Esc>[O"
exec "set <F25>=\<Esc>[I"

but it doesnt work,so I have to set no paste for default,and map use F10 to switch the paste mode. I add the following code in my vimrc:

" set paste " 直接这样设置在tmux中使用会导致失焦插入<F24><F25>
set pastetoggle=<F10>

after set this,when I need paste ,just push F10,after I finish paste,F10 again can help me back to the normal insert mode