Skip to content

samflores/gypsum.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Gypsum for Neovim

A light and dark color scheme for Neovim with minimal highlighting based on the Alabaster theme by Nikita Prokopov.

Philosophy

Most color schemes highlight everything they can, ending up looking like a fireworks show. Instead, Alabaster - and by extension Gypsum - uses minimal highlighting with just four main classes:

  1. Strings - Green
  2. Constants - Magenta/Purple (numbers, symbols, keywords, boolean values)
  3. Comments - Red/Yellow (with emphasis, not dimmed)
  4. Definitions - Blue (global definitions, functions)

Alabaster/Gypsum does not highlight standard language keywords (if, else, function, etc). They are usually the least important and most obvious part of any program.

Why a new port?

While alabaster.nvim is an excellent port of the original Alabaster theme, it lacks the mono and bg variants. I wrote Gypsum with the bg variant in mind and later extended it to include the other variants as well. It also includes the dark-bg customization, which was not present in the original Alabaster theme, and the ability to customize the palette.

Features

  • Single unified colorscheme with variants controlled through setup options
  • Light/dark mode controlled by vim.o.background
  • Monochrome variant (mono option) - uses background colors for highlighting
  • Background-based variant (bg option) - uses colored backgrounds instead of colored text
  • Tree-sitter support
  • Configurable italics for comments and strings
  • Per-color customization
  • Transparent background option
  • Built-in Lualine theme

Requirements

  • Neovim. I'm using 0.11.4, but I think 0.9+ should work.
  • Tree-sitter (for best results)
  • LSP (for diagnostics and semantic highlighting)

Installation

Using lazy.nvim

{
  "samflores/gypsum.nvim",
  lazy = false,
  priority = 1000,
  config = function()
    vim.o.background = "dark" -- or "light"
    require("gypsum").setup({
      mono = false,
      bg = false,
    })
    vim.cmd([[colorscheme gypsum]])
  end,
}

Using pack.nvim

vim.pack.add({
  { src = 'https://github.com/samflores/gypsum.nvim' }
})

vim.o.background = "dark" -- or "light"
require("gypsum").setup({
  mono = false,
  bg = false,
})
vim.cmd([[colorscheme gypsum]])

On first startup, Neovim will automatically clone the repository. To update the plugin later, use:

vim.pack.update({ 'gypsum.nvim' })

Manual Installation

Clone the repository to any location and add it to your runtimepath:

# Clone the repository
git clone https://github.com/samflores/gypsum.nvim ~/path/to/gypsum.nvim

Then in your init.lua:

-- Add to runtimepath
vim.opt.runtimepath:append("~/path/to/gypsum.nvim")

-- Configure and load
vim.o.background = "dark" -- or "light"
require("gypsum").setup({
  mono = false,
  bg = false,
})
vim.cmd([[colorscheme gypsum]])

Configuration

Default configuration:

require("gypsum").setup({
  mono = false,
  bg = false,
  transparent = false,
  italic_comments = true,
  italic_strings = true,
  colors = {},
})

Options

  • mono: Use monochrome variant with background colors for highlighting (true or false)
  • bg: Use background-based variant with colored backgrounds instead of colored text (true or false)
  • transparent: Remove background color (true or false)
  • italic_comments: Use italic font for comments (true or false)
  • italic_strings: Use italic font for strings (true or false)
  • colors: Table to override default colors (see Color Customization)

Note: Light/dark mode is controlled by vim.o.background setting, not by a configuration option.

Usage

Basic usage

The colorscheme automatically detects Neovim's background setting:

vim.o.background = "light" -- or "dark"
require("gypsum").setup()
vim.cmd([[colorscheme gypsum]])

Using variants

Configure the mono and bg options to use different variants:

-- Monochrome variant
vim.o.background = "dark"
require("gypsum").setup({ mono = true })
vim.cmd([[colorscheme gypsum]])

-- Background-based variant
vim.o.background = "light"
require("gypsum").setup({ bg = true })
vim.cmd([[colorscheme gypsum]])

Available combinations

  • background=light, mono=false, bg=false → Standard light theme
  • background=light, mono=true, bg=false → Light monochrome theme
  • background=light, mono=false, bg=true → Light background-based theme
  • background=dark, mono=false, bg=false → Standard dark theme
  • background=dark, mono=true, bg=false → Dark monochrome theme
  • background=dark, mono=false, bg=true → Dark background-based theme

Toggle between light and dark

vim.keymap.set("n", "<leader>tl", function()
  vim.o.background = "light"
  vim.cmd([[colorscheme gypsum]])
end, { desc = "Gypsum Light" })

vim.keymap.set("n", "<leader>td", function()
  vim.o.background = "dark"
  vim.cmd([[colorscheme gypsum]])
end, { desc = "Gypsum Dark" })

Color Customization

You can customize any color in the theme by passing a colors table to the setup function:

require("gypsum").setup({
  colors = {
    comment = "#FF0000",
    string = "#00FF00",
    bg = "#000000",
  }
})

Available color keys

All colors from the palette can be overridden:

  • bg, fg - Background and foreground
  • comment, string, constant, definition, punctuation - Main syntax colors
  • selection, inactive_selection, line_highlight - UI colors
  • active, orange, grey - Accent colors
  • error, warning, info, hint - Diagnostic colors
  • diff_add, diff_delete, diff_change, diff_text - Git diff colors

Example with lazy.nvim

{
  "samflores/gypsum.nvim",
  lazy = false,
  priority = 1000,
  config = function()
    vim.o.background = "dark"
    require("gypsum").setup({
      colors = {
        comment = "#DFDF8E",
        string = "#95CB82",
      }
    })
    vim.cmd([[colorscheme gypsum]])
  end,
}

Color Palette

Light Variant

  • Background: #F7F7F7
  • Foreground: #000000
  • Comments: #AA3731 (red)
  • Strings: #448C27 (green)
  • Constants: #7A3E9D (magenta)
  • Definitions: #325CC0 (blue)
  • Punctuation: #777777 (grey)
  • Selection: #BFDBFE
  • Active/Cursor: #007ACC

Dark Variant

  • Background: #0E1415
  • Foreground: #CECECE
  • Comments: #DFDF8E (yellow)
  • Strings: #95CB82 (green)
  • Constants: #CC8BC9 (purple)
  • Definitions: #71ADE7 (blue)
  • Punctuation: #708B8D (grey-blue)
  • Selection: #293334
  • Active/Cursor: #CD974B (orange)

Plugin Support

Gypsum includes highlight groups for:

  • Tree-sitter
  • LSP
  • Telescope
  • nvim-tree
  • GitSigns
  • nvim-cmp
  • Diagnostics
  • Lualine (built-in themes)

Lualine

Gypsum includes a built-in Lualine theme that automatically adapts to your colorscheme configuration:

require('lualine').setup {
  options = {
    theme = 'gypsum'
  }
}

The Lualine theme will match your vim.o.background, mono, and bg settings.

Credits

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages