blueyed / vim-diminactive

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

[Solved] Support for Windows WSL bash terminal (Clash with Molokai theme) #44

Closed axsaucedo closed 5 years ago

axsaucedo commented 5 years ago

EDIT: The Molokai colorscheme I was using was blocking the colour change on focus toggle. More specifically the line that caused the disruptions is hi Normal ctermfg=252 ctermbg=233. After removing this it worked fully.

I am currently trying to activate this functionality for the WSL windows bash terminal but it doesn't seem to work (even with #23, #16, and #8).

I have installed the plugins in vim as follows:

    " ...other plugins
    Plug 'tmux-plugins/vim-tmux-focus-events'
    Plug 'blueyed/vim-diminactive'

SImilarly I have added the code in my tmuxconf:

# ...other tmux plugins
set -g @plugin 'tmux-plugins/tmux-sensible'

# Ensuring vim inactive screen works 
set -g focus-events on

Edit: Added more detail.

Tmux Conf

Currently I also have the following style for active and non-active windows in my tmux.conf which successfully dims windows that are inactive:

# Windows style (Dim when not focused)
set -g window-style 'fg=white,bg=colour234'
set -g window-active-style 'fg=white,bg=colour232'

I also have the suggested global setting to ensure focus events are propagated:

# Ensuring vim inactive screen works 
set -g focus-events on

Vim Plugin

I also have the vim-diminactive plugin as follows

    Plug 'tmux-plugins/vim-tmux-focus-events'
    Plug 'blueyed/vim-diminactive'

And this plugin works within vim, which means that if I do a vertical split or a horizontal split, when I move around the windows it actually dims the vim windows.

Errors experienced

The errors that I have is that when I move from the vim window into another tmux window, that active vim window stays active, and doesn't dim down.

This is I assume because the focus events from tmux are not propagating into vim.

I don't have any actual errors being displayed - I just don't see the expected functionality

Versions

The versions I am running are the following:

blueyed commented 5 years ago

it doesn't seem to work

Please elaborate.. :)

axsaucedo commented 5 years ago

Haha @blueyed fair enough :)

Tmux Conf

Currently I also have the following style for active and non-active windows in my tmux.conf which successfully dims windows that are inactive:

# Windows style (Dim when not focused)
set -g window-style 'fg=white,bg=colour234'
set -g window-active-style 'fg=white,bg=colour232'

I also have the suggested global setting to ensure focus events are propagated:

# Ensuring vim inactive screen works 
set -g focus-events on

Vim Plugin

I also have the vim-diminactive plugin as follows

    Plug 'tmux-plugins/vim-tmux-focus-events'
    Plug 'blueyed/vim-diminactive'

And this plugin works within vim, which means that if I do a vertical split or a horizontal split, when I move around the windows it actually dims the vim windows.

Errors experienced

The errors that I have is that when I move from the vim window into another tmux window, that active vim window stays active, and doesn't dim down.

This is I assume because the focus events from tmux are not propagating into vim.

I don't have any actual errors being displayed - I just don't see the expected functionality

Versions

The versions I am running are the following:

Next steps

@blueyed does this help? Is there any specific logs that could help debug why this is the case?

axsaucedo commented 5 years ago

@blueyed I had a deeper look this morning, and it turned out to be the Molokai colorscheme I was using was blocking the colour change on focus toggle. More specifically the line that caused the disruptions is hi Normal ctermfg=252 ctermbg=233. I have removed this and now works, so I can confirm it also works on WSL Ubuntu 👍.