Git Product home page Git Product logo

nerdcontrast.nvim's Introduction

nerdcontrast.nvim

A colorscheme helper with some default based on default theme of big java IDEs.

Requirements

  • Neovim 0.8.0+

Installation

return {
  'JosefLitos/nerdcontrast.nvim',
  lazy = false,
  priority = 1000,
  opts = { -- use config = fun() to change vim.o.bg beforehand
    export = false, -- set underlying terminal's colors to the theme
    opacity = true, -- false: no bg, true: nvim bg, '00'-'ff': term opacity
    theme = {base = 'nc', override = {}}, -- default used theme, unles changed
    light = {palette = {base = 'light'}}, -- opts above, light bg specific
    dark = {palette = {base = 'dark'}}, -- opts above, dark bg specific
  }
}

Screenshots

  • default nc theme nc md nc lua

Wider usage

Theme toggle

-- Dark/Soft theme toggle
nmap('n', '<Leader>c', function()
  vim.o.bg = vim.o.bg == 'light' and 'dark' or 'light'
end)

Day/Night theme change

require'nerdcontrast'.setup { -- set your presets
  export = true,
  light = {opacity = 'ff'},
  dark = {opacity = 'cc'},
}
local t = io.popen('sunwait poll 50N 14.5E', 'r')
if t ~= nil then -- determine day or night
  vim.o.background = t:read('*l') == 'DAY' and 'light' or 'dark'
  t.close(t)
else
  local h = os.time() % 86400 / 3600 +TZ
  vim.o.background = (7 < h and h < 20) and 'light' or 'dark'
end

Highlight group customization

local nc = require 'nerdcontrast'

nc.setup { -- changes in both light and dark bg
	-- set palette/hue used by themes or add your own
  palette = {custom = {CustomColor = {bg = '#dd3388'}}}
	-- themes change what colors basic groups use
  theme = {override = {Operator = 'CustomColor'}} -- all related groups updated
}
nc.hi {
  OneBog = {fg='CustomColor', bg='Operator'}, -- both are available

  -- set hex values of given nerdcontrast custom colors
  BoldGreen = {fg = 'Green', bold = true},
  -- directly linked
  DefaultFg = 'Fg1', -- fg part of `Normal`… - Fg1,…,Fg5,Bg4,…,Bg1
  CursorBg = 'Bg2', -- BgX changes background
  -- Basic nvim groups set in `theme`, use these to be theme independent
  Error = {fg = 'Comment', bg = 'Red'}, -- specific color set in `palette`
  BgGraySpiked = {sp = 'Bg3', undercurl = true},
}
nc.setup {
  -- set overlay for NvimTree + BarBar, different for light and dark bg
  light = {theme = {override = {WinBar = 'Bg2', WinBarNC = 'Bg3'}}, opacity = 'ff'},
  dark = {theme = {override = {WinBar = 'Bg1b', WinBarNC = 'Bg2b'}}, opacity = 'cc'},
}

Plugin support

see the plugin folder and extra small adjustments

Available colors/themes

  • see available palettes and themes
  • or make your own and use them with directly as base tbl or path to your module

Get color codes

Get color hex with require'nerdcontrast'.palette/theme['Color name'][1] or link to them directly by name

  • for bg independency, Bg/Fg<x> and other color links under nc.palette are available
    • palette colors are targeted for colorscheme creation
  • for extra highlights prefer use of nc.theme groups for theme independency

nerdcontrast.nvim's People

Contributors

joseflitos avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

nerdcontrast.nvim's Issues

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.