Created
July 1, 2018 15:45
-
-
Save ctaylo21/791ff2f4fdd3f9f12ec0e5e0c58a0f56 to your computer and use it in GitHub Desktop.
Example of dimming inactive windows in Neovim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Background colors for active vs inactive windows | |
hi ActiveWindow guibg=#17252c | |
hi InactiveWindow guibg=#0D1B22 | |
hi ActiveTerminal guibg=#333333 | |
" Call method on window enter | |
augroup WindowManagement | |
autocmd! | |
autocmd WinEnter * call Handle_Win_Enter() | |
augroup END | |
" Change highlight group of preview window when open | |
function! Handle_Win_Enter() | |
if &previewwindow | |
setlocal winhighlight=Normal:MarkdownError | |
elseif &buftype ==# 'terminal' | |
setlocal winhighlight=Normal:ActiveTerminal | |
else | |
setlocal winhighlight=Normal:ActiveWindow,NormalNC:InactiveWindow | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment