This is a plugin for Vim to dim inactive windows.
It provides two methods, which can be used independent:
With this method
colorcolumn gets set to a list containing every column for
the inactive windows, effectively resulting in a different background color
This is enabled by default and can be disabled, e.g. if you want to use the syntax method only:
let g:diminactive_use_colorcolumn = 0
Vim's ColorColumn highlighting group is being used for this, which is red by default, and pink if undefined):
:hi ColorColumn ColorColumn xxx term=reverse ctermbg=1 guibg=DarkRed
You can define a custom color yourself, in case your colorscheme does not use something sensible:
:hi ColorColumn ctermbg=0 guibg=#eee8d5
There is an option to disable syntax highlighting for inactive windows. It is disabled by default, and you can enable it using:
let g:diminactive_use_syntax = 1
You can enable (un)dimming windows on Vim's
events by adding the following line to your
.vimrc (defaults to 0):
let g:diminactive_enable_focus = 1
NOTE: If you are using tmux it is recommended to install the
vim-tmux-focus-events plugin for Vim and add
set -g focus-events on
~/.tmux.conf to enable better support for Vim's
FocusGained events in tmux.
The following commands are provided to control it:
DimInactive / DimInactiveOn
Control on the window level
Dimming can be controlled on the window level, which overrides any buffer-local configuration (a buffer can be displayed in multiple windows).
Disable for this window.
Enable for this window.
Reset config on window level.
Control on the buffer level
Dimming can be controlled on the buffer level. This gets overridden by window-local configuration (a buffer can be displayed in multiple windows).
Disable for this buffer.
Enable for this buffer.
Reset config on buffer level.
You can disable the dimming based on
filetype with the
A list of buffer types where dimming gets disabled. Default:
let g:diminactive_buftype_blacklist = ['nofile', 'nowrite', 'acwrite', 'quickfix', 'help']
A list of filetypes where dimming gets disabled. Default:
let g:diminactive_filetype_blacklist = ['startify']
A list of buffer types where dimming gets enabled (overrides the blacklist). Default:
let g:diminactive_buftype_whitelist = 
A list of filetypes where dimming gets enabled (overrides the whitelist). Default:
let g:diminactive_filetype_whitelist = ['dirvish']
- It might slow down redrawing of windows.
- It will only work with lines containing text (i.e. not