vimade
An eye catching plugin that fades your inactive buffers and preserves syntax highlighting!!!!
Screenshots
Fade inactive windows
Fade using custom tints
Change the fadelevel
Fade signs (example below does 4000 signs)
Fade/Unfade diffs together
Fade/Unfade using word wrap
Fade using NormalNC (NVIM only)
Features
- [X] Fade inactive buffers
- [X] Fade/Unfade diffs together
- [X] Automatically adjust to colorscheme changes
- [X] Automatically adjust to basebg changes
- [X] Automatically adjust to fadelevel changes
- [X] Automatically adjust to &syntax changes
- [X] React to window resize + scroll changes
- [X] Apply custom tints (not necessarily your background color to text)
- [X] Vim8+
- [X] Neovim + also plays well with NormalNC
- [X] Python3
- [X] Python2
- [X] GUI Neovim + GUI Vim
- [X] 256 color terminal support (Xterm)
- [X] Toggle vimade on/off (VimadeEnable, VimadeDisable, VimadeToggle)
- [X] Supports terminal backgrounds for Vim8(not nvim yet) and iTerm, Tilix, Kitty, Gnome, rxvt
- [X] Wrapped Text
- [X] Folded Text (detects folded rows and fades above/below -- see VimadeOverrideFolded for highlight recommendations on hi Folded)
- [X] :ownsyntax support
- [X] Sign column support
- [X] Vim Documentation/Help
- [ ] Secondary buffer window highlighting
Whats coming?
- [ ] Helpers to fade Vim global highlights (e.g VertSplit, Folded, NonText, etc -- will alleviate issues with high contrast in some colorschemes)
- [ ] Configurable FadeLevel per buffer
- [ ] Conditional interface to determine which windows/buffers get faded/unfaded.
- [ ] Performance Improvements
- [ ] Limelight with syntax highlighting
- [ ] Improve terminal color rounding for grays
- [ ] Code cleanup
- [ ] Tests
What/Why?
- Vimade fades inactive/unfocused buffer text and removes the fade from focused buffers.
- Vimade diffs and multiple windows linked to the same buffer are treated as a group that highlights/unhighlights together.
- Vimade reacts to scrolling, tab changes, colorscheme changes, diff, and much more!
Install
Add TaDaa/vimade
to your vimrc -- you can use any plugin manager e.g:
Plug 'TaDaa/vimade'
Config
Vimade is initialized with the following configuration. Vimade will react to configuration changes on the fly:
let g:vimade = {
\ "normalid": '',
\ "normalncid": '',
\ "basefg": '',
\ "basebg": '',
\ "fadelevel": 0.4,
\ "colbufsize": 15, "15 is the default for gui vim, 5 is the default for terminals and gvim
\ "rowbufsize": 15, "15 is the default for gui vim, 0 is the default for terminals and gvim
\ "checkinterval": 100, "100 is the default for gui vim, 500 is the default for terminals and neovim
\ "usecursorhold": 0, "0 is default, but will automatically set to 1 for Windows GVIM
\ "detecttermcolors": 0,
\ 'enablescroll': 1, "1 is the default for gui vim, but will automatically set to 0 for terminals and Windows GVIM.
\ 'enablesigns': g:vimade_features.has_signs_priority, "enabled for vim/nvim versions that support sign priority. Older vim/nvim versions may suffer performance issues
\ 'signsid': 13100,
\ 'signsretentionperiod': 4000,
\ 'fademinimap': 1,
\ 'fadepriority': 10,
\ 'groupdiff': 1,
\ 'groupscrollbind': 0,
\ 'enablefocusfading': 0,
\ 'enablebasegroups': 1,
\ 'enabletreesitter' : 0, "EXPERIMENTAL FEATURE - 0 is the default, enables support for treesitter highlights"
\ 'basegroups': ['Folded', 'Search', 'SignColumn', 'LineNr', 'CursorLine', 'CursorLineNr', 'DiffAdd', 'DiffChange', 'DiffDelete', 'DiffText', 'FoldColumn', 'Whitespace']
}
Config Example(s)
Always remember to first set the global vimade object (let g:vimade={}
)
this example reduces the amount of fading applied to text*
let g:vimade = {}
let g:vimade.fadelevel = 0.7
let g:vimade.enablesigns = 1
Commands
- VimadeEnable - Turns vimade on (Vimade is on by default)
- VimadeDisable - Turns vimade off and unfades all buffers
- VimadeToggle - Toggles between on/off states
- VimadeRedraw - Forces vimade to redraw fading for every window.
- VimadeFadeLevel [0.0-1.0] - Sets the FadeLevel config and forces an immediate redraw.
- VimadeFadePriority [0+] - Sets the FadePriority config and forces an immediate redraw.
- VimadeInfo - Provides debug information for Vimade. Please include this info in bug reports
- VimadeWinDisable - Disables fading for the current window
- VimadeWinEnable - Enables fading for the current window
- VimadeBufDisable - Disables fading for the current buffer
- VimadeBufEnable - Enables fading for the current buffer
- VimadeFadeActive - Fades the current active window
- VimadeUnfadeActive - Unfades the current active window
- VimadeOverrideFolded - Overrides the Folded highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include Folded highlights that are distracting in faded windows.
- VimadeOverrideSignColumn - Overrides the SignColumn highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include SignColumn highlights that are distracting in faded windows.
- VimadeOverrideLineNr - Overrides the LineNr highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include LineNr highlights that are distracting in faded windows.
- VimadeOverrideSplits - Overrides the VertSplit highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include VertSplit highlights that are distracting in faded windows.
- VimadeOverrideNonText - Overrides the NonText highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include NonText highlights that are distracting in faded windows.
- VimadeOverrideEndOfBuffer - Overrides the EndOfBuffer highlight by creating a link to the Vimade base fade. This should produce acceptable results for colorschemes that include EndOfBuffer highlights that are distracting in faded windows.
- VimadeOverrideAll - Combines all VimadeOverride commands.
FAQ/Help
I am using GVIM and my mappings are not working
- Add
let g:vimade.usecursorhold=1
to your vimrc
What about Vim < 8?
- Vim 7.4 is currently untested/experimental, but should work if you add
let g:vimade.usecursorhold=1
to your vimrc
My colors look off in terminal mode!
- Make sure that you either use a supported terminal or colorscheme or manually define the fg and bg for 'Normal'. You can also manually define the tint in your vimade config (g:vimade.basebg and g:vimade.basefg)
Tmux is not working!
- Vimade only works in a 256 or higher color mode and by default TMUX may set t_Co to 8. it is recommended that you set
export TERM=xterm-256color
before starting vim. You can also set set termguicolors
inside vim if your term supports it for an even more accurate level of fading.
Vim becomes slow when completions ar visible/changing (typically noticeable when a large number of buffers are open and autocomplete is running). Neovim does not seem to suffer from the same performance degradation.
- This issue seems to be due to redraws that occur as the pum content changes. The best way to lessen the effect is to add `au! CompleteChanged redraw` to your vimrc. The user redraw can force Vim to be more responsive in this scenario*