TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
486 stars 8 forks source link

vimade and tmux split #20

Closed lanox closed 4 years ago

lanox commented 5 years ago

Hi, After further troubleshooting I have narrowed it down to tmux.

So I saw in FAQ/Help that you mention tmux will not work if TERM is not set correctly.

Problem Summery: In tmux split mode

One side I have vim and in another just terminal. if I have multiple vim splits, vimade will dim the vim split that I am not in, however if I change to tmux split to terminal vimade will not dim the other vim pane.

inside tmux echo $TERM is showing screen-256color

outside tmux xterm-256color

TaDaa commented 5 years ago

Thanks for the info--

I am seeing that in vim latest that termguicolors may not be working properly with tmux + screen-256color. If I remember correctly there also may be additional config required for tmux to work with termguicolors.

lanox commented 5 years ago

No Problems,

echo &termguicolors returns 1 hi Normal guibg=#FFFFFF does change background to white.

I have tried setting export TERM=xterm-256color while in tmux and just before starting vi.

I have tried using tmux-256color with out any luck either. I should note as well that I am using neovim.

TaDaa commented 5 years ago

oh think I just realized that I completely misread the issue!

So vimade is working within a single split in tmux. But you are expecting it to dim the last active/current window when you switch tmux splits? I see this is an interesting idea/enhancement. I think from the vimade standpoint there would need to be some way to detect focus changes since FocusGained and FocusLost don't seem to work consistently in terminals and tmux, but maybe there is another plugin that can be used? I'll look into this some more later.

TaDaa commented 5 years ago

Any feedback / ideas welcome as well -- not an active tmux user, so if you have settings / plugins that are working to enable focus events let me know.

I think we could probably expose a new command to fade/unfade the active window and instructions for binding it to FocusLost/FocusGained

TaDaa commented 5 years ago

Currently this should work in nvim now (Vim is not supported for this feature -- FocusGained and FocusLost don't seem to work consistently there) -- it requires a plugin to enable FocusGained and FocusLost events in tmux as well as setting the appropriate tmux config (set -g focus-events on) in your tmux config.

There are a few options for plugins that enable focus, but I have verified at the very least this one is working: https://github.com/tmux-plugins/vim-tmux-focus-events

Additionally if tmux users can enable this functionality by adding the following to vimrc:

au! FocusLost * VimadeFadeActive
au! FocusGained * VimadeUnfadeActive

Let me know how it goes -- I will update the docs and readme with this later today

TaDaa commented 5 years ago

Changed vimade integration into this -- wasnt too happy with ForceFade naming..updated above as well

au! FocusLost * VimadeFadeActive
au! FocusGained * VimadeUnfadeActive
lanox commented 5 years ago

Hi @TaDaa

That seem to be working however vimade seem to be very slow when loading vim.

this is what i got on startup time.

Slowest 10 plugins (out of 26)~
      vimade    306.796 
   [runtime]    278.758 
     gruvbox    20.323  
    coc.nvim    12.408  
    nerdtree    10.344  
     [vimrc]    8.170   
 vim-airline    4.921   
 delimitMate    3.646   
vim-devicons    2.739   
      vim-go    1.636   
TaDaa commented 5 years ago

Did this just start from latest change? Also any buffers being preloaded during startup? They can add to vimade startup time.

lanox commented 5 years ago

@TaDaa no it was quiet slow for me to start off, no I do not have any buffers preloaded, If you have any other ideas how to trouble shoot this I can help.

TaDaa commented 4 years ago

startup time should now be improved (at least according to profiler) in #29 -- feel free to reopen if needed.