Update instructions; add support for setting vim.g.bg
This commit is contained in:
parent
f868d2446e
commit
f0786436c0
|
@ -47,10 +47,16 @@ lua << EOF
|
|||
]]
|
||||
|
||||
--[[ Step 2: Information
|
||||
This is the name of your colorscheme which will be used as per |g:colors_name|.
|
||||
In this step you will define information that helps Neovim process:
|
||||
|
||||
1. How users access your colorscheme;
|
||||
2. How your colorscheme should be rendered.
|
||||
]]
|
||||
|
||||
-- This is the name of your colorscheme which will be used as per |g:colors_name|.
|
||||
vim.g.colors_name = 'highlite'
|
||||
-- This is the kind of colorscheme you are creating. Either 'light' or 'dark'
|
||||
vim.o.background = 'dark'
|
||||
|
||||
--[[ Step 3: Colors
|
||||
Next you will define all of the colors that you will use for the color scheme.
|
||||
|
@ -60,8 +66,8 @@ vim.g.colors_name = 'highlite'
|
|||
```lua
|
||||
<color name> = { -- Give each color a distinctive name.
|
||||
'#<hex color code>', -- Hexadecimal color used in GVim/MacVim or 'NONE'.
|
||||
<256-bit color code>, -- Integer 0–255 used by terminals supporting 256 colors or 'NONE'.
|
||||
'<16-bit color code>' -- color name used by less capable color terminals, can be 'darkred',
|
||||
<16-bit color code>, -- Integer 0–255 used by terminals supporting 256 colors or 'NONE'.
|
||||
'<ANSI color name>' -- color name used by less capable color terminals, can be 'darkred',
|
||||
'red', 'darkgreen', 'green', 'darkyellow', 'yellow', 'darkblue',
|
||||
'blue', 'darkmagenta', 'magenta', 'black', 'darkgrey', 'grey',
|
||||
'white', or 'NONE'
|
||||
|
@ -114,31 +120,34 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
|||
|
||||
```lua
|
||||
<highlight group name> = {
|
||||
bg=<color>, -- The color used for background color, or use 'NONE', 'fg' or 'bg'
|
||||
fg=<color>, -- The color used for foreground color, or use 'NONE', 'fg' or 'bg'
|
||||
bg=<color>, -- The color used for background color, or use `NONE`, `FG` or `BG`
|
||||
fg=<color>, -- The color used for foreground color, or use `NONE`, `FG` or `BG`
|
||||
blend=<integer> -- The |highlight-blend| value, if one is desired.
|
||||
-- Style can be 'bold', 'italic', and more. See |attr-list| for more information. It can also have a color, and/or multiple <cterm>s.
|
||||
style=<cterm>|{<cterm> [, <cterm>] [color=<color>]})
|
||||
}
|
||||
```
|
||||
|
||||
Or you can link an highlight group to another.
|
||||
TIP: Any fields which are set to `NONE` can be safely left out.
|
||||
|
||||
You can also link one highlight group to another:
|
||||
|
||||
```lua
|
||||
<highlight group name> = '<highlight group name>'
|
||||
```
|
||||
|
||||
Here is an example:
|
||||
Here is an example to define `SpellBad` and then link some new group `SpellWorse` to it:
|
||||
|
||||
```lua
|
||||
SpellBad = { -- ← name of the highlight group
|
||||
bg='NONE', -- background color
|
||||
bg=NONE, -- background color
|
||||
fg=red, -- foureground color
|
||||
style={ -- the style
|
||||
'undercurl', -- undercurl (squiggly line)
|
||||
color=red -- the color of the undercurl
|
||||
}
|
||||
}
|
||||
},
|
||||
SpellWorse = 'SpellBad'
|
||||
```
|
||||
|
||||
If you weren't satisfied with undercurl, and also wanted another effect, you can
|
||||
|
@ -164,7 +173,7 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
|||
NOTE: |Replace-mode| will probably be useful here.
|
||||
|
||||
NOTE: /As long as you do not remove any highlight groups or colors/, you can safely
|
||||
ignore any highlight groups that are `link`ed others.
|
||||
ignore any highlight groups that are `link`ed to others.
|
||||
For example, programming languages almost exclusively link to the 1st
|
||||
and 2nd sections, so as long as you define everything there you will automatically
|
||||
be defining the rest of the highlights, which is one of the benefits of using
|
||||
|
|
Loading…
Reference in New Issue