sjl / vitality.vim

Make Vim play nicely with iTerm 2 and tmux.
http://github.com/sjl/vitality.vim
MIT License
320 stars 30 forks source link

insert mode focus lost/gain prints escape sequences #20

Open zekzekus opened 11 years ago

zekzekus commented 11 years ago

plugin works almost excellent for me. while in normal and visual mode focus lost causes to save of the file with my autocmd statement in my vimrc file.

but when i make focus lost in insert mode and when focus gained again i see [O[I characers printed to the buffer and buffer not saved.

    vnoremap <silent> <f24> <esc>:silent doautocmd FocusLost %<cr>gv
    vnoremap <silent> <f25> <esc>:silent doautocmd FocusGained %<cr>gv

    inoremap <silent> <f24> <c-o>:silent doautocmd FocusLost %<cr>
    inoremap <silent> <f25> <c-o>:silent doautocmd FocusGained %<cr>

visual mode mapping works but insert mode does not. i tried to put for inoremap but no luck.

bitboxer commented 10 years ago

I see those characters as well. Can I prevent the output of those sequences? I refresh the screen with ctrl+l but it would be great if I won't have to do that.

tumdum commented 10 years ago

I fixed it in my config by adding this into my vimrc:

    inoremap <Esc>[0 <nop>

I don't know why is it behaving this way, nor do I know why it can be fixed this way :/

bitboxer commented 10 years ago

It does not fix this for me :sob: