Compare commits
18 Commits
master
...
paper-toni
Author | SHA1 | Date |
---|---|---|
Ray Elliott | c7f1772d65 | |
Ray Elliott | 54641988db | |
Ray Elliott | 8cdef01d65 | |
Ray Elliott | c0546d77bd | |
Ray Elliott | ff8abed01e | |
Ray Elliott | 42ae2fd244 | |
Ray Elliott | ddc39fb89c | |
Ray Elliott | 1bb889e688 | |
Ray Elliott | ad2242c48c | |
Ray Elliott | 0209283a8f | |
Ray Elliott | 17e8a2cdaf | |
Ray Elliott | 9cf8c5df17 | |
Ray Elliott | f25afbef0f | |
Ray Elliott | 7d91db681c | |
Ray Elliott | b03c0dd83c | |
Ray Elliott | 0006161c82 | |
Ray Elliott | 51a4eee4b3 | |
Ray Elliott | cd13880d2c |
48
README.md
48
README.md
|
@ -1,4 +1,4 @@
|
|||
# nvim-highlite
|
||||
# nvim-paper-tonic
|
||||
|
||||
## Default Settings Preview
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
|||
|
||||
## Introduction
|
||||
|
||||
`nvim-highlite` is a colorscheme template repository for Neovim 0.5+.
|
||||
`nvim-paper-tonic` is a colorscheme template repository for Neovim 0.5+.
|
||||
|
||||
This template's _defaults_ focus on:
|
||||
|
||||
|
@ -32,12 +32,12 @@ The only prerequisite is Neovim 0.5+
|
|||
|
||||
### Creating Your Own
|
||||
|
||||
1. Fork this repository, or clone it with `git clone https://github.com/Iron-E/nvim-highlite`.
|
||||
2. Follow the instructions in [`colors/highlite.vim`](colors/highlite.vim).
|
||||
1. Fork this repository, or clone it with `git clone https://github.com/Iron-E/nvim-paper-tonic`.
|
||||
2. Follow the instructions in [`colors/paper-tonic.vim`](colors/paper-tonic.vim).
|
||||
* If you are on a Unix system, use the [setup script](setup.sh) like so:
|
||||
```sh
|
||||
chmod +x ./setup.sh
|
||||
./setup.sh highlite <colorscheme>
|
||||
./setup.sh paper-tonic <colorscheme>
|
||||
```
|
||||
Where `<colorscheme>` is the name of your desired colorscheme.
|
||||
* If you are on Windows, rename the files manually.
|
||||
|
@ -61,7 +61,7 @@ Whenever you want to update from then on, you can run the [update script](update
|
|||
|
||||
return require('packer').startup {function(use)
|
||||
use {'wbthomason/packer.nvim', opt=true}
|
||||
use 'Iron-E/nvim-highlite'
|
||||
use 'Iron-E/nvim-paper-tonic'
|
||||
end}
|
||||
```
|
||||
2. Specify this colorscheme as your default colorscheme in the `init.vim`:
|
||||
|
@ -70,29 +70,29 @@ Whenever you want to update from then on, you can run the [update script](update
|
|||
" This plugin is fully compatible with 8-bit, 16-bit, and 24-bit colors.
|
||||
set termguicolors
|
||||
" Use the colorscheme
|
||||
colorscheme highlite
|
||||
colorscheme paper-tonic
|
||||
```
|
||||
Or using `init.lua`:
|
||||
```lua
|
||||
vim.opt.termguicolors = true
|
||||
vim.api.nvim_command 'colorscheme highlite'
|
||||
vim.api.nvim_command 'colorscheme paper-tonic'
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This repository in itself is an example of how to use `nvim-highlite`. Aside from this, the following colorschemes are built using `nvim-highlite`:
|
||||
This repository in itself is an example of how to use `nvim-paper-tonic`. Aside from this, the following colorschemes are built using `nvim-paper-tonic`:
|
||||
|
||||
* (if you use this, open an issue and I'll add it here!)
|
||||
|
||||
### As Dependency
|
||||
|
||||
Below is an example of how to use `nvim-highlite` as a dependency.
|
||||
Below is an example of how to use `nvim-paper-tonic` as a dependency.
|
||||
|
||||
* See `:h highlite-usage` for more.
|
||||
* See `:h paper-tonic-usage` for more.
|
||||
|
||||
```lua
|
||||
-- Import nvim-highlite
|
||||
local highlite = require('highlite')
|
||||
-- Import nvim-paper-tonic
|
||||
local paper-tonic = require('paper-tonic')
|
||||
|
||||
-- First, define some colors
|
||||
local red = {'#FF0000', 1, 'red'}
|
||||
|
@ -100,23 +100,23 @@ local black = {'#000000', 0, 'black'}
|
|||
local white = {'#FFFFFF', 255, 'white'}
|
||||
|
||||
-- Highlight 'Identifier'
|
||||
highlite.highlight('Identifier', {bg=red, fg=black, style='bold'})
|
||||
paper-tonic.highlight('Identifier', {bg=red, fg=black, style='bold'})
|
||||
|
||||
-- Highlight 'Function' conditionally according to background color.
|
||||
highlite.highlight('Function', {bg=black, fg=red, light={bg=white}})
|
||||
paper-tonic.highlight('Function', {bg=black, fg=red, light={bg=white}})
|
||||
|
||||
-- Link 'Example' to 'Identifier'
|
||||
highlite.highlight('Example', 'Identifier')
|
||||
paper-tonic.highlight('Example', 'Identifier')
|
||||
|
||||
-- You can also reference specific attributes of another highlight group.
|
||||
highlite.highlight('AnotherExample', {bg=highlite.group'SpellBad'.bg, fg=white})
|
||||
paper-tonic.highlight('AnotherExample', {bg=paper-tonic.group'SpellBad'.bg, fg=white})
|
||||
```
|
||||
|
||||
### As Template
|
||||
|
||||
Below is an example of how to use `nvim-highlite` as a template.
|
||||
Below is an example of how to use `nvim-paper-tonic` as a template.
|
||||
|
||||
* See [`highlite.vim`](colors/highlite.vim) for more.
|
||||
* See [`paper-tonic.vim`](colors/paper-tonic.vim) for more.
|
||||
|
||||
```lua
|
||||
-- First, define some colors
|
||||
|
@ -146,7 +146,7 @@ local highlight_groups = {
|
|||
When using this plugin, it is important to know that you can't just run `:hi` on a highlight group and expect that its changes will be retained. You must attach them to the `ColorScheme` `autocmd` event, as shown below:
|
||||
|
||||
```vim
|
||||
packadd nvim-highlite
|
||||
packadd nvim-paper-tonic
|
||||
set termguicolors "optional
|
||||
|
||||
" WRONG! Don't do this.
|
||||
|
@ -154,14 +154,14 @@ hi! Error guifg=#000000 guibg=#FFFFFF
|
|||
|
||||
" Do this instead.
|
||||
augroup Highlite
|
||||
" You can also use `highlite.highlight()` instead of `:hi!`
|
||||
autocmd ColorScheme highlite hi! Error guifg=#000000 guibg=#FFFFFF
|
||||
" You can also use `paper-tonic.highlight()` instead of `:hi!`
|
||||
autocmd ColorScheme paper-tonic hi! Error guifg=#000000 guibg=#FFFFFF
|
||||
augroup end
|
||||
|
||||
colorscheme highlite
|
||||
colorscheme paper-tonic
|
||||
```
|
||||
|
||||
Of course, substitute `highlite` with the name of your colorscheme.
|
||||
Of course, substitute `paper-tonic` with the name of your colorscheme.
|
||||
|
||||
> Why am I receiving `E5108: Error executing lua [string ":lua"]:1: module '<colorscheme>' not found`?
|
||||
|
||||
|
|
1031
colors/highlite.lua
1031
colors/highlite.lua
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,58 +1,58 @@
|
|||
*highlite.txt* Plugin for maintaining colorschemes
|
||||
*highlite*
|
||||
*paper-tonic.txt* Plugin for maintaining colorschemes
|
||||
*paper-tonic*
|
||||
|
||||
Author: Iron-E – https://github.com/Iron-E & https://gitlab.com/Iron_E
|
||||
Web: https://github.com/Iron-E/nvim-highlite
|
||||
Web: https://github.com/Iron-E/nvim-paper-tonic
|
||||
|
||||
|highlite| is a plugin for creating and maintaining colorschemes. It can
|
||||
|paper-tonic| is a plugin for creating and maintaining colorschemes. It can
|
||||
be configured by cloning the repository and following the README, or
|
||||
individually used to comprehensively highlight groups with its functions.
|
||||
|
||||
==============================================================================
|
||||
TABLE OF CONTENTS *highlite-toc*
|
||||
TABLE OF CONTENTS *paper-tonic-toc*
|
||||
|
||||
1. Requirements ............ |highlite-requirements|
|
||||
2. Usage ................... |highlite-usage|
|
||||
3. FAQ ..................... |highlite-faq|
|
||||
1. Requirements ............ |paper-tonic-requirements|
|
||||
2. Usage ................... |paper-tonic-usage|
|
||||
3. FAQ ..................... |paper-tonic-faq|
|
||||
|
||||
==============================================================================
|
||||
REQUIREMENTS *highlite-requirements*
|
||||
REQUIREMENTS *paper-tonic-requirements*
|
||||
|
||||
- Neovim 0.5+
|
||||
|
||||
==============================================================================
|
||||
USAGE *highlite-usage*
|
||||
USAGE *paper-tonic-usage*
|
||||
|
||||
*highlite.group()*
|
||||
`highlite`.group({group_name}) *highlite-group()*
|
||||
*paper-tonic.group()*
|
||||
`paper-tonic`.group({group_name}) *paper-tonic-group()*
|
||||
|
||||
Convert a pre-existing |highlight-group| into a format that |highlite|
|
||||
Convert a pre-existing |highlight-group| into a format that |paper-tonic|
|
||||
recognizes.
|
||||
|
||||
Note: the |highlight-group| must have been either:
|
||||
- |:highlight|ed.
|
||||
- |highlite-highlight|ed.
|
||||
- |paper-tonic-highlight|ed.
|
||||
|
||||
Parameters: ~
|
||||
{group_name} A `string` which is the |highlight-group| to convert.
|
||||
|
||||
Return: ~
|
||||
- A `table` which can be used as the {attributes} parameter for
|
||||
|highlite.highlight()|.
|
||||
|paper-tonic.highlight()|.
|
||||
|
||||
Example: ~
|
||||
>
|
||||
local highlite = require('highlite')
|
||||
local paper-tonic = require('paper-tonic')
|
||||
|
||||
-- get the 'Error' highlight group
|
||||
local hl_error = highlite.group('Error')
|
||||
local hl_error = paper-tonic.group('Error')
|
||||
|
||||
-- Define 'ErrorMsg' as foreground = background of 'Error'
|
||||
highlite.highlight('ErrorMsg', {fg=hl_error.bg, bg=BG})
|
||||
paper-tonic.highlight('ErrorMsg', {fg=hl_error.bg, bg=BG})
|
||||
<
|
||||
|
||||
*highlite.highlight()*
|
||||
`highlite`.highlight({group}, {attributes}) *highlite-highlight()*
|
||||
*paper-tonic.highlight()*
|
||||
`paper-tonic`.highlight({group}, {attributes}) *paper-tonic-highlight()*
|
||||
|
||||
Highlight some {group} according to its {attributes}.
|
||||
|
||||
|
@ -81,22 +81,22 @@ USAGE *highlite-usage*
|
|||
|
||||
Example: ~
|
||||
>
|
||||
local highlite = require('highlite')
|
||||
local paper-tonic = require('paper-tonic')
|
||||
|
||||
local yellow = {'#f0df33', 220, 'yellow'}
|
||||
|
||||
-- Highlight a new group
|
||||
highlite.highlight('Todo', {fg=yellow, style={'bold', 'underline'}})
|
||||
paper-tonic.highlight('Todo', {fg=yellow, style={'bold', 'underline'}})
|
||||
-- Link a grou
|
||||
highlite.highlight('Identifier', 'Todo')
|
||||
paper-tonic.highlight('Identifier', 'Todo')
|
||||
<
|
||||
|
||||
See also: ~
|
||||
|group-names| Additional semantic highlighting groups.
|
||||
|
||||
*highlite:highlight_terminal()*
|
||||
*highlite-highlight_terminal()*
|
||||
`highlite`:highlight_terminal({terminal_ansi_colors})
|
||||
*paper-tonic:highlight_terminal()*
|
||||
*paper-tonic-highlight_terminal()*
|
||||
`paper-tonic`:highlight_terminal({terminal_ansi_colors})
|
||||
|
||||
Override the |terminal| colors with a new table of {terminal_ansi_colors}.
|
||||
|
||||
|
@ -128,9 +128,9 @@ USAGE *highlite-usage*
|
|||
|
||||
Example: ~
|
||||
>
|
||||
local highlite = require('highlite')
|
||||
local paper-tonic = require('paper-tonic')
|
||||
|
||||
highlite:highlight_terminal({
|
||||
paper-tonic:highlight_terminal({
|
||||
[1] = {'#202020' , 0 , 'black'},
|
||||
[2] = {'#a80000' , 124 , 'darkred'},
|
||||
[3] = {'#50de60' , 83 , 'darkgreen'},
|
||||
|
@ -154,7 +154,7 @@ USAGE *highlite-usage*
|
|||
|terminal-configuration| Information about how the groups are set.
|
||||
|
||||
==============================================================================
|
||||
FAQ *highlite-faq*
|
||||
FAQ *paper-tonic-faq*
|
||||
|
||||
E5108: Error executing lua [string ":lua"]:1: module '<colorscheme>' not found ~
|
||||
|
||||
|
@ -165,7 +165,7 @@ Override the highlighting of one specific highlight group in my init.vim? ~
|
|||
When using this plugin, it is important to know that you cannot just run `:hi`
|
||||
on a highlight group and expect that its changes will be retained. You must
|
||||
attach them to the |ColorScheme| |autocmd-event|, as shown below: >
|
||||
packadd nvim-highlite
|
||||
packadd nvim-paper-tonic
|
||||
set termguicolors "optional
|
||||
|
||||
" WRONG! Don't do this.
|
||||
|
@ -173,11 +173,11 @@ attach them to the |ColorScheme| |autocmd-event|, as shown below: >
|
|||
|
||||
" Do this instead.
|
||||
augroup Highlite
|
||||
" You can also use `highlite.highlight()` instead of `:hi!`
|
||||
autocmd ColorScheme highlite hi! Error guifg=#000000 guibg=#FFFFFF
|
||||
" You can also use `paper-tonic.highlight()` instead of `:hi!`
|
||||
autocmd ColorScheme paper-tonic hi! Error guifg=#000000 guibg=#FFFFFF
|
||||
augroup end
|
||||
|
||||
colorscheme highlite
|
||||
colorscheme paper-tonic
|
||||
<
|
||||
|
||||
Of course, substitute "highlight" with the name of your colorscheme.
|
|
@ -0,0 +1,12 @@
|
|||
paper-tonic paper-tonic.txt /*paper-tonic*
|
||||
paper-tonic-faq paper-tonic.txt /*paper-tonic-faq*
|
||||
paper-tonic-group() paper-tonic.txt /*paper-tonic-group()*
|
||||
paper-tonic-highlight() paper-tonic.txt /*paper-tonic-highlight()*
|
||||
paper-tonic-highlight_terminal() paper-tonic.txt /*paper-tonic-highlight_terminal()*
|
||||
paper-tonic-requirements paper-tonic.txt /*paper-tonic-requirements*
|
||||
paper-tonic-toc paper-tonic.txt /*paper-tonic-toc*
|
||||
paper-tonic-usage paper-tonic.txt /*paper-tonic-usage*
|
||||
paper-tonic.group() paper-tonic.txt /*paper-tonic.group()*
|
||||
paper-tonic.highlight() paper-tonic.txt /*paper-tonic.highlight()*
|
||||
paper-tonic.txt paper-tonic.txt /*paper-tonic.txt*
|
||||
paper-tonic:highlight_terminal() paper-tonic.txt /*paper-tonic:highlight_terminal()*
|
|
@ -7,7 +7,9 @@
|
|||
--[[/* VARS */]]
|
||||
|
||||
--- Which set of colors to use.
|
||||
local _USE_256 = tonumber(vim.go.t_Co) > 255 or string.find(vim.env.TERM, '256')
|
||||
local has_t_Co = pcall(function() return vim.go.t_Co end)
|
||||
local _USE_256 = (has_t_Co and tonumber(vim.go.t_Co) > 255) or string.find(vim.env.TERM, '256')
|
||||
|
||||
|
||||
--- Indicating nothing for a highlight field.
|
||||
local _NONE = 'NONE'
|
Loading…
Reference in New Issue