tmux-plugins / vim-tmux-focus-events

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

Statusline problem #5

Open sblask opened 8 years ago

sblask commented 8 years ago

Just tried to install vim-tmux-focus-events and the FocusGained seems to work, however, I get problems when moving through a file. The status line moves when I for example use Ctrl-D or j at the end of the page and part of the buffer gets scrambled. At first I thought it's some incompatibility with the bling/vim-airline plugin, but the problem persists even when I remove all the plugins from my config(apart from vim-tmux-focus-events). Relevant configs are: https://github.com/sblask/dotfiles/blob/master/vimrc.dotfile and https://github.com/sblask/dotfiles/blob/master/tmux.conf.dotfile I am currently using tmux 2.0 and vim 7.4.942 Any idea what could be wrong?

bruno- commented 8 years ago

Hey, unfortunately I don't know why that happens.. messing with status line seems pretty invasive and I don't know how this plugin could cause that..

Quick question for a line from your vimrc, what does this mystical line do:

autocmd FocusGained * silent execute '!echo -e -n "\x1b[\x31 q"' | silent execute '!echo ""'
sblask commented 8 years ago

This is exactly what I wanted to have the focus gained working for. I have tmux/vim setup so the cursor is a block in normal mode and a pipe in insert mode. Which works fine unless I do a ctrl-zand bring vim back with fg vim will then show a pipe even though its in normal mode. It's a small detail, but it would have been nice to get that working...

kyounger commented 5 years ago

@sblask Not sure if this helps, but testing for mode() helped me overcome this issue. I suffered it from the perspective of tmux and switching panes. Here's a link to the relevant section of my vimrc:

https://github.com/kyounger/dotfiles/blob/b153a9aaa77e100db7dfb12e84873ff5f7954198/vim/.vimrc#L1265-L1274