Skip to content

Instantly share code, notes, and snippets.

@ctaylo21
Last active May 5, 2022 10:02
Show Gist options
  • Save ctaylo21/c3620a945cee6fc3eb3cb0d7f57faf00 to your computer and use it in GitHub Desktop.
Save ctaylo21/c3620a945cee6fc3eb3cb0d7f57faf00 to your computer and use it in GitHub Desktop.
Neovim example of using winhighlight to dim inactive windows
" Background colors for active vs inactive windows
hi ActiveWindow guibg=#17252c
hi InactiveWindow guibg=#0D1B22
" Call method on window enter
augroup WindowManagement
autocmd!
autocmd WinEnter * call Handle_Win_Enter()
augroup END
" Change highlight group of active/inactive windows
function! Handle_Win_Enter()
setlocal winhighlight=Normal:ActiveWindow,NormalNC:InactiveWindow
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment