Skip to content

Automatically sync Neovim colorscheme with your terminal colorscheme

Notifications You must be signed in to change notification settings

kylesower/termcolors.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TermColors

Demo

termcolors.nvim is a Neovim plugin that will automatically set up a colorscheme that matches your terminal colors. Most people probably do not need this. If you want a simpler solution, you can set vim.o.termguicolors = false, adjust your highlight groups with ctermfg and ctermbg, and be on your way.

However, if you want the benefits of termguicolors but you still like to have your Neovim color scheme automatically follow your terminal colorscheme, then this plugin may be of use.

Installation

Requirements

You need a modern terminal emulator that supports OSC sequences. I recommend Ghostty, as it is the fastest one I tested when it comes to querying the terminal colors.

Lazy

{
    "https://gitlab.com/kylesower/termcolors.nvim",
    priority = 1000,
    lazy = false,
    opts = { 
        -- Specifies whether highlight groups can contain colors derived from main 
        -- 16 terminal colors. With this option disabled, you will have no
        -- visible CursorLine (as it might otherwise blend in with the text).
        term_colors_only = true,
        -- Between 0 and 1. When term_colors_only is false, specifies the amount 
        -- to adjust colors to distinguish from background/foreground.
        color_adjust_amount = 0.01,
    },
}

Usage

Set the colorscheme:

vim.cmd("colorscheme termcolors")

About

Automatically sync Neovim colorscheme with your terminal colorscheme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages