You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RRethy/vim-hexokinase: hexokinase.vim - The fastest (Neo)Vim plugin for asynchronously displaying the colours in the file (#rrggbb, #rgb, rgb(a)? functions, hsl(a)? functions, web colours, custom patterns)
#88
Open
yaohunzhanyue opened this issue
May 26, 2020
· 0 comments
The fastest (Neo)Vim plugin for asynchronously displaying the colours in the file (#rrggbb, #rgb, rgb(a)? functions, hsl(a)? functions, web colours, custom patterns)
let g:Hexokinase_highlighters = ['virtual']
let g:Hexokinase_highlighters = ['sign_column']
let g:Hexokinase_highlighters = ['foreground']
let g:Hexokinase_highlighters = ['foregroundfull']
let g:Hexokinase_highlighters = ['background']
let g:Hexokinase_highlighters = ['backgroundfull']
Rationale
Problem:Colorizer and Colorizer are plugins which also display the colour of text. However, they do so by changing the background of the text which is not pleasing to look at. On top of that, they all scrape the file synchronously.
Solution: Have 6 different options for displaying colour, including as virtual text or in the sign column. As well, do all scraping asynchronously.
About
This plugin can display the colour of 6 digit hex codes, 3 digit hex codes, rgb functions, rgba functions, hsl functions, hsla functions, and custom patterns.
Colour can be displayed in each of the 6 six ways shown above, or can be customized to display colour any way the user chooses.
Note: By default all filetypes are scraped and highlighted on BufWrite and BufCreate, see :h g:Hexokinase_refreshEvents for more info.
Migration for existing users
See :help hexokinase-v1-migration
Requirements
:h 'termguicolors' must be turned on and your terminal must support it
For virtual text: Neovim 0.3.2
For sign_column: Vim compiled with +signs or any Neovim version
" Neovim defaultletg:Hexokinase_highlighters= [ 'virtual' ]
" Vim defaultletg:Hexokinase_highlighters= [ 'sign_column' ]
" All possible highlightersletg:Hexokinase_highlighters= [
\ 'virtual',
\ 'sign_column',
\ 'background',
\ 'backgroundfull',
\ 'foreground',
\ 'foregroundfull'\ ]
Choose which patterns are matched:
" Patterns to match for all filetypes" Can be a comma separated string or a list of strings" Default value:letg:Hexokinase_optInPatterns='full_hex,rgb,rgba,hsl,hsla,colour_names'" All possible valuesletg:Hexokinase_optInPatterns= [
\ 'full_hex',
\ 'triple_hex',
\ 'rgb',
\ 'rgba',
\ 'hsl',
\ 'hsla',
\ 'colour_names'\ ]
" Filetype specific patterns to match" entry value must be comma seperated listletg:Hexokinase_ftOptInPatterns= {
\ 'css': 'full_hex,rgb,rgba,hsl,hsla,colour_names',
\ 'html': 'full_hex,rgb,rgba,hsl,hsla,colour_names'\ }
Choose which filetypes to scrape automatically (by default ALL filetypes are scraped):
" Sample value, to keep default behaviour don't define this variableletg:Hexokinase_ftEnabled= ['css', 'html', 'javascript']
Commands
Command
Description
HexokinaseToggle
Toggle the colouring
HexokinaseTurnOn
Turn on colouring (refresh if already turned on)
HexokinaseTurnOff
Turn off colouring
Full Configuration
See :help hexokinase.txt
Custom Patterns
See :help g:Hexokinase_palettes.
This can be used to colour specific variables.
FAQ
I'm seeing grey colours when I toggle vim-hexokinase
vim-hexokinase
The fastest (Neo)Vim plugin for asynchronously displaying the colours in the file (#rrggbb, #rgb, rgb(a)? functions, hsl(a)? functions, web colours, custom patterns)
Rationale
Problem: Colorizer and Colorizer are plugins which also display the colour of text. However, they do so by changing the background of the text which is not pleasing to look at. On top of that, they all scrape the file synchronously.
Solution: Have 6 different options for displaying colour, including as virtual text or in the sign column. As well, do all scraping asynchronously.
About
This plugin can display the colour of 6 digit hex codes, 3 digit hex codes, rgb functions, rgba functions, hsl functions, hsla functions, and custom patterns.
Colour can be displayed in each of the 6 six ways shown above, or can be customized to display colour any way the user chooses.
Note: By default all filetypes are scraped and highlighted on
BufWrite
andBufCreate
, see:h g:Hexokinase_refreshEvents
for more info.Migration for existing users
See
:help hexokinase-v1-migration
Requirements
:h 'termguicolors'
must be turned on and your terminal must support it+signs
or any Neovim version:h deprecated-hexokinase.txt
.Installation
make hexokinase
is executed in the project root::set termguicolors
Quick Start
Choose your method of highlighting:
Choose which patterns are matched:
Choose which filetypes to scrape automatically (by default ALL filetypes are scraped):
Commands
Full Configuration
See
:help hexokinase.txt
Custom Patterns
See
:help g:Hexokinase_palettes
.This can be used to colour specific variables.
FAQ
You need
termguicolors
to be turned on. Verify:set termguicolors?
outputstermguicolors
. For more info, see RRethy/vim-hexokinase#10.https://github.com/RRethy/vim-hexokinase
The text was updated successfully, but these errors were encountered: