This Neovim plugin generates color schemes for terminal emulators. It is primarily meant to help Neovim colorscheme creators to easily provide good-looking matching terminal colorschemes as extras. It can also be used by end users, to create an appropriate config for their terminal in case the colorscheme of their choice does not come with such extra themes on its own. Is your editor already pretty, but your terminal seems off? You might want to give termcolors.nvim a try!
termcolors.nvim output, additionally colorized by colorizer.lua
Install the plugin using your favorite plugin manager, for example [vim-plug]:
Plug 'psliwka/termcolors.nvim'
Alternatively, you may run this plugin without installing. For details, see the Using standalone section.
- Configure Neovim to use colorsheme of your choice
- Ensure your
'background'
is set correctly (i.e. is set todark
orlight
to match your actual colorscheme background) - Run
:TermcolorsShow
command and copy resulting code to your terminal's config file - Restart your terminal, or tell it to reload its config file (e.g.
ctrl+cmd+.
for kitty)
As this plugin is rarely needed in your daily work (you usually use it once,
when you switch your colorscheme and/or terminal program), it usually makes
sense to run in directly from the repository, without cluttering your
init.lua
. To do so:
- Clone this repository and
cd
into it - Run
make <TERMINAL NAME>
, for examplemake kitty
- Update your terminal configuration as described in the previous section
In order to configure Termcolors for your specific usage you can call
require'termcolors'.setup {
-- If you write your own plugin, you can declare it here so Termcolors
-- is aware of it
--
-- Otherwise you don't need to specify this option at all
plugins = {
["my_custom_plugin_name"] = require'path_to_your_plugin_module'
},
-- The name of the default plugin you wish to use.
-- If not specified, it'll be set to `kitty`
default_plugin = "my_custom_plugin_name"
}
Termcolors ships with three plugins:
- kitty
- alacritty
- termux
To call the generator for a sepecific plugin you can run
:TermcolorsShow <plugin_name>
and it'll generate output for the terminal that
plugin is for.
Calling :TermcolorsShow
without an argument will instead use the configured
default plugin to generate output
Right now, this project is in its infancy. It supports the following terminal emulators:
Additionally, its heuristics for detecting proper colors for various terminal elements may not work for all colorschemes. So far, it has been tested and confirmed to work for the following themes:
These two lists will hopefully expand in the future. Feel encouraged to submit PRs! π
Created by Piotr Εliwka.
Some color processing code (for generating pretty terminal's tabline background) has been taken from bufferline.nvim.