Skip to content

Commit

Permalink
Update runtime files, new color schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
brammool committed May 14, 2022
1 parent 2e444bb commit 30ab04e
Show file tree
Hide file tree
Showing 34 changed files with 7,431 additions and 2,016 deletions.
19 changes: 19 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ runtime/autoload/tar.vim @cecamp
runtime/autoload/vimball.vim @cecamp
runtime/autoload/xmlformat.vim @chrisbra
runtime/autoload/zip.vim @cecamp
runtime/colors/blue.vim @habamax @romainl @neutaaaaan
runtime/colors/darkblue.vim @habamax @romainl @neutaaaaan
runtime/colors/default.vim @habamax @romainl @neutaaaaan
runtime/colors/delek.vim @habamax @romainl @neutaaaaan
runtime/colors/desert.vim @habamax @romainl @neutaaaaan
runtime/colors/elflord.vim @habamax @romainl @neutaaaaan
runtime/colors/evening.vim @habamax @romainl @neutaaaaan
runtime/colors/industry.vim @habamax @romainl @neutaaaaan
runtime/colors/koehler.vim @habamax @romainl @neutaaaaan
runtime/colors/morning.vim @habamax @romainl @neutaaaaan
runtime/colors/murphy.vim @habamax @romainl @neutaaaaan
runtime/colors/pablo.vim @habamax @romainl @neutaaaaan
runtime/colors/peachpuff.vim @habamax @romainl @neutaaaaan
runtime/colors/ron.vim @habamax @romainl @neutaaaaan
runtime/colors/shine.vim @habamax @romainl @neutaaaaan
runtime/colors/slate.vim @habamax @romainl @neutaaaaan
runtime/colors/tools @habamax @romainl @neutaaaaan
runtime/colors/torte.vim @habamax @romainl @neutaaaaan
runtime/colors/zellner.vim @habamax @romainl @neutaaaaan
runtime/compiler/checkstyle.vim @dkearns
runtime/compiler/cm3.vim @dkearns
runtime/compiler/cucumber.vim @tpope
Expand Down
67 changes: 57 additions & 10 deletions runtime/colors/README.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
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.
"Edit/Color Scheme" menu in the GUI.


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
Expand All @@ -28,7 +30,7 @@ There are two basic ways to define a color scheme:
endif

You can use ":highlight clear" to reset everything to the defaults, and then
change the groups that you want differently. This also will work for groups
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.
Expand All @@ -38,14 +40,17 @@ 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!
Expand All @@ -54,38 +59,80 @@ autocommand event. For example:
augroup END

To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
and use `:runtime` to load the original colorscheme:
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, find the help for
"highlight-groups" and "group-name".
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. Exception: the
ctermfg and ctermbg values are numbers, which are only valid for the current
terminal. Use the color names instead. See ":help cterm-colors".
terminal. Use the color names instead for better portability. See
":help cterm-colors".

The default color settings can be found in the source file src/highlight.c.
The default color settings can be found in the source file src/syntax.c.
Search for "highlight_init".

If you think you have a color scheme that is good enough to be used by others,
please check the following items:

- Source the $VIMRUNTIME/colors/tools/check_colors.vim script to check for
common mistakes.
- Does it work in a color terminal as well as in the GUI?

- Does it work in a color terminal as well as in the GUI? Is it consistent?

- Is "g:colors_name" set to a meaningful value? In case of doubt you can do
it this way:

let g:colors_name = expand('<sfile>:t:r')

- Is 'background' either used or appropriately set to "light" or "dark"?

- Try setting 'hlsearch' and searching for a pattern, is the match easy to
spot?

- Split a window with ":split" and ":vsplit". Are the status lines and
vertical separators clearly visible?

- In the GUI, is it easy to find the cursor, also in a file with lots of
syntax highlighting?

- In general, test your color scheme against as many filetypes, Vim features,
environments, etc. as possible.

- Do not use hard coded escape sequences, these will not work in other
terminals. Always use color names or #RRGGBB for the GUI. See v:colornames
for details on how to define your own color names.
terminals. Always use #RRGGBB for the GUI.

- When targetting 8-16 colors terminals, don't count on "darkblue" to be blue
and dark, or on "2" to be even vaguely reddish. Names are more portable
than numbers, though.

- When targetting 256 colors terminals, prefer colors 16-255 to colors 0-15
for the same reason.

- Typographic attributes (bold, italic, underline, reverse, etc.) are not
universally supported. Don't count on any of them.

- Is "g:terminal_ansi_colors" set to a list of 16 #RRGGBB values?

- Try to keep your color scheme simple by avoiding unnecessary logic and
refraining from adding options. The best color scheme is one that only
requires:

colorscheme foobar

The color schemes distributed with Vim are built with lifepillar/colortemplate
(https://github.com/lifepillar/vim-colortemplate). It is therefore highly
recommended.

If you would like your color scheme to be distributed with Vim, make sure
that:

- it satisfies the guidelines above,
- it was made with colortemplate,

and join us at vim/colorschemes: (https://github.com/vim/colorschemes).
Loading

4 comments on commit 30ab04e

@jcoglan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks as though this commit broke Vim themes in iTerm on macOS when TERM is set to xterm-256color or screen-256color. Until this update, Vim themes respected the terminal's colour palette, but they no longer do. Is there a recommended way of fixing this?

@vim-ml
Copy link

@vim-ml vim-ml commented on 30ab04e May 23, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisbra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend discussing those issues within https://github.com/vim/colorschemes In particular, there is already: issue 169 and related issues (the later ones). Please check if you are affected by those and join the discussion.

@jcoglan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisbra :)

Please sign in to comment.