Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim: terminal window does not dim off #45

Open
WeibingChen17 opened this issue Jun 7, 2019 · 3 comments
Open

Vim: terminal window does not dim off #45

WeibingChen17 opened this issue Jun 7, 2019 · 3 comments

Comments

@WeibingChen17
Copy link

In Vim 8.1, a build-in term is support with the command :term. However, term windows does not dim off. Please look into it if you are available. Thanks for your efforts.

@blueyed
Copy link
Owner

blueyed commented Jun 7, 2019

It looks like ColorColumn is not used with terminal windows, but only checked quickly.

I am using Neovim myself mostly, which offers proper highlighting (not requiring the hack of using ColorColumn), and I am using the following myself:

    if 1 && exists('+winhighlight')
      function! s:configure_winhighlight()
        let ft = &filetype
        let bt = &buftype
        " Check white/blacklist.
        if &diff || (index(['dirvish'], ft) == -1
              \ && (index(['nofile', 'nowrite', 'acwrite', 'quickfix', 'help'], bt) != -1
              \     || index(['startify'], ft) != -1))
          set winhighlight=NormalNC:MyNormalWin
        else
          set winhighlight=NormalNC:MyInactiveWin
        endif
      endfunction
      augroup inactive_win
        au!
        au ColorScheme * hi link MyInactiveWin ColorColumn
        au FileType,BufWinEnter * call s:configure_winhighlight()
        if exists('##OptionSet')
          " TODO: does not work with :Gdiff - diffsplit does not trigger it, too!
          au OptionSet diff call s:configure_winhighlight()
        endif
      augroup END
    else
      Plug 'blueyed/vim-diminactive'
      let g:diminactive_enable_focus = 1
      " let g:diminactive_debug = 1
    endif

@blueyed blueyed changed the title Terminal window does not dim off Vim: terminal window does not dim off Jun 7, 2019
@chipsenkbeil
Copy link

@blueyed, given how well your snippet above works, would it make sense to incorporate that into the plugin itself for special handling in neovim? I found this issue seeking the same solution and am using neovim. For now, I've got your snippet in place of my Plug line for the plugin.

@nkgm
Copy link

nkgm commented Sep 20, 2020

+1 and thanks for your work.

Only just discovered this after several months of "crippled" Vim highlighting even though I am a Neovim user myself. This should be the default behavior when Neovim is detected, or if there's other considerations, at least documented properly. Right now the README reads:

It will only work with lines containing text (i.e. not ~ (non-lines)).

which shouldn't be an issue for Neovim users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants