72

GitHub - TaDaa/vimade: An eye friendly plugin that fades your inactive buffers a...

 5 years ago
source link: https://github.com/TaDaa/vimade
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

vimade

An eye catching plugin that fades your inactive buffers and preserves syntax highlighting!!!!
Screenshots

Fade inactive windows

Change the colorscheme and fadelevel on the fly

Fade/Unfade diffs together

Compatibility
  • gui vim8+
  • gui nvim
  • xterm 256 colors
  • leave an issue if you need a different terminal palette supported
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 treaded 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:

Bundle 'TaDaa/vimade'
Config

Vimade is initialized with the following configuration:

let g:vimade = {
  \ "normalid": '',
  \ "basefg": '',
  \ "basebg": '',
  \ "fadelevel": 0.4,
  \ "colbufsize": 30,
  \ "rowbufsize": 30,
  \ "checkinterval": 32,
}
  • vimade.normalid - if not specified, the normalid is determined when vimade is first loaded. normalid provides the id of the "Normal" highlight which is used to calculate fading. You can override this config with another highlight group.
  • vimade.basefg - basefg is a hexidecimal color (in gui) and a 256 color code (in term). By default basefg is calculated as the "Normal" highlight guifg or ctermfg.
  • vimade.basebg - basebg is a hexidecimal color (in gui) and a 256 color code (in term). basebg is used as the color that text is faded against. You can override this config with another hexidecimal color.
  • vimade.fadelevel - amount of fading applied between text and basebg. 0 will make the text the same color as the background and 1 applies no fading. The default value is 0.4. If you are using terminal, you may need to tweak this value to get better results.
  • vimade.rowbufsize - the number of rows above and below of the determined scroll area that should be precalculated. Default is 30.
  • vimade.colbufsize - the number of cols left and right of the determined scroll area that should be precalculated. Default is 30.
  • vimade.checkinterval - the amount of time in milliseconds that vimade should check the screen for changes. This config is mainly used to detect resize and scroll changes that occur on inactive windows. Default is 32.
Example

this example reduces the amount of fading applied to text

let g:vimade = {}
let g:vimade.fadelevel = 0.7
Features
  • Fade inactive buffers
  • Fade/Unfade diffs together
  • Automatically adjust to colorscheme changes
  • Automatically adjust to basebg changes
  • Automatically adjust to fadelevel changes
  • React to window resize + scroll changes
  • Vim8+ (gui)
  • Neovim (gui)
  • Python3
  • Python2
  • 256 color terminal support (Xterm)
  • Secondary buffer window highlighting
  • Vim Documentation/Help
Todo
  • Support other terminals palletes? -- Open an issue if you need support for a different palette
  • Improve terminal color rounding for grays

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK