jesseleite / nvim-noirbuddy

πŸ–€ A highly customizable minimalist theme building framework
345 stars 16 forks source link
neovim-plugin

Noirbuddy

A highly customizable minimalist theme building framework for Neovim πŸ–€

Built on colorbuddy.nvim, with a monochromatic base palette, and the ability to set a flavor color or two πŸ’…

Installation

  1. Install using your favourite package manager:

    Breaking changes: If you were previously using colorbuddy's dev branch, please switch to master!

    Using packer.nvim:

    use {
      "jesseleite/nvim-noirbuddy",
      requires = { "tjdevries/colorbuddy.nvim" }
    }

    Using lazy.nvim:

    {
      'jesseleite/nvim-noirbuddy',
      dependencies = {
        { 'tjdevries/colorbuddy.nvim' }
      },
      lazy = false,
      priority = 1000,
      opts = {
        -- All of your `setup(opts)` will go here
      },
    }

    Using vim-plug:

    Plug 'tjdevries/colorbuddy.nvim'
    Plug 'jesseleite/nvim-noirbuddy'
  2. Enable the colorscheme in your lua config:

    Note: You can skip this step if you're using lazy.nvim!

    require("noirbuddy").setup()
  3. Order pizza! πŸ• 🀘 😎

Selecting Presets

The default minimal preset consists of a monochromatic grayscale palette with one sexy primary color.

You can select from one of the bundled presets like so:

require('noirbuddy').setup {
  preset = 'miami-nights',
}

Available Presets

[!CAUTION] If using lazy.nvim, avoid setting vim.opt.colorscheme altogether, as it can cause issues with loading your configured noirbuddy presets. Instead, you may use the install = { colorscheme = { "noirbuddy" } } configuration option. See lazy.nvim's configuration for more details.

Customizing Your Theme

You can configure a custom primary color like so:

require('noirbuddy').setup {
  colors = {
    primary = '#6EE2FF',
  },
}

For a more duotone look, you can configure a secondary color:

require('noirbuddy').setup {
  colors = {
    primary = '#6EE2FF',
    secondary = '#267FB5',
  },
}

You can also customize the background color:

require('noirbuddy').setup {
  colors = {
    background = '#18181A',
  },
}

Or even the base grayscale palette:

require("noirbuddy").setup {
  colors = {
    noir_0 = '#ffffff', -- `noir_0` is light for dark themes, and dark for light themes
    noir_1 = '#f5f5f5',
    noir_2 = '#d5d5d5',
    noir_3 = '#b4b4b4',
    noir_4 = '#a7a7a7',
    noir_5 = '#949494',
    noir_6 = '#737373',
    noir_7 = '#535353',
    noir_8 = '#323232',
    noir_9 = '#212121', -- `noir_9` is dark for dark themes, and light for light themes
  },
}

Customizing Semantic Colors

You may wish to configure specific colors for things that have semantic meaning (ie. red for errors, orange for warnings, etc.), in a way that won't change as you switch between presets:

require("noirbuddy").setup {
  colors = {
    diagnostic_error = '#EC0034',
    diagnostic_warning = '#ff7700',
    diagnostic_info = '#d5d5d5',
    diagnostic_hint = '#f5f5f5',
    diff_add = '#f5f5f5',
    diff_change = '#737373',
    diff_delete = '#EC0034',
  },
}

Customizing Font Styles

Some highlight groups (ie. inline diagnostics) are set up so that you can opt-in to certain font styles (though which styles completely depends on the highlight group, and these are all disabled by default):

require("noirbuddy").setup {
  styles = {
    italic = true,
    bold = false,
    underline = false,
    undercurl = true,
  },
}

If you want more granular control over font styles, check out the customizing highlight grups section.

Customizing Third Party Plugins

Included Configs

Noirbuddy automatically themes several plugins out of the box (ie. telescope.nvim, vim-fugitive, harpoon, etc.), but also allows for customizing highlight groups and exporting colors so that you can have full control over every aspect when it comes to theming third party plugins.

Opt-In Configs

Though noirbuddy handles highlight groups automatically, certain plugins may require you to opt-in to more opinionated lua-based theme configs...

Contributions

If you use a plugin that you think should be included in this repo, PR's are welcome 🀘

Customizing Highlight Groups

Since Noirbuddy is built on colorbuddy.nvim, you can use its API to customize specific highlight groups as needed:

-- Require colorbuddy...
local Color, colors, Group, groups, styles = require('colorbuddy').setup {}

-- Override specific highlight groups...
Group.new('TelescopeTitle', colors.primary)
Group.new('TelescopeBorder', colors.secondary)
Group.new('CursorLineNr', colors.primary, colors.noir_9)
Group.new('Searchlight', nil, colors.secondary)
Group.new('@comment', colors.noir_7)
Group.new('@punctuation', colors.noir_2)

-- Add font styles to highlight groups...
Group.new('@constant', colors.noir_2, nil, styles.bold)
Group.new('@method', colors.noir_0, nil, styles.bold + styles.italic)

-- Link highlight groups...
Group.link('SignifySignAdd', groups.DiffAdd)
Group.link('SignifySignChange', groups.DiffChange)
Group.link('SignifySignDelete', groups.DiffDelete)

-- etc.

Exporting Colors

If you need access to Noirbuddy's raw color codes for other plugin configs:

-- Export noirbuddy colors...
local noirbuddy = require('noirbuddy.colors').all()

-- Outputs a simple lua table...
-- {
--   primary = "#e4609b",
--   secondary = "#47bac0",
--   background = "#18181a",
--   noir_0 = "#ffffff",
--   noir_1 = "#f5f5f5",
--   noir_2 = "#d5d5d5",
--   -- etc.
-- }

You can run :lua print(vim.inspect(require('noirbuddy.colors').all())) to see a full list of what is exported.

Thank You!