akinsho / tint.nvim

Dim inactive windows in Neovim using window-local highlight namespaces.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

👓 tint.nvim

Tint inactive windows in Neovim using window-local highlight namespaces.

🚧 Important

This is still a work in progress, create an issue if you find any.

This feature was added via !13457. Your version of Neovim must include this change in order for this to work.

🎬 Demo

tint

❔ About

Using window-local highlight namespaces, this plugin will iterate over each highlight group in the active colorscheme when the plugin is setup and either brighten or darken each value (based on what you configure) for inactive windows.

The plugin is responsive to changes in colorscheme via :h ColorScheme.

🔌 Setup

See a description of all options in Options.

-- Default configuration
require("tint").setup()

-- Override defaults
require("tint").setup({
  bg = true,  -- Tint background portions of highlight groups
  amt = -40,  -- Darken colors, use a positive value to brighten
  ignore = { "WinSeparator", "Status.*" },  -- Highlight group patterns to ignore, see `string.find`
  ignorefunc = function(winid)
    local buf = vim.api.nvim_win_get_buf(winid)
    local buftype vim.api.nvim_buf_get_option(buf, "buftype")

    if buftype == "terminal" then
      -- Do not tint `terminal`-type buffers
      return true
    end

    -- Tint the window
    return false
  end
})

⚙️ Options

Option Default Description
bg false Whether or not to tint background portions of highlight groups.
amt -40 Amount to change current colorscheme. Negative values darken, positive values brighten.
saturation 0.7 The amount of saturation to preserve, in the range of [0.0, 1.0].
ignore {} A list of patterns (supplied to string.find) for highlight group names to ignore tinting for.
ignorefunc nil A function that will be called for each window to discern whether or not it should be tinted. Arguments are are (winid), return false or nil to tint a window, anything else to not tint it.

❤️ Acknowledgements

  • The harder part of the plugin to dim colors from StackOverflow
  • The general idea from Shade.nvim
  • bfredl for making everyones life easier

About

Dim inactive windows in Neovim using window-local highlight namespaces.

License:MIT License


Languages

Language:Lua 100.0%