blueyed / vim-diminactive

Vim plugin to dim inactive windows
339 stars 10 forks source link

Added Focus Support #8

Closed rorystephenson closed 10 years ago

rorystephenson commented 10 years ago

Enter/Leave are now triggered on FocustGained/FocusLost. This means that in tmux when moving to a different pane all vim splits will be dimmed. In order for this to work a terminal that supports focus events must be used and the tmux option (focus-events on) must be set. For OSX users iTerm2 supports focus events, in order to enable them the vim plugin Vitality.vim is required as it sends escape codes to iTerm2 to turn on focus reporting.

blueyed commented 10 years ago

Thanks for this!

But I think it should be configurable / enhanced, because it would get triggered also when unfocusing GVim or the terminal with vim in a single pane. In these cases (depending on your preferences) it would be useful to have the last activated pane not dimmed.

What do you think?

rorystephenson commented 10 years ago

I completely agree that it should be configurable! I actually made a slight improvement by changing the background colour instead when focus is lost using (highlight Normal ctermbg=COLOUR) and set the colour to the same colour your plugin uses. It even colours the blank lines :).

blueyed commented 10 years ago

@thelollies Will you provide an updated PR? If you do not want to add the option yourself, I could add it on top of it.

rorystephenson commented 10 years ago

Hey sorry forgot about this. It needs a bit of a tweak because for some reason buffers occasionally get stuck coloured in and I'm not entirely sure why. Try it with tmux