Update instructions; add support for setting vim.g.bg

This commit is contained in:
Iron_E 2020-09-05 11:30:54 -04:00
parent f868d2446e
commit f0786436c0
No known key found for this signature in database
GPG Key ID: B0B37DE7EDC2335F
1 changed files with 19 additions and 10 deletions

View File

@ -47,10 +47,16 @@ lua << EOF
]] ]]
--[[ Step 2: Information --[[ 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' 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 --[[ Step 3: Colors
Next you will define all of the colors that you will use for the color scheme. 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 ```lua
<color name> = { -- Give each color a distinctive name. <color name> = { -- Give each color a distinctive name.
'#<hex color code>', -- Hexadecimal color used in GVim/MacVim or 'NONE'. '#<hex color code>', -- Hexadecimal color used in GVim/MacVim or 'NONE'.
<256-bit color code>, -- Integer 0255 used by terminals supporting 256 colors or 'NONE'. <16-bit color code>, -- Integer 0255 used by terminals supporting 256 colors or 'NONE'.
'<16-bit color code>' -- color name used by less capable color terminals, can be 'darkred', '<ANSI color name>' -- color name used by less capable color terminals, can be 'darkred',
'red', 'darkgreen', 'green', 'darkyellow', 'yellow', 'darkblue', 'red', 'darkgreen', 'green', 'darkyellow', 'yellow', 'darkblue',
'blue', 'darkmagenta', 'magenta', 'black', 'darkgrey', 'grey', 'blue', 'darkmagenta', 'magenta', 'black', 'darkgrey', 'grey',
'white', or 'NONE' 'white', or 'NONE'
@ -114,31 +120,34 @@ local purple_light = {'#af60af', 63, 'magenta'}
```lua ```lua
<highlight group name> = { <highlight group name> = {
bg=<color>, -- The color used for background 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' fg=<color>, -- The color used for foreground color, or use `NONE`, `FG` or `BG`
blend=<integer> -- The |highlight-blend| value, if one is desired. 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 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>]}) 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 ```lua
<highlight group name> = '<highlight group name>' <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 ```lua
SpellBad = { --name of the highlight group SpellBad = { --name of the highlight group
bg='NONE', -- background color bg=NONE, -- background color
fg=red, -- foureground color fg=red, -- foureground color
style={ -- the style style={ -- the style
'undercurl', -- undercurl (squiggly line) 'undercurl', -- undercurl (squiggly line)
color=red -- the color of the undercurl color=red -- the color of the undercurl
} }
} },
SpellWorse = 'SpellBad'
``` ```
If you weren't satisfied with undercurl, and also wanted another effect, you can 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: |Replace-mode| will probably be useful here.
NOTE: /As long as you do not remove any highlight groups or colors/, you can safely 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 For example, programming languages almost exclusively link to the 1st
and 2nd sections, so as long as you define everything there you will automatically 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 be defining the rest of the highlights, which is one of the benefits of using