Git Product home page Git Product logo

nvim-highlight-colors's Introduction

nvim-highlight-colors

Highlight colors with neovim

image

Features

  • Displays colors based on their HEX/rgb/hsl value
  • Super fast no matter the amount of colors
  • See the colors change as you edit them
  • CSS variables support
  • Tailwind CSS support

Installation

Add this to your init.vim

set termguicolors
set t_Co=256

Install plugin with Plug:

Plug 'brenoprata10/nvim-highlight-colors'

Call setup function to initialize plugin by default:

require('nvim-highlight-colors').setup {}

Commands

There are only two available command for now:

Command Description
HighlightColorsOn Turns on highlight feature
HighlightColorsOff Turns off highlight feature
HighlightColorsToggle Toggles highlight feature

You might also use:

lua require("nvim-highlight-colors").turnOff()
lua require("nvim-highlight-colors").turnOn()
lua require("nvim-highlight-colors").toggle()

Customization

Property Options Description
render background(default), first_column, foreground Changes how the colors will be rendered
enable_named_colors boolean(defaults to true) Adds highlight to css color names
enable_tailwind boolean(defaults to false) Adds highlight to tailwind colors
custom_colors Array<{label: string, color: string}> Adds custom colors based on declared label

Here is how you might use the options:

lua require("nvim-highlight-colors").setup {
	render = 'background', -- or 'foreground' or 'first_column'
	enable_named_colors = true,
	enable_tailwind = false,
	custom_colors = {
		-- label property will be used as a pattern initially(string.gmatch), therefore you need to escape the special characters by yourself with % 
		{label = '%-%-theme%-font%-color', color = '#fff'},
		{label = '%-%-theme%-background%-color', color = '#23222f'},
		{label = '%-%-theme%-primary%-color', color = '#0f1219'},
		{label = '%-%-theme%-secondary%-color', color = '#5a5d64'},
		{label = '%-%-theme%-contrast%-color', color = '#fff'},
		{label = '%-%-theme%-accent%-color', color = '#55678e'},
	}
}

Custom colors support:

image

Tailwind CSS support:

Screenshot from 2022-08-14 16-49-35

nvim-highlight-colors's People

Contributors

brenoprata10 avatar nickytope avatar akmadan23 avatar mg979 avatar zax-xyz avatar 4rgc avatar gsuuon avatar genzj avatar nebulaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.