All Projects → RRethy → Vim Hexokinase

RRethy / Vim Hexokinase

hexokinase.vim - (Neo)Vim plugin for asynchronously displaying the colours in the file (#rrggbb, #rgb, rgb(a)? functions, hsl(a)? functions, web colours, custom patterns)

Projects that are alternatives of or similar to Vim Hexokinase

Nnn.vim
File manager for vim/neovim powered by n³
Stars: ✭ 414 (-33.44%)
Mutual labels:  vim-plugin
Palenight.vim
Soothing color scheme for your favorite [best] text editor
Stars: ✭ 492 (-20.9%)
Mutual labels:  vim-plugin
Julia Vim
Vim support for Julia.
Stars: ✭ 556 (-10.61%)
Mutual labels:  vim-plugin
Rainbow levels.vim
A different approach to code highlighting.
Stars: ✭ 415 (-33.28%)
Mutual labels:  vim-plugin
Nerdcommenter
Vim plugin for intensely nerdy commenting powers
Stars: ✭ 4,454 (+616.08%)
Mutual labels:  vim-plugin
Vim Markdown Composer
An asynchronous markdown preview plugin for Vim and Neovim.
Stars: ✭ 501 (-19.45%)
Mutual labels:  vim-plugin
Vim Cursorword
Underlines the word under the cursor
Stars: ✭ 401 (-35.53%)
Mutual labels:  vim-plugin
Traces.vim
Range, pattern and substitute preview for Vim
Stars: ✭ 568 (-8.68%)
Mutual labels:  vim-plugin
Tmux Complete.vim
Vim plugin for insert mode completion of words in adjacent tmux panes
Stars: ✭ 447 (-28.14%)
Mutual labels:  vim-plugin
Srcery Vim
Dark colorscheme for gvim and vim
Stars: ✭ 518 (-16.72%)
Mutual labels:  vim-plugin
Vim Startify
🔗 The fancy start screen for Vim.
Stars: ✭ 4,479 (+620.1%)
Mutual labels:  vim-plugin
Vim Godebug
Go debugging for Vim
Stars: ✭ 437 (-29.74%)
Mutual labels:  vim-plugin
Switch.vim
A simple Vim plugin to switch segments of text with predefined replacements
Stars: ✭ 506 (-18.65%)
Mutual labels:  vim-plugin
Vim Pizza
My initial attempt at trying to order pizza from within vim.
Stars: ✭ 414 (-33.44%)
Mutual labels:  vim-plugin
Vim Disapprove Deep Indentation
ಠ_ಠ Vim plugin to disapprove deeply indented code. ಠ_ಠ
Stars: ✭ 566 (-9%)
Mutual labels:  vim-plugin
Vim Windowswap
Swap your windows without ruining your layout
Stars: ✭ 405 (-34.89%)
Mutual labels:  vim-plugin
Vim Colors Pencil
Light (& dark) color scheme inspired by iA Writer
Stars: ✭ 498 (-19.94%)
Mutual labels:  vim-plugin
Phpcomplete.vim
Improved PHP omnicompletion
Stars: ✭ 582 (-6.43%)
Mutual labels:  vim-plugin
Vim Gnupg
This script implements transparent editing of gpg encrypted files.
Stars: ✭ 566 (-9%)
Mutual labels:  vim-plugin
Committia.vim
A Vim plugin for more pleasant editing on commit messages
Stars: ✭ 510 (-18.01%)
Mutual labels:  vim-plugin

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)

let g:Hexokinase_highlighters = ['virtual']

gif

let g:Hexokinase_highlighters = ['sign_column']

gif

set signcolumn=yes:9 " Neovim only

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 ['TextChanged', 'InsertLeave', 'BufRead'], see :h g:Hexokinase_refreshEvents for more info.

Requirements

  • :h 'termguicolors' must be turned on and your terminal must support it
  • Golang must be installed, for more information visit https://golang.org/doc/install.
  • For virtual text: Neovim 0.3.2
  • For sign_column: Vim compiled with +signs or any Neovim version
  • Currently, untested on Windows, help is welcomed.

Installation

  1. Install Golang https://golang.org/doc/install
  2. Install the plugin with the plugin manager of choice and ensure make hexokinase is executed in the project root:
" vim-plug
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }

" minpac
call minpac#add('rrethy/vim-hexokinase', { 'do': 'make hexokinase' })

" dein
call dein#add('rrethy/vim-hexokinase', { 'build': 'make hexokinase' })

" etc.
  1. :set termguicolors

Quick Start

Choose your method of highlighting:

" Neovim default
let g:Hexokinase_highlighters = [ 'virtual' ]

" Vim default
let g:Hexokinase_highlighters = [ 'sign_column' ]

" All possible highlighters
let g: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:
let g:Hexokinase_optInPatterns = 'full_hex,rgb,rgba,hsl,hsla,colour_names'

" All possible values
let g:Hexokinase_optInPatterns = [
\     'full_hex',
\     'triple_hex',
\     'rgb',
\     'rgba',
\     'hsl',
\     'hsla',
\     'colour_names'
\ ]

" Filetype specific patterns to match
" entry value must be comma seperated list
let g: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 variable
let g: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

You need termguicolors to be turned on. Verify :set termguicolors? outputs termguicolors. For more info, see https://github.com/RRethy/vim-hexokinase/issues/10.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].