Home Explore Blog CI



neovim

1st chunk of `runtime/colors/README.txt`
4ac18611e3187bb4751c0df56ca62f147258c4dd57b4d9960000000100000903
README.txt for color scheme files

These files are used for the `:colorscheme` command.  They appear in the
"Edit/Color Scheme" menu in the GUI.

The colorschemes were updated for the Vim 9 release.  If you don't like the
changes you can find the old ones here:
https://github.com/vim/colorschemes/tree/master/legacy_colors


Hints for writing a color scheme file:

There are two basic ways to define a color scheme:

1. Define a new Normal color and set the 'background' option accordingly. >

	set background={light or dark}
	highlight clear
	highlight Normal ...
	...

2. Use the default Normal color and automatically adjust to the value of
   'background'. >

	highlight clear Normal
	set background&
	highlight clear
	if &background == "light"
	  highlight Error ...
	  ...
	else
	  highlight Error ...
	  ...
	endif

You can use `:highlight clear` to reset everything to the defaults, and then
change the groups that you want differently.  This will also work for groups
that are added in later versions of Vim.
Note that `:highlight clear` uses the value of 'background', thus set it
before this command.
Some attributes (e.g., bold) might be set in the defaults that you want
removed in your color scheme.  Use something like "gui=NONE" to remove the
attributes.

In case you want to set 'background' depending on the colorscheme selected,
this autocmd might be useful: >

     autocmd SourcePre */colors/blue_sky.vim set background=dark

Replace "blue_sky" with the name of the colorscheme.

In case you want to tweak a colorscheme after it was loaded, check out the
ColorScheme autocommand event.

To clean up just before loading another colorscheme, use the ColorSchemePre
autocommand event.  For example: >

	let g:term_ansi_colors = ...
	augroup MyColorscheme
	  au!
	  au ColorSchemePre * unlet g:term_ansi_colors
	  au ColorSchemePre * au! MyColorscheme
	augroup END

To customize a colorscheme use another name, e.g.  "~/.vim/colors/mine.vim",
and use ":runtime" to load the original colorscheme: >

	" load the "evening" colorscheme
	runtime colors/evening.vim
	" change the color of statements
	hi Statement ctermfg=Blue guifg=Blue

To see which highlight group is used where, see `:help highlight-groups` and
`:help group-name` .

You can use ":highlight" to find out the current colors.

Title: README for Vim Color Scheme Files
Summary
This document provides guidance on creating and customizing color scheme files for Vim, used by the `:colorscheme` command and the "Edit/Color Scheme" menu. It outlines two methods for defining color schemes, using `:highlight clear` to reset defaults, setting the 'background' option, and adjusting colors based on 'background' value. It also covers using autocmd events for specific color schemes, customizing existing schemes, and identifying highlight groups.