blueyed / vim-diminactive

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

Add Focus Support option for Issue #8 (g:diminactive_enable_focus) #16

Closed phongvcao closed 9 years ago

phongvcao commented 9 years ago

This is my follow-up to Issue #8 . I believe that an option for enabling dimming/re-activating the windows on FocusLost/FocusGained events is very important to the users, especially for those using Tmux.

For example, I usually SSH into different servers on different tmux panes (usually 4 of them) and without an option to specify dimming/re-activating on FocusLost/FocusGained event, this plugin is quite useless in this case, because the 4 active Vim window contained inside the 4 tmux panes will not get dimmed because they are all active Vim windows.

If the user is using Vim inside tmux, he/she should install the tmux-plugins/vim-tmux-focus-events plugin for Vim and add set -g option focus-events on to your ~/.tmux.conf. This is probably the reason why the author of Issue #8 had troubles setting up this option. I have tested this Pull Request thorough with Vim inside and outside tmux, inside and outside an SSH session and I can guarantee it works.

I have added the necessary option g:diminactive_enable_focus, along with an explanation in the README.md file. Please look through them when you can. I am waiting for your opinion.

blueyed commented 9 years ago

Thanks, will check it out later.

@thelollies what do you think?

phongvcao commented 9 years ago

@blueyed Is this Pull Request gonna be merged? This feature is very important for heavy tmux users like me. I have tested it thorough on iTerm, VTE-based terminal with tmux, etc. I hope @thelollies would reply soon. Otherwise, I believe the Pull Request is safe for merging.

rorystephenson commented 9 years ago

I'm no longer using this plugin but it looks good to me!

blueyed commented 9 years ago

Thanks @phongvcao, I have finally merged it: I've squashed and amend your commits.

I still have to really test this: urxvt does not support the (un)focus notifications and I am using tmux only on occassion - but I use a similar concept in my window manager (https://github.com/awesomeWM/awesome) in general, where I dim non-focused windows a bit (via opacity, handled by compton).